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

Robert Osfield robert.osfield at gmail.com
Sat Nov 21 08:24:05 PST 2009


Hi Ross,

Nested RTT Camera's that use PRE_RENDER will always be rendered prior
to the enclosing Camera's.

W.r,t RenderOrder, camera's are always rendered from -ive to +ive
values from within the same level of nesting.

In you case it sounds like you should avoid putting the pre render
camera above the one which you are trying to render, instead keep them
as siblings and use the RenderOrder to draw the pre render camera
first, nest the pre render camera inside the main camera.

Robert.



On Sat, Nov 21, 2009 at 4:12 AM, Ross Bohner <rgbohner at iastate.edu> wrote:
> Hi,
>
> 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!
>
> Cheers,
> Ross
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=20043#20043
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list