On 02/28/2012 06:20 PM, Sean O'Connell wrote:
In my application I have a bunch of cameras that render to textures.  Is there a 
way for me to trigger them to render without calling osgViewer::frame or going 
through the osgViewer class?  Ideally I could simply call camera->renderView() 
or something similar.  Is this possible?

Hi, Sean,

Short answer:

In theory, it's possible, but I wouldn't recommend it.

What are you trying to accomplish, in more broad terms? There's probably a better way to do what you're trying to do (have you looked at osgPPU yet?)


Long answer:

The main problem with this is that the cull and draw traversals are normally spawned off into separate threads, with the exact configuration depending on the threading model in use.

If you look at the implementation of the frame() method (in the base class implementation ViewerBase.cpp), you'll see that it's a pretty simple method that calls:

  advance(simulationTime);
  eventTraversal();
  updateTraversal();
  renderingTraversals();

If you then look at the renderingTraversals() method, you'll see it's a lot more complicated, since it has lots to do, and it needs to be able to deal with each of the different threading models that could be in use.

You might be able to write your own version of renderingTraversals() to handle your specific use case and only render the cameras that you want, but you're likely to run into all kinds of problems.

As I said earlier, there's probably a better way to do what you're trying to do. If you explain your task at a higher level, someone might be able to come up with a solution for you.

--"J"

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

Reply via email to