[osg-users] Explicitly synchronize all viewer cameras?

Robert Osfield robert.osfield at gmail.com
Mon Jul 4 07:44:32 PDT 2016

Hi Philipp,

The ThreadPerCamera is just shorthand for
CullThreadPerCameraDrawThreadPerContext, which will explain a bit more
what's actually happening - it's meant to allow the draw thread to
progress in parallel with the next frame.

There is a mechanism built into the backend to hold back the next
frame if there are any Drawables or StateSet's with their DataVariance
marked as DYNAMIC, however, if your whole scene is STATIC then this
will allow the next frame to advance.  There isn't any default
additional mechanism for holding back the next frame.  There are
mechanisms for doing a swap ready check for multi-context systems
which does something similar to what you are after.

A another different take would be to insert an GraphicsOperation prior
to the sawp buffers that has a barrier that you can control, a bit
like the swap buffers one.

I have to ask though, what exactly are you trying to achieve here,
what's the end feature that you are after, it may well be that you are
trying to solve the problem in the completely the wrong way.


On 4 July 2016 at 15:25, Philipp Meyer <philipp.meyer at fh-bielefeld.de> wrote:
> Hi,
> I'm using multiple cameras and want them to render the scene in parallel to increase GPU load. For that, I set the threading model of my Viewer to "ThreadPerCamera".
> That all works fine, however, I'm facing the issue that the viewer seems to begin the next frame before the current frame is completed. (Or with other words: viewer.renderingTraversals() does not seem to block long enough for my needs).
> I can not have that happen because of some additional logic I'm performing in my program main loop. Is there any way I can wait until all cameras have completed their frame? Ive messed with the viewers end barrier and frame policies with no success. Some older tutorials also mention a "sync()" method, however it does not seem to exist any longer. I also cant find any other methods within the viewer related to synchronization.
> Thank you!
> Cheers,
> Philipp
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67983#67983
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list