Hi Tanguy,

The rendering backend is set up to allow nesting of RenderBin, so you can
implement layer within layers.  The rendering backend also support multiple
RenderStage for RTT and HUD purposes.  A RenderStage is just a subclass from
RenderBin that adds a clear at the begining of the stage, and does any data
copying at the end.  The rendering back therefore provides a great deal of
flexibility for controlling fine grained ordering as well as high level
order, but with this flexibility does come a bit of complexity is
controlling it.

It's worth mentioning that the OPAQUE_BIN and TRANSPARENT_BIN's aren't fixed
bins, they are just default settings to make it convinient, the actually
rendering back end doesn't actually have a specific opaque and transparent
bin, the only fixed element is that there is root RenderStage for each
viewer Camera, the rest of the bin layout is entirely generated on the fly,
so one frame you might have a hundred bins, the next only two.

Robert.



2009/4/2 Tanguy Fautre <[email protected]>

>  Hi Robert,
>
>
>
> I do have a Layer class (although it’s more than just a node), and I also
> have an Overlay class.
>
>
>
> An overlay sets up the orthogonal project and the common state set. It also
> contains several layers. The overlay guarantees that the layer are rendered
> in order (i.e. you add them to the overlay from back to front), and I was
> actually going to do that by the approach you’re suggesting (that is,
> automatically create a different numbered rendering bin for each child).
>
>
>
> I would also like to achieve the same with layers. So that in the end,
> layers are rendered in order, and the elements in each layer are also drawn
> in order.
>
> I’m not so familiar with render bins, but is it possible to have such a
> hierarchical arrangement? This would be similar to having a hierarchy of
> osg::Layer nodes as you’ve described them.
>
>
>
>
>
> Cheers,
>
>
>
> Tanguy
>
>
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Robert Osfield
> *Sent:* Thursday 02 April 2009 12:46
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Controlling the rendering order
>
>
>
> HI Tanguy,
>
> 2009/4/2 Tanguy Fautre <[email protected]>
>
> Do you suggest I create an additional bin type (e.g. GUI_ELEMENT_BIN) in
> addition to OPAQUE_BIN and TRANSPARENT_BIN, and write my own sort algorithm
> for those (i.e. render in the same order children appears in) ?
>
>
> Implicit rendering order is bound to be open to error, if the traversal
> order changes then you'll hit upon problems, so I would not recommend going
> this route.
>
> You can certainly implement your own RenderBin, just assign a
> RenderBinPrototype with the appropriate sort order and provide a name for it
> so that the StateSet's of your geometry can select it.  However, while it's
> technically quite straight forward to do I would recommend doing it in the
> manner your are looking for, explcit control of rendering order is the best
> way to go.
>
> One route to making explictly render order easiler to manage would be via a
> "Layer" node.  This "Layer" node would drop it's children in to different
> bins.  I've been considering writing a osg::Layer node for quite a few
> years, but never have had the time nor something that critically needed it.
> Your welcome to collabroate on developing a new osg::Layer node :-)
>
>
> Robert.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to