Hi Paul,

On 4/3/07, Paul Martz <[EMAIL PROTECTED]> wrote:


Hi Robert -- I want to make sure I understand the new threading model that
allows the draw traversal to return even though it hasn't completely
processed the render graph yet.

If I understand correctly, the draw traversal will return after all DYNAMIC
data has been processed. This means the draw thread could still be
processing STATIC data in the render graph while the update traversal begins
operating on the scene graph for the next frame.

This is correct.

To maximize performance, an app should set data variance to DYNAMIC on as
few Objects as possible.

This is also correct.


Does OSG allow an application to change the data variance? If so, how should
an app do this? For example, suppose all Objects are initially STATIC. Then
the app allows a user to pick a node of interest for modification. The app
now needs to set data variance to DYNAMIC for the Object that'll be
modified. It seems like, if the app does this during the update traversal,
and also modifies the Node at the same time (like for pick highlighting),
it's possible that the last frame's draw traversal could collide on that
node, as it was previously STATIC. See what I mean?  Is this an issue and
how does OSG avoid it?

The DataVaraince of Drawables and StateSet's are determined on a per
frame basis during the cull traversal then during the draw traversal
number of dynamic objects left to draw is tracked, on each dynamic
object is draw then count is decremented until all have been
dispatched.  Now if you update operation is running in parallel to the
draw and you the DataVariance then those objects will be miscounted,
either decrementing or not at the incorrect time.  This could then
lead to the dynamic draw block being released too early which could
cause problems.

There isn't any automatic way to avoid so the application developer
would need to manually block till the draw thread fully complete then
let the frame advance.  One would only need to do this for the frames
that you are changing data variance or objects that are on screen.
Still this could cause a frame drop so is something to be aware of.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to