summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-01-15 16:06:34 -0800
committerGraham Linden <graham@lindenlab.com>2019-01-15 16:06:34 -0800
commit9de895aa03570935e49aeb5eb874444904de59e6 (patch)
treef7a94366fd0e8d3801a339c7c2615df522bab30f /indra/newview/app_settings/shaders/class1/deferred
parentfb75cf03a551809552d118ba3871ad5612f3d953 (diff)
SL-10369
Fix handling of backfaces in shared shadow sampling broken during de-duplication.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
index f626609fc2..70568bc75f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
@@ -120,6 +120,13 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float shadow = 0.0f;
vec4 spos = vec4(shadow_pos,1.0);
+
+ // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup
+ if (dp_directional_light <= 0.0)
+ {
+ return 0.0;
+ }
+
if (spos.z > -shadow_clip.w)
{
vec4 lpos;
@@ -174,7 +181,8 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
shadow /= weight;
}
- return shadow;
+
+ return min(dp_directional_light, shadow);
}
float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)