Update addedState in shadervisitor.cpp

macos_ci_fix
Petr Mikheev 1 year ago
parent 63d5bd6f8a
commit a401461a64

@ -687,7 +687,9 @@ namespace Shader
{ {
if (reqs.mSoftParticles) if (reqs.mSoftParticles)
defineMap["disableNormals"] = "1"; defineMap["disableNormals"] = "1";
writableStateSet->setAttribute(new osg::ColorMaski(1, false, false, false, false)); auto colorMask = new osg::ColorMaski(1, false, false, false, false);
writableStateSet->setAttribute(colorMask);
addedState->setAttribute(colorMask);
} }
if (reqs.mSoftParticles) if (reqs.mSoftParticles)
@ -695,6 +697,7 @@ namespace Shader
const int unitSoftEffect const int unitSoftEffect
= mShaderManager.reserveGlobalTextureUnits(Shader::ShaderManager::Slot::OpaqueDepthTexture); = mShaderManager.reserveGlobalTextureUnits(Shader::ShaderManager::Slot::OpaqueDepthTexture);
writableStateSet->addUniform(new osg::Uniform("opaqueDepthTex", unitSoftEffect)); writableStateSet->addUniform(new osg::Uniform("opaqueDepthTex", unitSoftEffect));
addedState->addUniform("opaqueDepthTex");
} }
if (writableStateSet->getMode(GL_ALPHA_TEST) != osg::StateAttribute::INHERIT if (writableStateSet->getMode(GL_ALPHA_TEST) != osg::StateAttribute::INHERIT

Loading…
Cancel
Save