On 10/11/2011 2:00 PM, Joshua Cook wrote:
> Since the root node of the scene may constantly change I was just thinking of 
> making its variance DYNAMIC.  Of course that has been touted as very 
> inefficient and I agree with that.  I had looked at inheriting from 
> osg::Drawable::UpdateCallback but figure that I'd have to make the varience 
> DYNAMIC anyhow so it wouldn't matter.  So, my question is, would there be a 
> better way to make this thread safe other than setting the root node to 
> DYNAMIC to avoid crashing when adding another node to the root?

  Well, it's somewhat inefficient if you run the viewer multithreaded, but the 
way that
it's inefficient is kind of irrelevant in your situation since it seems like 
you'll have
to incur that inefficiency no matter what because your graph is potentially 
dynamic on
every frame.

  Basically, in my mind, no trick will ever avoid the fact that you have to 
wait for
rendering to completely finish before modifying the graph. There might be some 
devious
trick that could allow otherwise (maybe two copies of the graph and you stagger 
the
accesses and the visibility of them?) but premature optimization is the root of 
lots of
bad things. Just do it the proper way now, and see if the performance is really 
a problem
or not, and deal with it then if it is.

> And just in case you're wondering, I'm replacing the viewer first because it 
> crashes the most of all of the other systems.

  Wise choice.

> Thanks,
> soulsabr


-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected] 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to