diff options
author | Brad Linden <46733234+brad-linden@users.noreply.github.com> | 2023-09-20 14:45:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 14:45:03 -0700 |
commit | e02dc20b9db4c6ec192b2c68c4c732a26296fc20 (patch) | |
tree | be25a3dff6011a3a8d07b7b29b53eb3aad17f253 /indra/newview/pipeline.cpp | |
parent | 5b2de090c1ac44c415e8573e0d6b1136cd689f35 (diff) | |
parent | bb7f023aaaaa2aaa747a131486390f739cc32ed3 (diff) |
Merge pull request #379 from secondlife/davep/SL-19842
New GLTF protocol and lighting changes
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1620b1ff4c..78d4e65d42 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7730,7 +7730,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); |