<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi, <br>
<blockquote
cite="mid:CAG7xrZfEN9tumJ2L+kgjDyB82=Gt6ALjE95R31L54awPJFN-DQ@mail.gmail.com"
type="cite">
<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>
</blockquote>
The big deal about this extension is that the vertex and geometry
shader isn't invoked twice. This might quite save a bit if you are
limited at the those stages. But thank you for the example. <br>
<br>
Cheers<br>
Sebastian <br>
<blockquote
cite="mid:CAG7xrZfEN9tumJ2L+kgjDyB82=Gt6ALjE95R31L54awPJFN-DQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><font color="#000000"><span style="white-space:pre-wrap">
</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">
</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">
</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">
</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">
</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
moz-do-not-send="true"
href="mailto:sebastian.messerschmidt@gmx.de"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:sebastian.messerschmidt@gmx.de">sebastian.messerschmidt@gmx.de</a></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
moz-do-not-send="true"
href="https://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt"
rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="https://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt">https://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt</a></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 moz-do-not-send="true"
href="mailto:osg-users@lists.openscenegraph.org"
target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a moz-do-not-send="true"
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
</body>
</html>