CompositeViewer support: Difference between revisions

Jump to navigation Jump to search
Line 265: Line 265:
trivial, but with encapsulating all this functionality it has to make
trivial, but with encapsulating all this functionality it has to make
some assumptions about the way it's used<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg36853.html</ref>
some assumptions about the way it's used<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg36853.html</ref>
A sharing OpenGL contexts doesn't mean actually sharing of the
context, its just sharing some data between contexts, so you don't
have a "common OpenGL context", you have two separate OpenGL contexts
that are sharing display lits/texture objects etc.
Each GraphicsWindow "is a" GraphicsContext which maps directly to a
single OpenGL graphics context.  Each OpenGL graphics context has its
own state machine which is mapped by a single osg::State object -
which you'll find on the GraphicsContext.
Sharing of display lists/texture objects between contexts on the OSG
just requires you to set the State::ContextID to same value.  If the
GraphicsWindow implementation is set up correctly then it'll
automatically assign the same ContextID for each of the seperate
osg::State objects.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg02505.html</ref>


* It's possible to share contexts in the OSG [...]  As for general desirability of share GL objects between contexts, yes it can reduce memory usage, but it forces you to use the OSG single threaded otherwise two contexts will be contended for the same resources that deliberately aren't mutex locked for performance reasons.  There is also on a limited set of cases where drivers/hardware will actually share OpenGL contexts. <ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg32676.html</ref>
* It's possible to share contexts in the OSG [...]  As for general desirability of share GL objects between contexts, yes it can reduce memory usage, but it forces you to use the OSG single threaded otherwise two contexts will be contended for the same resources that deliberately aren't mutex locked for performance reasons.  There is also on a limited set of cases where drivers/hardware will actually share OpenGL contexts. <ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg32676.html</ref>

Navigation menu