I have troubles to remove every color and every lighting from a loaded model, basically I want to to draw a model completly white without any shading my code snippet is:

// state is a pointer to the group where the model will be added
state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | StateAttribute::PROTECTED );
state->removeAttribute(StateAttribute::POLYGONMODE);
state->removeAttribute(StateAttribute::MATERIAL);
osg::Material* mat =  new osg::Material();
mat->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,0.0,0.0,1.0));
state->setAttributeAndModes(mat, osg::StateAttribute::ON | StateAttribute::PROTECTED);

Basically I set the material as protected which should work but it doesnt for the models like axis.osg, or cessna.osg. Other model files from a model database are rendered white but these ones keep their color and their lighting.
Is there a way to fix that without visiting each node of the loaded models?

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

Reply via email to