diff options
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 14 |
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 |