summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
commit73870cb0b41144dc9932947d13d6aa27952d8849 (patch)
treef712491a5baffb2e7be797d4d9110602687865d8 /indra/newview/pipeline.cpp
parent3ff3e1a3537a5d051180aaf6223f5ddd8b540d35 (diff)
parent3da26ee8df6cc7e57ba3acbb91437ec97e151002 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index af2a26f54d..ffa20aec2d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7753,7 +7753,17 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m);
}
- shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV);
+ // auto adjust legacy sun color if needed
+ static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
+ static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f);
+ LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
+ LLColor3 sun_diffuse(mSunDiffuse.mV);
+ if (should_auto_adjust && psky->canAutoAdjust())
+ {
+ sun_diffuse *= auto_adjust_sun_color_scale;
+ }
+
+ shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sun_diffuse.mV);
shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV);
shader.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mReflectionMapManager.mMaxProbeLOD);