summaryrefslogtreecommitdiff
path: root/indra/newview
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
parent5c903d9c953e422a95ccd88b345d803b60ce65ff (diff)
DRTVWR-559 Nudge legacy sky ambient to be more like release. Incidental decruft
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl1
-rw-r--r--indra/newview/llsettingsvo.cpp14
-rw-r--r--indra/newview/pipeline.cpp2
3 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index de766d6bc7..82d7bb9835 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -38,7 +38,6 @@ uniform sampler2D exposureMap;
uniform vec2 screen_res;
VARYING vec2 vary_fragcoord;
-uniform float display_gamma;
vec3 linear_to_srgb(vec3 cl);
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
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 60d19bf1d6..9fe9f4e487 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7039,7 +7039,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) {
static LLCachedControl<F32> exposure(gSavedSettings, "RenderExposure", 1.f);
- F32 e = llclamp(exposure(), 0.5f, 4.f);
+ F32 e = llclamp(exposure(), 0.5f, 4.f);
static LLStaticHashedString s_exposure("exposure");