Hi David, Tom,

Are you enabling transparency? - for example by:

Code:

osg::StateSet* state = node->getOrCreateStateSet();
state->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
state->setMode( GL_DEPTH_TEST, osg::StateAttribute::ON );

That last one should probably have been:

state->setMode( GL_BLEND, osg::StateAttribute::ON );

GL_DEPTH_TEST is enabled by default, but blending is not. So that will be why transparent things are showing up opaque. The transparent bin setting is just so the transparent objects are rendered in the right order (after opaque objects, and in back-to-front order), and wouldn't prevent things from looking transparent, they just wouldn't be rendered correctly in some situations.

So for transparency you need to enable GL_BLEND, and for correct transparency you need to set the rendering hint to TRANSPARENT_BIN (or setRenderbinDetails( n, "DepthSortedBin" ); where n is the bin you want, if you want to explicitly order some transparent objects to be rendered before/after others).

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to