<div dir="ltr">Sebastian,<div><br></div><div>Have you tried setting the data variance to DYNAMIC on the StateSet containing the Uniform?</div><div><br></div><div>That's the first thing I would try -- not sure whether it works on Uniforms though.</div><div><br></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Glenn Waldron</div></div></div></div>
<br><div class="gmail_quote">On Wed, May 3, 2017 at 11:49 AM, 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">Hi,<br>
<br>
I've just stumbled upon something I find hard to understand.<br>
My setup contains multiple cameras (using FBO and MRT) with a specific render-order set to them. The first camera is essentially a render-scene-to-MRT pass.<br>
In the simplest case a second camera will pick up the textures rendered to and use them to draw to the framebuffer.<br>
<br>
A cull-callback is attached to the group containing the cameras. The callback simply extracts the current ViewMatrix and passes it to the stateset as a uniform. This uniform is used in one of later cameras/passed to reconstruct worldspace from the depth buffer.<br>
<br>
Now while this all works great when setting the viewer to SingleThreaded, it seems that using multithreading in the viewer causes the Uniform for the ViewMatrix to be from the previous frame in some cases. From my understanding the cull-visitor runs asynchronously to the drawing, causing the uniform to be either from the correct or from another frame.<br>
<br>
What would be the multithreaded-cull/draw alternative to get the ViewMatrix (or any other camera-related values) used for rendering in the first camera down the chain reliably?<br>
<br>
Cheers<br>
Sebastian<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
</blockquote></div><br></div></div>