Fix the cloned StateSet not being assigned

This commit is contained in:
scrawl 2016-08-09 01:12:54 +02:00
parent f291aabc4b
commit 0bbd715f65

View file

@ -1138,7 +1138,10 @@ namespace MWRender
if (!node->getStateSet())
writableStateSet = node->getOrCreateStateSet();
else
{
writableStateSet = osg::clone(node->getStateSet(), osg::CopyOp::SHALLOW_COPY);
node->setStateSet(writableStateSet);
}
writableStateSet->setTextureAttributeAndModes(texUnit, textures.front(), osg::StateAttribute::ON);
writableStateSet->addUniform(new osg::Uniform("envMapColor", glowColor));