20,741
edits
m (→Motivation: fix past sense) |
m (→Data Variance) |
||
Line 298: | Line 298: | ||
=== Data Variance === | === Data Variance === | ||
{{Note|If you are seeing a crash when running single threaded then | |||
DataVariance won't be an issue, you'll need to look elsewhere. | |||
Unfortunately there is too information about the exact problem you are | |||
seeing on your system to be able to guess at what the problem might | |||
be. | |||
A general note about DataVariance, in the OSG there are internal Nodes | |||
of the scene graph - such as Group, Transform, Geode etc, setting | |||
DataVariance on these is only a hint to code that might optimize the | |||
scene graph about what is safe to replace and change and what isn't, | |||
unless you are calling the osgUtil::Optimizer is pretty likely that | |||
setting DataVariance on Node in the scene graph will have no effect on | |||
the end result - as the update, cull and draw traversals all ignore | |||
the Node's DataVariance settings. | |||
The only time that DataVariance is used is when the viewer is run | |||
multi-threaded with the DrawThreadPerContext or | |||
CullThreadPerCameraDrawThreadPerContext threading models, and where | |||
it's only the draw traversal that uses the DataVariance, and the since | |||
the draw traversal has only references to Drawable and StateSet leaves | |||
on the scene graph it's only the DataVariance on these that is | |||
checked. This means the nodes and any sate attributes attached to | |||
StateSet are ignored.<ref>https://groups.google.com/g/osg-users/c/W4OFWPp9YJ8/m/poyUdg7_oBsJ</ref>}} | |||
The OSG is built for multi-threading of osgViewer View's in various ways, it's not general multi-threading support, it's designed specifically for a scene graph so overheads for that multi-threading to a minimum. | The OSG is built for multi-threading of osgViewer View's in various ways, it's not general multi-threading support, it's designed specifically for a scene graph so overheads for that multi-threading to a minimum. | ||
Line 358: | Line 381: | ||
Everything else (scene graph structure, etc.) is safe to change during the Update traversal/callbacks.<ref>https://groups.google.com/g/osg-users/c/j2_2vCDFdTw/m/oasQIb7HCgAJ</ref> | Everything else (scene graph structure, etc.) is safe to change during the Update traversal/callbacks.<ref>https://groups.google.com/g/osg-users/c/j2_2vCDFdTw/m/oasQIb7HCgAJ</ref> | ||
=== Threading === | === Threading === | ||
In single threaded mode, you can safely have a single threaded viewer and still have the DatabasePager working with multi-threading in the background.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg61170.html</ref> | In single threaded mode, you can safely have a single threaded viewer and still have the DatabasePager working with multi-threading in the background.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg61170.html</ref> |