Hi,

I am trying to render a semitransparent cylindrical container with the
following strategy:

Create a drawable for the cylinder's back faces first by relying on
GL_CULL_FACE using a specific winding order
of the quads to only render the rear wall. Add this drawable to the Geode first.

Create a drawable for the cylinder's front faces first by relying on
GL_CULL_FACE using the opposite winding order
of the quads to only render the front wall. Add this drawable to the Geode next.

I take the same approach with the top and bottom faces of the
cylinder, carefully choosing an order in which the transparency looks
correct for all viewing angles. And to make things even more
complicated, I also display a transparent liquid that is contained
inside the container.

This worked reasonably well because it seemed that the drawables
inside my geode were processed in the order that I added them to the
geode.

Now I added shaders to the individual drawables and some state sets
are different among my various drawables. Unfortunately now the
predictable drawing order has broken down and my transparency often
looks incorrect.

I have tried using render bins with the depth sorting flag enabled -
this looks correct for each individual container but it looks horrible
when one container is seen behind another.

I wish there was such a thing as localized renderbins for drawables
contained inside a geode. I need to achieve a guaranteed render order
for drawables owned by a single geode.

Are there any insights for rendering transparent stuff from the OSG
community? Are there proven approaches to rendering transparency
correctly for objects?

I could override the drawImplementation, I guess...

Christian
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to