[osg-users] RenderBin vs. SlaveCamera
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Mon Aug 7 01:33:24 PDT 2017
Hi Werner,
I'm using slave cameras only for certain multi-channel setups where I
need multiple viewports rendering the same content with different
frusta. For multipass applications (and I simply consider HUD to be a
separate pass) I always use normal cameras (with absolute reference
frame for fullscreen passes and relative for composing passes).
You can assign an explicit number to the camera order by using.
camera->setRenderOrder(osg::Camera::PRE_RENDER, pass_number);
I use the PRE_RENDER scheme, since all passes of my offscreen rendering
need to complete before the output is presented. Given your scenario you
could of course simply set the render order of your HUD camera to
something high.
Setting up rendering order with the Geometry RenderBin seems akward,
since the HUD geometry is supposed to be rendered by the HUD-camera
only. So a slave camera might not be the best option (apart from the
fact, that the HUD is supposed to have its own projection and
transform-matrix).
hth
Sebastian
> Hi all,
>
> I'm restructuring my project because I want to implement some multi pass
> effects.
> I have some problems understanding the different approaches for example
> when
> creating HUD displays.
> The approach I used so far is attaching a SlaveCamera and puttung it in
> PostRender pass.
> On the other hand I found an approach of just attaching the matrices to
> the root node and
> assigning the HUD geometry to a RenderBin with high number.
>
> I'd like to understand the difference of the approaches and the pros and
> cons.
>
> Is there any one who can help me with that?
>
> Thanks
>
> - Werner -
>
> _______________________________________________
> 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