Unlike OpenGL, OSG's Material class wraps both the glMaterial and
glColorMaterial features. Color Material redirects OpenGL to pick up
material lighting parameters from the primary color. So, you just need to
configure the OSG Material class to use Color Material, then lighting will
use the vertex colors.
   -Paul


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Judie
> Sent: Wednesday, July 09, 2008 11:36 AM
> To: [email protected]
> Subject: [osg-users] How do I disable material on a node?
> 
> I am expecting this to work:
> 
> osg::StateSet *stateSet = node->getOrCreateStateSet();
> 
> 
> osg::Material *material = dynamic_cast<osg::Material *>(stateSet-
> >getAttribute(osg::StateAttribute::MATERIAL));
> 
> 
> 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.
> 
> Thanks,
> 
> Judie
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

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

Reply via email to