Bilal Zeidan wrote on Friday, October 02, 2009 3:10 PM:
> I am asking if some can help me to set a non shaded color to a node.
In
> another words, I don't want the color of the node to be affected by
the
> light source of the scene. In my case, I don't have a direct access to
> the node's drawables that's why I am using the node's material to set
> the color of the node. I tried to set the ColorMode of the material to
be
> GL_DIFFUSE/GL_EMISSION but none of them has worked well. I also tried
to
> activate and deactivate the light attribute 
> of this node but I didn't get the desired result.
> 
> My question is how can I set a single non shaded color to a loaded
> graphic model if I don't have access to its geometry?
> 
> Thank you in advance.

Have you tried using OVERRIDE when you set the ColorMode or GL_LIGHTING?

i.e.

stateset->setAttributeAndMode(colorMode, osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE);

or

stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF |
osg::StateAttribute::OVERRIDE);

Without OVERRIDE, the model's settings for these attributes will be used
instead of yours.

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

Reply via email to