mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-07 00:15:34 +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));
|
writableStateSet->addUniform(new osg::Uniform("alphaRef", reqs.mAlphaRef));
|
||||||
|
|
||||||
|
if (!removedState->getAttributePair(osg::StateAttribute::ALPHAFUNC))
|
||||||
|
{
|
||||||
const auto* alphaFunc = writableStateSet->getAttributePair(osg::StateAttribute::ALPHAFUNC);
|
const auto* alphaFunc = writableStateSet->getAttributePair(osg::StateAttribute::ALPHAFUNC);
|
||||||
if (alphaFunc)
|
if (alphaFunc)
|
||||||
removedState->setAttribute(alphaFunc->first, alphaFunc->second);
|
removedState->setAttribute(alphaFunc->first, alphaFunc->second);
|
||||||
|
}
|
||||||
// This prevents redundant glAlphaFunc calls while letting the shadows bin still see the test
|
// 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);
|
writableStateSet->setAttribute(RemovedAlphaFunc::getInstance(reqs.mAlphaFunc), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue