From a401461a6471b303ba846e97ce9598fe1e10f054 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Wed, 27 Sep 2023 21:19:59 +0200 Subject: [PATCH] Update addedState in shadervisitor.cpp --- components/shader/shadervisitor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp index 0a9d1c74e6..1aa0f76e17 100644 --- a/components/shader/shadervisitor.cpp +++ b/components/shader/shadervisitor.cpp @@ -687,7 +687,9 @@ namespace Shader { if (reqs.mSoftParticles) 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) @@ -695,6 +697,7 @@ namespace Shader const int unitSoftEffect = mShaderManager.reserveGlobalTextureUnits(Shader::ShaderManager::Slot::OpaqueDepthTexture); writableStateSet->addUniform(new osg::Uniform("opaqueDepthTex", unitSoftEffect)); + addedState->addUniform("opaqueDepthTex"); } if (writableStateSet->getMode(GL_ALPHA_TEST) != osg::StateAttribute::INHERIT