diff options
author | Runitai Linden <davep@lindenlab.com> | 2021-12-17 09:27:19 -0600 |
---|---|---|
committer | Runitai Linden <davep@lindenlab.com> | 2021-12-17 09:27:19 -0600 |
commit | 92933b42522b37ad78fd714e8416681183d7d7f9 (patch) | |
tree | 3a859deda6047d28df3e2bd04c4299ca21c81495 /indra/newview/lldrawpoolalpha.cpp | |
parent | dd032467357a4aaf69c752c13e53122aff6c4755 (diff) | |
parent | 3ac21ebbf6b354e16ead2d095a61152c95a7243c (diff) |
Merge branch 'DRTVWR-546' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-546
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 5eb5c6caad..ee1a640f2d 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -84,12 +84,23 @@ 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(); + // Does this deferred shader need environment uniforms set such as sun_dir, etc. ? + // NOTE: We don't actually need a gbuffer since we are doing forward rendering (for transparency) post deferred rendering + // TODO: bindDeferredShader() probably should have the updating of the environment uniforms factored out into updateShaderEnvironmentUniforms() + // 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 +120,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 +132,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(); } |