Hi Robert, On Thu, Jun 22, 2006 at 11:40:17AM +0100, Robert Osfield wrote: > I think the "correct" solution is to refactor osg::Material so that > the colour material is implementated seperately in its own > osg::ColorMaterial class. The osg::ColorMaterial should only hold the information for which material component (ambient, diffuse, specular, emission) the color should be used.
The color comes from the color array of the geometry. > The _colorMode is really a bit of hack to keep all the meterail > related operations in one place. Its been this way since the very > early days of the OSG, and not something I've looked at much since as > it general works just fine. The problem we have is that we want to use a osg::Material for the specular, ambient and emission components of the material and a color array in the geometry for the diffuse component of the material. OpenGL allows this. In this case we have a osg:Material with _colorMode=OFF. But we can't enable the GL_COLOR_MATERIAL in the StateSet separate because the osg::ModeStack for GL_COLOR_MATERIAL was invalidated by the calls to glEnable/glDisable by osg::Material::apply(State&). > However, there is this issue of backwards compatibility to be warry of. In which case would my modifications cause a incompatibility ? Daniel _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
