CompositeViewer support: Difference between revisions

Jump to navigation Jump to search
Line 346: Line 346:
You can't use DrawThreadPerContext when sharing contexts except when your scene graph uses no OpenGL objects whatsoever.  So no display lists, no VBO's, no textures etc.  Basically if you want shared contexts you have to use it SingleThread so the different threads don't contend with the same resources.<ref>https://groups.google.com/g/osg-users/c/vtWa-YNQEAY/m/ykNHgbIOD4UJ</ref>
You can't use DrawThreadPerContext when sharing contexts except when your scene graph uses no OpenGL objects whatsoever.  So no display lists, no VBO's, no textures etc.  Basically if you want shared contexts you have to use it SingleThread so the different threads don't contend with the same resources.<ref>https://groups.google.com/g/osg-users/c/vtWa-YNQEAY/m/ykNHgbIOD4UJ</ref>


n 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.


The DataVariance property of osg::Object is used in couple of ways.
The DataVariance property of osg::Object is used in couple of ways.

Navigation menu