Hi George,
The DataVariance property of osg::Object is used in couple of ways.
For internal nodes of the scene it is used as a hint to operations
such as the osgUtil::Optimizer that parts of the scene graph are
static or dynamic and to use this information as guide to what can be
optimized and in what ways - generally it means leaving DYNAMIC nodes
alone. The DataVariance property on Nodes isn't used during the
update, cull and draw traversals so it's effectively ignored.
For the leaves of the scene graph - the osg::StateSet and
osg::Drawable (and it's subclasses), the DataVariance is only used
when using the DrawThreadPerContext and
CullThreadPerCameraDrawThreadPerContext threading models and is used
during the draw traversal to prevent the next frame from commensing
till all DYNAMIC StateSet and Drawables are dispatch. For
SingleThreaded and CullDrawThreadPerContext threading models the
DataVariance is not used as the next frame doesn't commence till the
whole draw dispatch is completed.
The DataVariance of the StateAttribute subclasses is not used in
update, cull or draw traversals, and like nodes is only used be
specialist traversals like some of the ones contained in the
Optimizer. So if you want to dynamic update a Uniform then the way to
make sure that draw doesn't overlap the update of it is to set the
DataVariance of the StateSet that enclose it to DYNAMIC. There isn't
an automatic scheme to check the DataVariance of StateAttributes as it
would be prohibitively expensive to do during the draw traversal.
Robert.