Hi Bram,

The rendering order is controlled by the type of RenderBin that the
drawable leaves are dropped into during the cull traversal.  If the
drawables are in the default opaque bin then they'll be sorted by state
order, the traversal order will have no effect on the draw order.  If the
drawables in the transparent bin then they will be ordered back to front
based on their centroids distances from the eye point, so again the
traversal order will have no effect on draw order.

The only time that traversal order has any effect on rendering order is you
assign the drawables to TRAVERSAL_ORDER rendering bin.  The traversal order
then directly maps to the rendering order.  The traversal order by default
in the OSG is depth first and then first to last child.  To use
TRAVERSAL_ORDER you'll need to use OSG-3.2.x or later.  The osgdepthpeeling
example uses the "TraversalOrderBin" so have a look at it for an example of
how to set it up.

Robert.


On 18 July 2014 08:04, Bram Vaessen <bram.vaes...@gmail.com> wrote:

> Hi,
>
> I was wondering what kind of assumptions I can make about the rendering
> order.
>
> for example in kinda pseude code:
>
> rootnode->addChild(node1);
> rootnode->addChild(node2);
>
> node1->addChild(node3);
> node1->addChild(node4);
> node3->addChild(node5);
>
> would give:
>
> rootnode -> node1 -> node3
>                             -> node4
>               -> node2 -> node5
>
> can I assume either a depth-first traversal, breadth-first traversal or
> something else, or can I not assume anything (i.e. it might change at any
> time in a new OSG version because it is not 'defined') ?
> So basically: can I assume node2 is always rendered BEFORE node3 and node4?
>
> And nodes on the same level, like node3 and node4, can I assume that node3
> is rendered first because it was added first?
>
>
> Thank you!
>
> Cheers,
> Bram
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=60320#60320
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to