Hi Tanguy,

The OSG sorts the objects in opaque bin to minimize state changes, this is
crucial for performance - it's a pretty fundamental part to efficient
rendering and standard practice in high performance graphics toolkts..  This
does mean the ordering changes.  You have complete control over the bins
though, you can change the sort algorithm on them, you can create own bins,
set the overall render order.

Within a single geometry the order is drawn in the order that the primitives
are placed in the geometry, so perhaps this is sufficient for your purposes.

Robert.

On Thu, Apr 2, 2009 at 11:02 AM, Tanguy Fautre <[email protected]
> wrote:

> Hi,
>
> When doing GUI elements in OpenGL, it's particularly useful to exactly
> control the rendering order. Usually, this goes like this:
>
>        glDepthMask(0);
>        glDisable(GL_DEPTH_TEST);
>        glDisable(GL_LIGHTING);
>        glEnable(GL_BLEND);
>
>        /* Render GUI back to front */
>        /* Note that we use Z = 0.0 all the time */
>
>        glBegin(GL_QUADS);
>                glVertex2f(x, y);
>
>        /* ... */
>
> It's very easy to do directly in OpenGL, but with OSG I've currently
> found it ridiculously hard. The reason is that OSG change to rendering
> order to optimize things (which is good in most cases, except this one).
> Is there any way to easily control the rendering order of nodes in OSG
> (e.g. set a node property to tell OSG to render children nodes in
> order)?
>
> I've found render bins to be over complicated to solve this (also they
> require the user to assign a unique and ordered id to each of them), and
> assigning a Z value to each GUI element is also tedious and error prone.
>
> Am I missing something?
>
>
> Cheers,
>
> Tanguy
>
> _______________________________________________
> 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