[osg-users] Running a per-frame task on the graphics thread

Jannik Heller scrawl at baseoftrash.de
Mon Oct 2 13:31:43 PDT 2017


Hi James,

You should be able to use a Drawable with DataVariance set to DYNAMIC for the 'sync phase', and a second Drawable (with no special dataVariance) for the drawing, with your logic implemented in the Drawable's drawImplementation(). RenderBins can be used to control when they are drawn. This should achieve what you want. Note the dynamic Drawable won't really 'block' the main thread (the main thread may still be doing culling, passing other Drawables onto the draw queue, etc.), but it will prevent the next frame from commencing until the dynamic Drawable is done drawing. This should all work regardless of which threading mode's in use. Placing the first drawable in the earliest RenderBin should ensure there is as little waiting as necessary.

Cheers,
Jannik

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72089#72089







More information about the osg-users mailing list