When writing the Quick Start Guide, I opted to err on the side of
conservatism. So, if you only modify STATIC scene graph nodes during
update(), you can be assured that is a safe operation, and will almost
certainly be a safe operation in future OSG releases.
 
In the current incarnation of OSG, however, it's safe to modify STATIC nodes
anytime you're not inside cull/draw. Furthermore, you can even modify nodes
that are DYNAMIC while you're in the draw() traversal. This is a) more
advanced stuff, and b) possibly subject to change in future OSG releases.
   -Paul
 


  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Himar Carmona
Sent: Tuesday, July 03, 2007 6:37 PM
To: osg users
Subject: [osg-users] Rendering threads and scene graph updates.


Hi,
 
  i'm working with OSG on Windows. I'm designing a Geo viewer that use OSG
internally for rendering purposes, and i have some questions about how the
modification of the scene graph must be done to be safe with the cull and
draw traversals. 
 
  After reading the Quick Start Guide and the DatabasePager code and looking
at the osg mail archive, what i've found so far is that it is possible to
modify the scene graph inside an update callback and that it is the
recommended approach (viewer seems to treat databasePager as a special case
and don't use update callback). I'm right with that or have i misunderstood
something? 
 
  Until now i have been working with a render thread that i start after the
window is created. But after reading a comment in the checkevents method of
GraphicsWindowWin32 that says it must be called from the main thread and
knowing that Win32 don't like much that different threads access the message
loop (as checkevents does), i'm thinking about the possibilty of doing the
render from the main thread ( e.g. using WM_TIMER and calling
viewer::frame() , i don't have access to the app message loop). Is this
possible? The examples i have seen so far use either a render thread
(osgviewerMFC) or a custom message loop (osgViewerGLUT). 
 
  I'm seeking for the possibility of avoiding to implement a custom Update
Callback for doing the updates of the scenegraph, and make the changes
directly to the scenegraph. It will free me for implementing the changes
queues in the update callback (a solution mentioned in a two years old osg
mail message) and will simplify my design greatly. The Quick Start Guide
mentioned that this is possible, but also mentioned that this requires
modifications to the main rendering loop. What else have to be keep in mind?

 
 
  Thanks in advance,
Himar.

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to