[osg-users] Multiple render passes and multithreading

Glenn Waldron gwaldron at gmail.com
Wed May 3 08:53:51 PDT 2017


Sebastian,

Have you tried setting the data variance to DYNAMIC on the StateSet
containing the Uniform?

That's the first thing I would try -- not sure whether it works on Uniforms
though.

Glenn Waldron

On Wed, May 3, 2017 at 11:49 AM, Sebastian Messerschmidt <
sebastian.messerschmidt at gmx.de> wrote:

> Hi,
>
> I've just stumbled upon something I find hard to understand.
> 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.
> In the simplest case a second camera will pick up the textures rendered to
> and use them to draw to the framebuffer.
>
> 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.
>
> 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.
>
> 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?
>
> Cheers
> Sebastian
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170503/8ca61a8f/attachment-0002.htm>


More information about the osg-users mailing list