Hello J.P., both cameras have the same graphics context (gc). Here the complete part of the code with the views:
osg::ref_ptr< osgViewer::View > view0 = new osgViewer::View; view0->setSceneData(root); view0->setDisplaySettings(ds0); view0->getCamera()->setViewport(500,0,500,800); view0->getCamera()->setGraphicsContext(gc); osg::ref_ptr< osgViewer::View > view1 = new osgViewer::View; view1->setSceneData(root); view1->setDisplaySettings(ds1); view1->getCamera()->setViewport(0,0,500,800); view1->getCamera()->setGraphicsContext(gc); osg::ref_ptr< osgViewer::CompositeViewer > viewer = new osgViewer::CompositeViewer; viewer->addView(view0); viewer->addView(view1); Cheers Martin -------- Original-Nachricht -------- > Datum: Wed, 16 Feb 2011 14:58:19 +0200 > Von: "J.P. Delport" <jpdelp...@csir.co.za> > An: OpenSceneGraph Users <osg-users@lists.openscenegraph.org> > Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo > have you tried sharing a context between the views? I'm not very > familiar with stereo, but my guess would be the context of the second > view is not set for stereo. > > jp > > On 16/02/11 14:50, "Martin Großer" wrote: > > Hi, > > > > there are no ideas what is wrong with my test programme? > > I have no idea to fix this problem. > > > > Cheers > > > > Martin > > > > -------- Original-Nachricht -------- > >> Datum: Tue, 15 Feb 2011 10:34:49 +0100 > >> Von: "Martin Großer"<grosser.mar...@gmx.de> > >> An: OpenSceneGraph Users<osg-users@lists.openscenegraph.org> > >> Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with > Stereo > > > >> Hello Robert, > >> > >> I tried a simple test programme. I used the composite viewer and two > >> views. If I set up stereo on one view, it works fine. Also with the > horizontal > >> interlace. But if I set the stereo to both, I get the message "Warning: > >> detected OpenGL error 'invalid value' after RenderBin::draw(,)" and > only the > >> first view works. It seems to me that my graphics context is not > correct for > >> this use case. > >> > >> Here the main lines of my test programme: > >> > >> > >> // DisplaySettings > >> osg::DisplaySettings* ds0 = new osg::DisplaySettings; > >> ds0->setStereo(true); > >> ds0->setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); > >> > >> osg::DisplaySettings* ds1 = new osg::DisplaySettings; > >> ds1->setStereo(true); > >> ds1->setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); > >> > >> // Graphics Context > >> osg::ref_ptr<osg::GraphicsContext::Traits> traits = new > >> osg::GraphicsContext::Traits; > >> > >> traits->x = 100; > >> traits->y = 100; > >> traits->width = 1000; > >> traits->height = 800; > >> traits->windowDecoration = true; > >> traits->doubleBuffer = true; > >> traits->sharedContext = 0; > >> traits->stencil = 8; > >> traits->useMultiThreadedOpenGLEngine=true; > >> traits->vsync=true; > >> traits->screenNum = 0; > >> > >> osg::ref_ptr<osg::GraphicsContext> gc = > >> osg::GraphicsContext::createGraphicsContext(traits.get()); > >> if (gc.valid()){ [...] } > >> > >> osg::ref_ptr< osgViewer::View> view0 = new osgViewer::View; > >> view0->setDisplaySettings(ds0); > >> [...] > >> > >> osg::ref_ptr< osgViewer::View> view1 = new osgViewer::View; > >> view1->setDisplaySettings(ds1); > >> [...] > >> > >> > >> Best regards > >> > >> Martin > >> > >> > >> -------- Original-Nachricht -------- > >>> Datum: Mon, 14 Feb 2011 11:36:53 +0000 > >>> Von: Robert Osfield<robert.osfi...@gmail.com> > >>> An: OpenSceneGraph Users<osg-users@lists.openscenegraph.org> > >>> Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with > >> Stereo > >> > >>> Hi Martin, > >>> > >>> The rendering backend is identical between Viewer and CompositeViewer > >>> so both are fully capable of doing stereo. I presume the issue comes > >>> from the DisplaySettings hints used to pass in the stereo settings. > >>> With CompositeViewer each View can have it's own DisplaySettings > >>> object so you can set this up independantly. > >>> > >>> Robert. > >>> > >>> 2011/2/14 "Martin Großer"<grosser.mar...@gmx.de>: > >>>> Hello, > >>>> > >>>> I use the osg composite viewer and I try to use some stereo mode, > i.e. > >>> CHECKERBOARD, HORIZONTAL_INTERLACE or the VERTICAL_INTERLACE. But this > >> modes > >>> don't work with the composite viewer. I use osg 2.8. > >>>> > >>>> I guessed it is a problem in my application, so I tried the > >>> osgcompositeviewer example with these stereo modes. Also these didn't > >> work. > >>>> > >>>> Any ideas? > >>>> > >>>> Cheers > >>>> > >>>> Martin > >>>> -- > >>>> Schon gehört? GMX hat einen genialen Phishing-Filter in die > >>>> Toolbar eingebaut! http://www.gmx.net/de/go/toolbar > >>>> _______________________________________________ > >>>> osg-users mailing list > >>>> osg-users@lists.openscenegraph.org > >>>> > >>> > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >>>> > >>> _______________________________________________ > >>> osg-users mailing list > >>> osg-users@lists.openscenegraph.org > >>> > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >> > >> -- > >> NEU: FreePhone - kostenlos mobil telefonieren und surfen! > >> Jetzt informieren: http://www.gmx.net/de/go/freephone > >> _______________________________________________ > >> osg-users mailing list > >> osg-users@lists.openscenegraph.org > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > -- > This message is subject to the CSIR's copyright terms and conditions, > e-mail legal notice, and implemented Open Document Format (ODF) standard. > The full disclaimer details can be found at > http://www.csir.co.za/disclaimer.html. > > This message has been scanned for viruses and dangerous content by > MailScanner, > and is believed to be clean. MailScanner thanks Transtec Computers for > their support. > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org