Hi, Andrew,


Andrew Burnett-Thompson wrote:
// Set specular attribute mat->setDiffuse(osg::Material::Face::FRONT_AND_BACK, osg::Vec4(0,0,0,0)); mat->setSpecular(osg::Material::FRONT, osg::Vec4f(1.0f, 1.0f, 1.0f, 1.0f));
mat->setShininess(osg::Material::FRONT, 12.0f);
mat->setColorMode(osg::Material::ColorMode::SPECULAR);
sharedState->setAttribute(mat.get(), osg::StateAttribute::Values::ON);
sharedState->setMode(GL_COLOR_MATERIAL, osg::StateAttribute::ON);
///////////////////////

Of course, the material then mixes its color with the vertex color, despite the fact that its transparent.

Try adding this to your global StateSet:

osg::LightModel *lm =new osg::LightModel();
lm->setColorControl(osg::LightModel::SEPARATE_SPECULAR_COLOR);
stateset->setAttributeAndModes(lm, osg::StateAttribute::ON);


I'm not sure if it'll work, but it's all I can think of...


--"J"


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

Reply via email to