summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingsvo.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-04-21 17:19:39 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-04-21 17:19:39 -0500
commit78bb75989e36b9598852e7dcce05dce37ab0ebe1 (patch)
tree9b8a866a55af96c09a609d5a4bdbc6181d038c63 /indra/newview/llsettingsvo.cpp
parent5c903d9c953e422a95ccd88b345d803b60ce65ff (diff)
DRTVWR-559 Nudge legacy sky ambient to be more like release. Incidental decruft
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r--indra/newview/llsettingsvo.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index f2f269fa63..1427dbefa1 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -716,6 +716,16 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
LLColor3 ambient(getTotalAmbient());
+ F32 g = getGamma();
+ if (ambient != LLColor3::black && getReflectionProbeAmbiance() == 0.f)
+ { //desaturate ambient for legacy compatibility
+ F32 h, s, l;
+ ambient.calcHSL(&h, &s, &l);
+ s *= 0.5f;
+ l *= 1.f / (g + llmax(g-1.f, 0.f));
+ ambient.setHSL(h, s, l);
+ }
+
if (irradiance_pass)
{ // during an irradiance map update, disable ambient lighting (direct lighting only) and desaturate sky color (avoid tinting the world blue)
shader->uniform3fv(LLShaderMgr::AMBIENT_LINEAR, LLVector3::zero.mV);
@@ -755,11 +765,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
shader->uniform1f(LLShaderMgr::HAZE_DENSITY_LINEAR, sRGBtoLinear(getHazeDensity()));
- F32 g = getGamma();
- F32 display_gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
-
shader->uniform1f(LLShaderMgr::GAMMA, g);
- shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, display_gamma);
}
LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const