<div dir="ltr"><span style="font-size:12.8px">Hi Christian,</span><br><div><span style="font-size:12.8px">I have the </span><span style="color:rgb(80,0,80);font-size:12.8px">Single Pass Stereo working with </span><span style="color:rgb(0,0,0);white-space:pre-wrap">ARB_viewport_array and and a shader (attached). The required support for GL_</span><font color="#000000"><span style="white-space:pre-wrap">ARB_viewport_array is on the osg-submissions list. I have not done any work on the culling yet, as the eyes are sufficiently close together to get a decent impression of performance. bringing in light render passes would probably require a smart adaptation of the cull frustum.</span></font><br></div><div><font color="#000000"><span style="white-space:pre-wrap">The nvidia stereo_view_rendering seems to be to limiting for my purposes, as I think it requires the display to be aligned with the eyes, and we are working with head-tracked systems where the user is able to rotate their head.</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><br></div><div><font color="#000000"><span style="white-space:pre-wrap">Regards, Laurens.</span></font></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">in the vertex shader do:</span></div><div><font color="#000000"><span style="white-space:pre-wrap">gl_Position   = gl_ModelViewMatrix * gl_Vertex;</span></font><br></div><div><font color="#000000"><span style="white-space:pre-wrap">instead of </span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">gl_Position   = gl_ModelViewProjectionMatrix * gl_Vertex;</span><br></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">For the rest of the shaders I rely on the osg shadergenerator with base shaders from osg-data.</span></font></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><font color="#000000"><span style="white-space:pre-wrap">                 new osg::Shader(osg::Shader::GEOMETRY,
                                "#version 450\n"
                                "#extension GL_ARB_gpu_shader5 : enable\n"
                                "layout (triangles, invocations = 2) in;"
                                "layout (triangle_strip, max_vertices = 3) out;"
                                "uniform mat4 transform_block[2];"
                                "in vec4 vbasecolor[];"
                                "in vec2 vtexcoord[];"
                                "out vec4 basecolor;"
                                "out vec2 texcoord;"
                                "out int gl_Layer;"
                                "void main(void) {"
                                "    for (int i = 0; i < gl_in.length(); i++)"
                                "    {"
                                "          basecolor = vec4(1,1,1,1);"
                                "        texcoord = vtexcoord[i];"
                                "        gl_Position = transform_block[gl_InvocationID] * gl_in[i].gl_Position;"
                                "        gl_ViewportIndex = gl_InvocationID;"
                                "        EmitVertex();"
                                "    }"
                                "    EndPrimitive();"
                                "}"
                        );</span></font><br></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 9, 2016 at 1:24 PM, Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Christian<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
has anybody looked at these new features of nVidia hardware?<br>
<br>
Lens Matched Shading and Single Pass Stereo are using new hardware and driver features that allow the GPU to perform single pass transform+shading of up to 16 independent view matrices.<br>
</blockquote></span>
Isn't the change-set of single pass stereo (<a href="https://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt" rel="noreferrer" target="_blank">https://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt</a>) shader only?<br>
So basically we need the NV_viewport_array2 support on the osg-side to implement it.<br>
Btw.: How is the relationship between viewports and bound FBOs for instance? Suppose I need to render to different MRTs for each viewport? Can anyone point to a good example here?<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This could accelerate OSG's stereo rendering, provided that the features are exposed thorugh documented OpenGL extensions.<br>
<br>
Also rendering of cubemaps for reflections and shadows could be greatly accelerated (six views in one pass).<br>
</blockquote></span>
That would require some deeper changes in the culling/camera-setup I suppose, as multiple frusta have to be taken into account per draw-invocation.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Christian<br>
</blockquote>
Cheers<br>
Sebstian<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>