Hi Jason, On Fri, Dec 2, 2011 at 11:30 AM, Jason Daly <[email protected]> wrote: > > I don't understand what you mean here. If you disable lighting, material > colors are irrelevant. The ShapeDrawable's colors are the ONLY way to set > the color. >
That's actually not the case with OSG. If you look at the source for osg::Material, you will notice it calls glColor with one of the material colors (depending on the color mode). This means you can use osg::Material to control the color of geometry even when lighting is disabled. If ShapeDrawable did not call glColor, it would be possible to use osg::Material to control the color with lighting disabled. At the very least, I think there should be an option to have ShapeDrawable inherit the color. I don't see anything wrong with having such an option and I'm sure Robert would accept a patch for it. Cheers, Farshid I'm not sure what's inconsistent about it. It behaves like any other > OpenGL geometry. > > As Filip indicated, the color only applies if lighting is disabled. When > you disable lighting, no lighting calculations are done, and material > colors become irrelevant, just as they do with any OpenGL rendering when > lighting is disabled. Only the geometry color is used. If you want an > unlit red cube, this is how you'd do it. > > > When lighting is enabled, the material can be set to either ignore the > geometry colors: > > material->setColorMode(osg::Material::OFF); > > or to use the geometry colors as one of the material colors: > > material->setColorMode(osg::Material::DIFFUSE); (for example) > > It's your choice how you want to apply the material. > > --"J" > > > _______________________________________________ > 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

