summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");