summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-04-08 16:53:57 -0700
committerGraham Linden <graham@lindenlab.com>2019-04-08 16:53:57 -0700
commit996d441ddc64996711b5a4eb3135607686992b86 (patch)
tree55129c482873d34564f4a48fb06e681c93ad1112 /indra/newview/app_settings/shaders/class2
parent759525040ac11a2edee541c944ad0c6e9cc04d0f (diff)
SL-5186
Make projector ambiance unshadowed in both forward and deferred for consistency.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl10
2 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index ab380f70e8..7ccc91f73c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -218,15 +218,19 @@ void main()
dlit = color.rgb * plcol.rgb * plcol.a;
col = dlit*lit*diff_tex*shadow;
- amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
+
+ // unshadowed for consistency between forward and deferred?
+ amb_da += (da*0.5+0.5)/* *(1.0-shadow) */ *proj_ambiance;
}
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
-
- amb_da += (da*da*0.5+0.5)*(1.0-shadow)*proj_ambiance;
+
+ // unshadowed for consistency between forward and deferred?
+ amb_da += (da*da*0.5+0.5) /* *(1.0-shadow) */ * proj_ambiance;
amb_da *= dist_atten * noise;
amb_da = min(amb_da, 1.0-lit);
+
col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
@@ -251,7 +255,7 @@ void main()
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
vec3 speccol = dlit*scol*spec.rgb*shadow;
- speccol = max(speccol, vec3(0));
+ speccol = clamp(speccol, vec3(0), vec3(1));
col += speccol;
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index a9482ea54c..2844cc8574 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -185,7 +185,8 @@ void main()
lv = proj_origin-pos.xyz;
lv = normalize(lv);
float da = dot(norm, lv);
-
+ da = clamp(da, 0.0, 1.0);
+
vec3 col = vec3(0,0,0);
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
@@ -214,9 +215,10 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
dlit = color.rgb * plcol.rgb * plcol.a;
-
+
col = dlit*lit*diff_tex*shadow;
- amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
+
+ amb_da += (da*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance;
}
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
@@ -250,7 +252,7 @@ void main()
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
vec3 speccol = dlit*scol*spec.rgb*shadow;
- speccol = max(speccol, vec3(0));
+ speccol = clamp(speccol, vec3(0), vec3(1));
col += speccol;
}
}