Fix bug with invisibility effect for meshes w/ vertex colors

c++11
scrawl 10 years ago
parent 8d6620b074
commit c7493eb45c

@ -1006,7 +1006,7 @@ void NpcAnimation::setAlpha(float alpha)
// FIXME: overriding diffuse/ambient/emissive colors
osg::Material* material (new osg::Material);
material->setColorMode(osg::Material::DIFFUSE);
material->setColorMode(osg::Material::OFF);
material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,alpha));
material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
stateset->setAttributeAndModes(material, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);

Loading…
Cancel
Save