[osg-users] How do I disable material on a node?

Judie judie.m.stanley at gmail.com
Wed Jul 9 10:36:07 PDT 2008

I am expecting this to work:

osg::StateSet *stateSet = node->getOrCreateStateSet();

osg::Material *material = dynamic_cast<osg::Material *>(stateSet-

stateSet->setAttributeAndModes(material, osg::StateAttribute::OFF);

I still see the material.

The vertices have color values and material is something that I want
to be able to turn on and off. When I disable lighting, then I see the
vertex colors but I don't get any contours of the object. I want to
see the vertex colors and the contours of the object but not the
material properties which have different colors as well as
shine ...etc.

I have also tried:
stateSet->setMode(GL_COLOR_MATERIAL, osg::StateAttribute::OFF);

any advice would be appreciated.



More information about the osg-users mailing list