summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-13 13:56:04 -0700
committerGraham Linden <graham@lindenlab.com>2019-03-13 13:56:04 -0700
commitc10754ea6d47f88f3499f86543a7d6c7d439fda6 (patch)
tree4febc0cd448df9afd9b6c7c0c3fd141b71ba98f3 /indra
parent898c9f44218353b3bf71b78ffce02662b4927625 (diff)
SL-10741
Remove shadow influence on ambient term causing inverted lighting in extreme setups.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl2
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;