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: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] 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 <tang...@aristechnologies.com>

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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to