Hi all,

I have a problem when trying to use the stereo mode HORIZONTAL_INTELACE 
with a viewer that is integrated into Qt utilizing the QOpenGLWidget: It 
doesn't work.

My integrated viewer class subclasses QOpenGLWidget as well as the 
osgViewer::Viewer. 

In my initialization routine I create a graphic context like this:

osg::DisplaySettings::instance()->setNumMultiSamples(DEFAULT_MULTISAMPLING);


osg::ref_ptr<osg::GraphicsContext::Traits> pTraits = new 
osg::GraphicsContext::Traits;

pTraits->x = 0;

pTraits->y = 0;

pTraits->width = DEFAULT_SCREEN_WIDTH;

pTraits->height = DEFAULT_SCREEN_HEIGHT;

pTraits->doubleBuffer = true;  
pTraits->stencil = 8;


mpGraphicsWindowEmbeddedContext = new

      osgViewer::GraphicsWindowEmbedded(pTraits.get());


I use this graphics content and set it to the render camera:

mpRenderCamera->setGraphicsContext(mpGraphicsWindowEmbeddedContext);

mpRenderCamera->setViewport(0, 0, DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT);

mpRenderCamera->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

mpRenderCamera->setClearColor(osg::Vec4(DEFAULT_BG_COLOR_R, DEFAULT_BG_COLOR_G, 
DEFAULT_BG_COLOR_B,

                                   DEFAULT_BG_COLOR_A));


For my QOpenGLWidget I have set my QSurfaceFormat like this: 

QSurfaceFormat format(QSurfaceFormat::defaultFormat());

format.setSamples(DEFAULT_MULTISAMPLING);

format.setStencilBufferSize(8);

setFormat(format);


When I run my code I only see the image for the left eye without any 
interlacing by the image for the right eye.

I also tried the viewer from https://github.com/openscenegraph/osgQt but it 
gives me the same result.

I suppose it has something to to with the stencil buffer, but I don't know 
how to fix it. Can someone please help me? 

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/d1244997-17b6-4c47-abf7-d5ddaf44b315%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to