mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-18 02:46:40 +00:00
Don't forget parallax when reapplying shader visitor
Fixes https://gitlab.com/OpenMW/openmw/-/issues/8341 I don't think this should go into 0.49 because there may be implications beyond what I've thought of and I'd rather we had a full dev cycle to notice any regressions. The fix is a little janky, but makes use of some dead code we've had since the introduction of normal-height maps nearly a decade ago, so it's a safe bet that it was never intended to be dead code. The main effect of the jankiness is that we'll add some pointless @defines for normalHeightMap that none of our shaders use and which will always be zero.
This commit is contained in:
parent
c1c8769742
commit
115fc08904
1 changed files with 2 additions and 2 deletions
|
@ -287,7 +287,7 @@ namespace Shader
|
||||||
addedState->setName("addedState");
|
addedState->setName("addedState");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* defaultTextures[] = { "diffuseMap", "normalMap", "emissiveMap", "darkMap", "detailMap", "envMap",
|
const char* defaultTextures[] = { "diffuseMap", "normalMap", "normalHeightMap", "emissiveMap", "darkMap", "detailMap", "envMap",
|
||||||
"specularMap", "decalMap", "bumpMap", "glossMap" };
|
"specularMap", "decalMap", "bumpMap", "glossMap" };
|
||||||
bool isTextureNameRecognized(std::string_view name)
|
bool isTextureNameRecognized(std::string_view name)
|
||||||
{
|
{
|
||||||
|
@ -440,7 +440,7 @@ namespace Shader
|
||||||
writableStateSet = getWritableStateSet(node);
|
writableStateSet = getWritableStateSet(node);
|
||||||
writableStateSet->setTextureAttributeAndModes(unit, normalMapTex, osg::StateAttribute::ON);
|
writableStateSet->setTextureAttributeAndModes(unit, normalMapTex, osg::StateAttribute::ON);
|
||||||
writableStateSet->setTextureAttributeAndModes(
|
writableStateSet->setTextureAttributeAndModes(
|
||||||
unit, new SceneUtil::TextureType("normalMap"), osg::StateAttribute::ON);
|
unit, new SceneUtil::TextureType(normalHeight ? "normalHeightMap" : "normalMap"), osg::StateAttribute::ON);
|
||||||
mRequirements.back().mTextures[unit] = "normalMap";
|
mRequirements.back().mTextures[unit] = "normalMap";
|
||||||
mRequirements.back().mTexStageRequiringTangents = unit;
|
mRequirements.back().mTexStageRequiringTangents = unit;
|
||||||
mRequirements.back().mShaderRequired = true;
|
mRequirements.back().mShaderRequired = true;
|
||||||
|
|
Loading…
Reference in a new issue