CompositeViewer support: Difference between revisions

Jump to navigation Jump to search
Line 84: Line 84:
* The OSG has an database paging class call osgDB::DatabasePager that is built into the osgViewer::Viewer/CompositeViewer that will automatically load databases and merge them with the main scene graph during the update traversal.  This is built around the osg::PagedLOD class, but you can also use the osg::ProxyNode.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg68474.html</ref>
* The OSG has an database paging class call osgDB::DatabasePager that is built into the osgViewer::Viewer/CompositeViewer that will automatically load databases and merge them with the main scene graph during the update traversal.  This is built around the osg::PagedLOD class, but you can also use the osg::ProxyNode.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg68474.html</ref>
* Normally one should ever need to worry about constructing or destructing the DatabasePager, it should happen behinds the scenes managed by osgViewer.  osgViewer::Scene is used internally by osgViewer to manage one DatabasePager per scene graph.  The Scene object will be shared automatically between Views if you assign the same Node pointer then you call View::setSceneData.  This sharing is done automatically for you.  When a Scene object is destructed it's DatabasePager will be destructed if no other references to it exist. If you have multiple Views that you should be using CompositeViewer, not multiple Viewer. If you are creating and destroying views regularly then you are probably best to enable/disable them by setting the View's master Camera's NodeMask to 0x0 and back to 0xffffffff, as this will switch off rendering but keep the  backend around ready to be re-enabled.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg63057.html</ref>
* Normally one should ever need to worry about constructing or destructing the DatabasePager, it should happen behinds the scenes managed by osgViewer.  osgViewer::Scene is used internally by osgViewer to manage one DatabasePager per scene graph.  The Scene object will be shared automatically between Views if you assign the same Node pointer then you call View::setSceneData.  This sharing is done automatically for you.  When a Scene object is destructed it's DatabasePager will be destructed if no other references to it exist. If you have multiple Views that you should be using CompositeViewer, not multiple Viewer. If you are creating and destroying views regularly then you are probably best to enable/disable them by setting the View's master Camera's NodeMask to 0x0 and back to 0xffffffff, as this will switch off rendering but keep the  backend around ready to be re-enabled.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg63057.html</ref>
* osgViewer automatically shares a single DatabasePager between Views when the Views share the same scene graph.  This is required to avoid inconsistencies in the scene graph causing errors.  Sharing a single DatabasePager doesn't prevent that pager from handling multiple viewpoints at the same time, if fact it knows nothing about viewpoints, it only handles database requests for tiles, so it totally agnostic to how you manage your viewpoints.  Everything should basically just work out of the box without any need for specific settings from yourself.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg34846.html</ref>


=== Threading ===
=== Threading ===

Navigation menu