Fix needTangents not being set for cached/shared materials

This commit is contained in:
scrawl 2014-01-09 23:13:31 +01:00
parent 546b0cee76
commit bfdca3b738

View file

@ -277,6 +277,8 @@ Ogre::String NIFMaterialLoader::getMaterial(const Nif::ShapeData *shapedata,
if (itr != sMaterialMap.end()) if (itr != sMaterialMap.end())
{ {
// a suitable material exists already - use it // a suitable material exists already - use it
sh::MaterialInstance* instance = sh::Factory::getInstance().getMaterialInstance(itr->second);
needTangents = !sh::retrieveValue<sh::StringValue>(instance->getProperty("normalMap"), instance).get().empty();
return itr->second; return itr->second;
} }
// not found, create a new one // not found, create a new one