diff options
author | Graham Linden <graham@lindenlab.com> | 2019-01-08 13:15:00 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-01-08 13:15:00 -0800 |
commit | e13113ab0b5e7aea11feba3947d2bbf7c5699db1 (patch) | |
tree | f002e7a45605717a1e76af44dd449f048d487982 /indra | |
parent | 84bb8e1167fde0ceac4c40bcc2b1841238817097 (diff) |
SL-10305 fix post deferred gamma correction to address ALM mismatch with non-ALM lighting.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl | 2 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 8791469675..cbc19bbba3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -45,7 +45,7 @@ vec3 linear_to_srgb(vec3 cl); void main() { vec4 diff = texture2DRect(diffuseRect, vary_fragcoord); - diff.rgb = pow(diff.rgb, vec3(display_gamma)); + diff.rgb = linear_to_srgb(diff.rgb); frag_color = diff; } diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 6b1a0a2b77..e2e7aadb61 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -662,7 +662,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget) { LLGLSLShader *shader = (LLGLSLShader *)ptarget; - LLVector4 light_direction = LLEnvironment::instance().getClampedSunNorm(); + LLVector4 light_direction = LLEnvironment::instance().getClampedLightNorm(); if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT) { @@ -678,8 +678,11 @@ void LLSettingsVOSky::applySpecial(void *ptarget) shader->uniform4fv(LLShaderMgr::CLOUD_POS_DENSITY1, 1, vect_c_p_d1.mV); } + F32 g = getGamma(); + shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mSceneLightStrength); - shader->uniform4f(LLShaderMgr::GAMMA, getGamma(), 0.0, 0.0, 1.0); + shader->uniform4f(LLShaderMgr::GAMMA, g, 0.0, 0.0, 1.0); + shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, g); } LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const |