mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 18:39:39 +00:00
Move setting of colorMode to ShaderRequirements in case they're reused
This commit is contained in:
parent
85b97d19d3
commit
a41ce42208
2 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,7 @@ namespace Shader
|
|||
|
||||
ShaderVisitor::ShaderRequirements::ShaderRequirements()
|
||||
: mShaderRequired(false)
|
||||
, mColorMode(2)
|
||||
, mMaterialOverridden(false)
|
||||
, mNormalHeight(false)
|
||||
, mTexStageRequiringTangents(-1)
|
||||
|
@ -257,7 +258,7 @@ namespace Shader
|
|||
break;
|
||||
}
|
||||
|
||||
writableStateSet->addUniform(new osg::Uniform("colorMode", colorMode));
|
||||
mRequirements.back().mColorMode = colorMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,6 +304,8 @@ namespace Shader
|
|||
|
||||
defineMap["parallax"] = reqs.mNormalHeight ? "1" : "0";
|
||||
|
||||
writableStateSet->addUniform(new osg::Uniform("colorMode", reqs.mColorMode));
|
||||
|
||||
osg::ref_ptr<osg::Shader> vertexShader (mShaderManager.getShader(mDefaultVsTemplate, defineMap, osg::Shader::VERTEX));
|
||||
osg::ref_ptr<osg::Shader> fragmentShader (mShaderManager.getShader(mDefaultFsTemplate, defineMap, osg::Shader::FRAGMENT));
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ namespace Shader
|
|||
|
||||
bool mShaderRequired;
|
||||
|
||||
int mColorMode;
|
||||
|
||||
bool mMaterialOverridden;
|
||||
bool mNormalHeight; // true if normal map has height info in alpha channel
|
||||
|
||||
|
|
Loading…
Reference in a new issue