1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 13:09:42 +00:00

NifLoader: assign a name to created textures

This name will tell the shader visitor how to handle that texture.
This commit is contained in:
scrawl 2016-02-14 23:24:54 +01:00
parent 50e92c8136
commit 4cd4131da9

View file

@ -1316,6 +1316,27 @@ namespace NifOsg
stateset->setTextureAttributeAndModes(texUnit, texEnv, osg::StateAttribute::ON);
}
switch (i)
{
case Nif::NiTexturingProperty::BaseTexture:
texture2d->setName("diffuseMap");
break;
case Nif::NiTexturingProperty::BumpTexture:
texture2d->setName("normalMap");
break;
case Nif::NiTexturingProperty::GlowTexture:
texture2d->setName("emissiveMap");
break;
case Nif::NiTexturingProperty::DarkTexture:
texture2d->setName("darkMap");
break;
case Nif::NiTexturingProperty::DetailTexture:
texture2d->setName("detailMap");
break;
default:
break;
}
boundTextures.push_back(tex.uvSet);
}
}