<div dir="ltr">Hi all,<div><br></div><div>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.</div><div><br></div><div>My integrated viewer class subclasses QOpenGLWidget as well as the osgViewer::Viewer. </div><div><br></div><div>In my initialization routine I create a graphic context like this:</div><div><br></div><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">DisplaySettings</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">instance</span></span><span style="color: #660;" class="styled-by-prettify">()</span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setNumMultiSamples</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_MULTISAMPLING</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">ref_ptr</span></span><span style="color: #660;" class="styled-by-prettify"><</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">GraphicsContext</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">Traits</span></span><span style="color: #660;" class="styled-by-prettify">></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><span style="color: #008;" class="styled-by-prettify">new</span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">GraphicsContext</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">Traits</span></span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify">x</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(0, 0, 128);"><span style="color: #066;" class="styled-by-prettify">0</span></span><span style="color: #660;" class="styled-by-prettify">;</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify">y</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(0, 0, 128);"><span style="color: #066;" class="styled-by-prettify">0</span></span><span style="color: #660;" class="styled-by-prettify">;</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify">width</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_SCREEN_WIDTH</span></span><span style="color: #660;" class="styled-by-prettify">;</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify">height</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_SCREEN_HEIGHT</span></span><span style="color: #660;" class="styled-by-prettify">;</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">-></span></span><span style="color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify">doubleBuffer</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(128, 128, 0);"><span style="color: #008;" class="styled-by-prettify">true</span></span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify">  <br>pTraits</span><span style="color: #660;" class="styled-by-prettify">-></span><span style="color: #000;" class="styled-by-prettify">stencil </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">8</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 0);"><span style="color: #000;" class="styled-by-prettify"><br>mpGraphicsWindowEmbeddedContext</span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 103, 124);"><span style="color: #660;" class="styled-by-prettify">=</span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><span style="color: #008;" class="styled-by-prettify">new</span></span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify">      </span></span><span style="color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osgViewer</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">GraphicsWindowEmbedded</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">pTraits</span></span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: rgb(0, 103, 124);"><span style="color: #008;" class="styled-by-prettify">get</span></span><span style="color: #660;" class="styled-by-prettify">());</span></pre></div></code></div><br>I use this graphics content and set it to the render camera:</div><div><br></div><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">mpRenderCamera</span></span><span style="color: #660;" class="styled-by-prettify">-></span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setGraphicsContext</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #000;" class="styled-by-prettify">mpGraphicsWindowEmbeddedContext</span><span style="color: #660;" class="styled-by-prettify">);</span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: #000;" class="styled-by-prettify">mpRenderCamera</span><span style="color: #660;" class="styled-by-prettify">-></span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setViewport</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(0, 0, 128);"><span style="color: #066;" class="styled-by-prettify">0</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(0, 0, 128);"><span style="color: #066;" class="styled-by-prettify">0</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_SCREEN_WIDTH</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_SCREEN_HEIGHT</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: #000;" class="styled-by-prettify">mpRenderCamera</span><span style="color: #660;" class="styled-by-prettify">-></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setClearMask</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 128);"><span style="color: #000;" class="styled-by-prettify">GL_DEPTH_BUFFER_BIT</span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">|</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 128);"><span style="color: #000;" class="styled-by-prettify">GL_COLOR_BUFFER_BIT</span></span><span style="color: #660;" class="styled-by-prettify">);</span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: #000;" class="styled-by-prettify">mpRenderCamera</span><span style="color: #660;" class="styled-by-prettify">-></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setClearColor</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">Vec4</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_BG_COLOR_R</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_BG_COLOR_G</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_BG_COLOR_B</span></span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: #000;" class="styled-by-prettify"><br></span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify">                                   </span></span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_BG_COLOR_A</span></span><span style="color: #660;" class="styled-by-prettify">));</span></pre></div></code></div><br>For my QOpenGLWidget I have set my QSurfaceFormat like this: </div><div><br></div><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">QSurfaceFormat</span></span><span style="color: rgb(192, 192, 192);"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">format</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(128, 0, 128);"><span style="color: #606;" class="styled-by-prettify">QSurfaceFormat</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">defaultFormat</span></span><span style="color: #660;" class="styled-by-prettify">());</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">format</span></span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setSamples</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(206, 92, 0);"><span style="color: #000;" class="styled-by-prettify">DEFAULT_MULTISAMPLING</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">format</span></span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setStencilBufferSize</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(0, 0, 128);"><span style="color: #066;" class="styled-by-prettify">8</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre><pre style="color: rgb(0, 0, 0); font-size: medium;"><span style="color: rgb(0, 103, 124);"><span style="color: #000;" class="styled-by-prettify">setFormat</span></span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: rgb(9, 46, 100);"><span style="color: #000;" class="styled-by-prettify">format</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre></div></code></div><br>When I run my code I only see the image for the left eye without any interlacing by the image for the right eye.</div><div><br></div><div>I also tried the viewer from <a href="https://github.com/openscenegraph/osgQt">https://github.com/openscenegraph/osgQt</a> but it gives me the same result.</div><div><br></div><div>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? </div><div><br></div><div>Thanks in advance.</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/d1244997-17b6-4c47-abf7-d5ddaf44b315%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/d1244997-17b6-4c47-abf7-d5ddaf44b315%40googlegroups.com</a>.<br />