[osg-users] Horizontal-Interlaced-Stereo not working when integrated in Qt

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Mon Apr 27 05:50:13 PDT 2020


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+unsubscribe at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200427/3b51bc04/attachment.html>


More information about the osg-users mailing list