Does this imply that the PreDrawCallback is only called once per render stage? If I have multiple cameras, each with a separate callback, do they all get called at once, or do they get called just each one performs it's rendering?

If they all get called at once, how would I go about having each one have a function call just before they draw? I'm trying to update a set of textures just before each camera performs a render pass, so they all use the same shader, but with different textures.



Mathias Fröhlich wrote:
Hi,

On Thursday 08 May 2008 20:00, Jason Ziglar wrote:
I've got a camera which is part of my scene graph, and for some reason
it doesn't appear to be getting called to render part of the scene.

The camera is set to be a NESTED_RENDER, and has a PreDrawCallback. The
callback never gets called, nor does it appear to have any rendering
output that I can see. I have tested to verify that the camera is a
child of the root node, and the primary camera and a PRE_RENDER camera
are both working as expected. Is there any subtleties to getting a
NESTED_RENDER camera to activate?

Well, the pre draw callcack only gets called when you get a new render stage through that camera. And this does *not* happen for nested cameras. To get a render stage you will need to set the camera type to pre render or post render. Then the callback gets called.

There are much more properties in the camera that are a noop when the camera does not lead to a new render stage in the rendering backend. The clear mask and clear color for example. I do not know which ones exactly without looking into the code, but if you have a nested camera you must be extremely careful with the values you try to use in the camera. Many of them will only have an effect if the camera os *not* a nested one. So, if you know the internals of the rendering backend well, the camera works relatively intuitive. But if you don't, it's very hard ...

Good luck

Mathias

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

Reply via email to