mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 07:45:39 +00:00
Do not overwrite old removed state with old dummy state
This commit is contained in:
parent
0e122b1e3d
commit
2147c18cf5
1 changed files with 6 additions and 3 deletions
|
@ -402,9 +402,12 @@ namespace Shader
|
|||
{
|
||||
writableStateSet->addUniform(new osg::Uniform("alphaRef", reqs.mAlphaRef));
|
||||
|
||||
const auto* alphaFunc = writableStateSet->getAttributePair(osg::StateAttribute::ALPHAFUNC);
|
||||
if (alphaFunc)
|
||||
removedState->setAttribute(alphaFunc->first, alphaFunc->second);
|
||||
if (!removedState->getAttributePair(osg::StateAttribute::ALPHAFUNC))
|
||||
{
|
||||
const auto* alphaFunc = writableStateSet->getAttributePair(osg::StateAttribute::ALPHAFUNC);
|
||||
if (alphaFunc)
|
||||
removedState->setAttribute(alphaFunc->first, alphaFunc->second);
|
||||
}
|
||||
// This prevents redundant glAlphaFunc calls while letting the shadows bin still see the test
|
||||
writableStateSet->setAttribute(RemovedAlphaFunc::getInstance(reqs.mAlphaFunc), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue