mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 15:27:13 -04:00
Handle normalHeightMap as special case
This commit is contained in:
parent
4707c7e2fc
commit
e2e7b58b3a
@ -287,11 +287,17 @@ namespace Shader
|
|||||||
addedState->setName("addedState");
|
addedState->setName("addedState");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* defaultTextures[] = { "diffuseMap", "normalMap", "normalHeightMap", "emissiveMap", "darkMap",
|
// This list is used both for detecting known texture types (including added normal maps etc.) and setting the
|
||||||
"detailMap", "envMap", "specularMap", "decalMap", "bumpMap", "glossMap" };
|
// shader defines. Normal maps and normal height maps both get sent to the shader as a normal map, so the latter
|
||||||
|
// must be detected separately.
|
||||||
|
const char* defaultTextures[] = { "diffuseMap", "normalMap", "emissiveMap", "darkMap", "detailMap", "envMap",
|
||||||
|
"specularMap", "decalMap", "bumpMap", "glossMap" };
|
||||||
bool isTextureNameRecognized(std::string_view name)
|
bool isTextureNameRecognized(std::string_view name)
|
||||||
{
|
{
|
||||||
return std::find(std::begin(defaultTextures), std::end(defaultTextures), name) != std::end(defaultTextures);
|
if (std::find(std::begin(defaultTextures), std::end(defaultTextures), name) != std::end(defaultTextures))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return name == "normalHeightMap";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderVisitor::applyStateSet(osg::ref_ptr<osg::StateSet> stateset, osg::Node& node)
|
void ShaderVisitor::applyStateSet(osg::ref_ptr<osg::StateSet> stateset, osg::Node& node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user