No in straight OSG/OGL No Lighting = No Material
You probably could do this with in a shader but you would have to replicate the full fixed pipeline calculation of lighting,materials, textures , fogs etc ( which you have to do anyway ) Gordon __________________________________________________________ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __________________________________________________________ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 "Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival" - Master Tambo Tetsura -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jean-Sébastien Guay Sent: Wednesday, February 04, 2009 2:14 PM To: OpenSceneGraph Users Subject: [osg-users] About OpenGL materials Hi all, I have a question about OpenGL materials. From what I can see, if I disable GL_LIGHTING in the stateset of an object, then that object is rendered with the colors specified in its color array only, i.e. the material has no effect. Is there a way to change that? The effect I want is that the object be unaffected by lighting but still has colors according to its material, i.e. even if no light is present in the scene, or if there is only a spotlight but it is not pointing toward the object, its color is defined by its material. The reason I can't just specify the colors in the color array is that then, if I use scribe or outline effects (using osgFX::Effect), the wireframe overlay or outline takes on the vertex colors too instead of being white (or the color I specify). If there's a way to force the scribe to be white (i.e. not use the object's vertex colors) that would work too even though it's the reverse of what I'm asking... Any suggestions would be appreciated. I've never quite understood the intricacies of how OpenGL handles vertex colors, materials, shading and even textures (when one takes precedence over the other, etc.) so I'd like the advice of someone who knows more than me in this respect. Thanks, J-S -- ______________________________________________________ Jean-Sebastien Guay [email protected] http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

