From c10754ea6d47f88f3499f86543a7d6c7d439fda6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Mar 2019 13:56:04 -0700 Subject: SL-10741 Remove shadow influence on ambient term causing inverted lighting in extreme setups. --- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 5 ++--- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index a5076ef609..251ec7d785 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -198,7 +198,7 @@ void main() float ambient = abs(da); ambient *= 0.5; ambient *= ambient; - ambient = 1.0 - ambient * smoothstep(0.0, 0.3, shadow); + ambient = 1.0 - ambient; vec3 sun_contrib = min(da, shadow) * sunlit; diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 5f4f1677d7..76c1fc7cf4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -294,16 +294,15 @@ void main() da = clamp(da, 0.0, 1.0); da = pow(da, 1.0 / 1.3); - col.rgb = amblit; - float ambient = abs(da); ambient *= 0.5; ambient *= ambient; - ambient = 1.0 - ambient * smoothstep(0.0, 0.3, shadow); + ambient = 1.0 - ambient; float final_da = min(da, shadow); vec3 sun_contrib = final_da * sunlit; + col.rgb = amblit; col.rgb *= ambient; col.rgb += sun_contrib; col.rgb *= diffuse.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 484c0cae3e..27532ce458 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -123,7 +123,7 @@ void main() float ambient = abs(da); ambient *= 0.5; ambient *= ambient; - ambient = 1.0 - ambient * smoothstep(0.0, 0.3, scol); + ambient = 1.0 - ambient; vec3 sun_contrib = min(da,scol) * sunlit; -- cgit v1.2.3