[osg-users] Multiple cameras with setRenderOrder(PRE_RENDER, i)

Ross Bohner rgbohner at iastate.edu
Fri Nov 20 20:12:52 PST 2009


I am having difficulty setting the order of multiple pre render cameras for RTT.  Specifically I wish to set
1. a camera for rendering a depth buffer to a texture which is sent as a uniform to
2. another camera which preforms some more calculations to a texture which is used on the general scene root.

I set the first camera as a subnode to the second camera and sent both renderOrders to PRE_RENDER.  However this structure does not correctly send output texture of the first camera to the second camera's shader.  I have verified the shaders and first camera's output.

How does the render sequence get handled?  I have read in other posts that the render order was based on the camera hierarchy.  Did I misinterpret this and not have added the first camera as a child to the second camera?

Also how does the RenderOrderNum of a camera effect the order to processing?  If the cameras are siblings my first interpretation was that the order is PRE_RENDER 0, PRE_RENDER 1, ..., PRE_RENDER n, NESTED_RENDER 0, NESTED_RENDER 1, ... NESTED_RENDER n, POST_RENDER 0, POST_RENDER 1, ... POST_RENDER n. However I did try setting the render order for the sequence above but the first camera's output texture was not available for processing by the second camera.  

Any help would be greatly appreciated

Thank you!


Read this topic online here:

More information about the osg-users mailing list