This has been discussed before, but I'm not sure what you'd search for to find it in the archives.

In the most general and conservative sense, you should set dynamic data variance on anything you need to change.

But in reality, you only need to do this for objects that are referenced by the draw list / render graph. Unfortunately, there is no (header file doxygen) documentation that tells you what goes in the render graph and what doesn't. So you can either take the conservative approach, or you can dig into the source to determine whether you can get away with not marking something dynamic, even though you know you're going to modify it.

For me, this boils down to a 5 second code change (to mark it dynamic) versus possibly hours of digging into the code. So I usually take the conservative approach.

Specifically regarding MatrixTransform, marking it as dynamic (as I did in the Quick Start Guide) isn't necessary, as OSG's render graph is composed of copies / concatenations of the matrix itself, and doesn't hold references to the MatrixTransform node per se.

Note also that data variance is used by the osgUtil::Optimizer. Other code in OSG might also reference data variance for various purposes.
   -Paul


On 2/14/2012 7:04 AM, Eric Pouliquen wrote:
Hi,

sorry to ask questions about such a classic topic but I've read lot of things 
about Datavariance and would like to be sure about some points :

I've  read in osg guides that the datavariance of a Drawable (and all 
subclasses) and a StateSet must be set the DYNAMIC if we plan to modify its 
data during object's life. This is clear.
But I also read in the QuickStart Guide in the Cow example (page 96) that the 
coder set the datavariance of a MatrixTranform to DYNAMIC because he will 
modify the matrix values in a callback...

So : do we need to set the datavariance to DYNAMIC for any osg Node that we 
want to act on in a callback ? That point is not clear for me.

If yes, for example do we need to set a DYNAMIC datavariance for a switch node 
as soon as we are going to modify its children enable states in a callback ???


Thanks a lot for your clarifications


Thank you!

Cheers,
Eric

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





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to