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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to