Robert,

Thank you for your reply.

On Wed, Sep 11, 2013 at 8:27 AM, Robert Osfield
<[email protected]> wrote:
> Normally one should ever need to worry about constructing or destructing the
> DatabasePager

Thank you.  My preference is to never think about the DatabasePager.
Since I use multiple views, at a minimum I must be concerned with a
function called DatabasePager::setUnrefImageDataAfterApplyPolicy.

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

Is this a correct understanding:

If I am running a scene with 2 viewers, and I remove both of those
viewers but not the scene, then the DatabasePager is destroyed.  Then,
if I later add attach the scene to a new viewer, the DatabasePager is
re-created.  All this happens behind the scenes and I need not be
worried about it.

> If you have multiple Views that you should be using CompositeViewer, not
> multiple Viewer.

Thank you.  You're the second person to mention this to me today so it
must be true!  However, please consider:

1. Inexplicably when I render my scene with a CompositeViewer, adding
and removing views during runtime, my renderings turn "purple".  By
"purple" i mean that none of my objects are rendered!  (osgEarth
terrain and imagery).  What's more (and you might not believe me on
this point): when I use multiple viewers on the same graph (without
using CompositeViewer) then I do not suffer this problem!

2. I can understand if nobody wants to provide an answer to this
question, but I'd like to know: What are the repercussions of running
multiple viewers on one scene when the "correct" approach is to run a
single CompositeViewer w/multiple views on one scene?

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

I understand.  While not impossible, a design such as this will
require a re-architecting of my code as at present I have no idea how
many viewers, if any, will want to look at my scene.

Thank you for your help, I appreciate learning about these technical
under-the-hood aspects (vs just "here's what you need to type to get
it to work"),

Chris
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to