Hi

The OSG does not really support (by design) the idea of asynchronous
updating of the SceneGraph like that found Vega/Vega-Prime or good old
Performer it was decided that the penalty paid for asynchronous updating was
not wanted ( it was very handy though )

So at some point you have to serialize the App thread or Update callback
when you want to modify the SceneGraph.

Now if all you want to do is load a 3d model and merge that when loaded you
can spawn the actual loading off into a worker thread and then when the
model is fully loaded only serialize the App thread when you add the model
to the SceneGraph

If you are making live edits to the SceneGraph for something like a CLOD,
then those updates typically will have to be serialized for every time you
want to change

There are several ways to make this work but it all depends on what you are
trying to do to the SceneGraph and the frequency change

____________________________________________________________________________
__
Gordon Tomlinson 

gor...@gordontomlinson.com
www.photographybyGordon.com
www.vis-sim.com 
www.gordontomlinson.com 
IM: gordon3db...@3dscenegraph.com
____________________________________________________________________________
__

-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jimmy Lin
Sent: Tuesday, June 01, 2010 12:47 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Modifying scenegraph and update

Hi,

On relative issue.

What if viewer->frame() is running on different thread that is different to
the thread that modifies the scene graph. In that case I don't really have
the control when is frame() get called. the modification can happen during
the rendering time, which I guess is bad.

I tried use lock/unlock wrap around frame() and where ever I modify the
scene, but this introduce serious performance issue.

The only solution I can think of is use UpdateCallback. but wouldn't the
same problem happens when modify the update callback at the same time as
frame() doing the updatetraversal? or does OSG have a way to protect the
data during the updatetraversal ??

Or is there other approach you can advice me.


Thank you!

Cheers,
Jimmy

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28388#28388





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to