On 02/28/2012 10:49 PM, Sean O'Connell wrote:
I'm currently working on a project where I have to integrate  library into a 
3rd party application's source code.  The library consists of a custom osg 
Camera that takes 9 snapshots of the user's scene.  The headache's I've run 
into are the following:

1.  I cannot seem to turn off the 3rd party app's main camera in the osgViewer 
class.  I set nodeMask(0) on the camera but then my camera doesn't render.  
Having the main camera enabled adds unnecessary overhead.

So it sounds like your application has a single camera on an osgViewer::Viewer, and you're adding 9 slaves to it to handle your rendering. Is that correct?

I'm wondering if you couldn't just grab the app's main camera, replace it with another camera that doesn't render anything (making it the new master camera for the Viewer), and then add the app's camera back to the Viewer as a slave. Then, add your other 9 cameras as additional slaves. This way, you could disable the app's camera without affecting your 9 other cameras.

No idea if this is feasible or not (if there are manipulators or other controls for the app's camera, you'd need to move those over to the new master camera... things like that).


2.  The process of taking the 9 snapshots has additional overhead from having 
to re-process and re-run the update, event, cull and render traversals for each 
snapshot.  Since each view orbits about the same point in space, I'd like the 
ability to only run the update, event and cull traversals once and only call 
the render traversal for each snapshot.

Event and update only run once as it is. Cull has to be run either per camera or per context, because the cull traversal is what sets up the various render objects that do the actual rendering of each context. Each view is potentially different, and thus has a different set of geometry to render.

If you have access to the Viewer, you can try different threading modes (such as CullThreadPerCameraDrawThreadPerContext) to adjust how culling is done.

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

Reply via email to