[osg-users] Disable Backface Culling of a node

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Fri Nov 13 17:10:14 PST 2009

Hi Dominic,

>> node->getOrCreateStateSet()->setMode( GL_CULL_FACE, 
>> osg::StateAttribute::OFF );
> thanks but this didn't work. We applied the mode on a loaded osg file. 
> Is this a problem?

If the osg file contains a stateset which sets GL_CULL_FACE to ON below 
the root node where you set it to OFF, it will be overridden and will be 
ON for the drawables (state is inherited down into the leaf nodes).

If you want to force GL_CULL_FACE to OFF for all nodes below the root of 
your .osg file, use osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE.

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list