diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 56c3846af..37a39cdc4 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -515,13 +515,11 @@ namespace MWRender protected: virtual void setDefaults(osg::StateSet* stateset) { - osg::Material* material = static_cast(stateset->getAttribute(osg::StateAttribute::MATERIAL)); - osg::BlendFunc* blendfunc (new osg::BlendFunc); stateset->setAttributeAndModes(blendfunc, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE); // FIXME: overriding diffuse/ambient/emissive colors - material = new osg::Material; + osg::Material* material = new osg::Material; material->setColorMode(osg::Material::OFF); material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,mAlpha)); material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));