diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2021-12-15 10:38:18 -0800 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2021-12-15 10:39:00 -0800 |
commit | 6164d465af3f71ff1295d0170fda22d2862c496c (patch) | |
tree | cd10139b26af84c53192377bfe2a97a2502f2478 /indra | |
parent | 915376b37988f93704553aeda103d525420997ea (diff) |
SL-16493: Fix non-fullbright partial alpha objects not being lit by sun broken in 511de439a3
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 5eb5c6caad..3de9fda945 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -84,12 +84,21 @@ S32 LLDrawPoolAlpha::getNumPostDeferredPasses() } // set some common parameters on the given shader to prepare for alpha rendering -static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma) +static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma, bool deferredEnvironment) { static LLCachedControl<F32> displayGamma(gSavedSettings, "RenderDeferredDisplayGamma"); F32 gamma = displayGamma; - shader->bind(); + // Deferred shader needs environment uniforms set such as sun_dir, etc. ? + // i.e. shaders\class1\deferred\alphaF.glsl + if (deferredEnvironment) + { + gPipeline.bindDeferredShader( *shader ); + } + else + { + shader->bind(); + } shader->uniform1i(LLShaderMgr::NO_ATMO, (LLPipeline::sRenderingHUDs) ? 1 : 0); shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f / 2.2f)); @@ -109,7 +118,7 @@ static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma) //also prepare rigged variant if (shader->mRiggedVariant && shader->mRiggedVariant != shader) { - prepare_alpha_shader(shader->mRiggedVariant, textureGamma); + prepare_alpha_shader(shader->mRiggedVariant, textureGamma, deferredEnvironment); } } @@ -121,15 +130,15 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass) // first pass, regular forward alpha rendering { emissive_shader = (LLPipeline::sUnderWaterRender) ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; - prepare_alpha_shader(emissive_shader, true); + prepare_alpha_shader(emissive_shader, true, false); fullbright_shader = (LLPipeline::sImpostorRender) ? &gDeferredFullbrightProgram : (LLPipeline::sUnderWaterRender) ? &gDeferredFullbrightWaterProgram : &gDeferredFullbrightProgram; - prepare_alpha_shader(fullbright_shader, true); + prepare_alpha_shader(fullbright_shader, true, false); simple_shader = (LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram : (LLPipeline::sUnderWaterRender) ? &gDeferredAlphaWaterProgram : &gDeferredAlphaProgram; - prepare_alpha_shader(simple_shader, false); + prepare_alpha_shader(simple_shader, false, true); //prime simple shader (loads shadow relevant uniforms) forwardRender(); } |