Fix bug with invisibility effect for meshes w/ vertex colors

This commit is contained in:
scrawl 2015-06-11 16:14:51 +02:00
parent 8d6620b074
commit c7493eb45c

View file

@ -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);