From 4f724f63049e53b9c223c7665e7e5d2344adff0e Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Tue, 12 Mar 2019 10:18:52 -0700
Subject: [PATCH] SL-10732

Fix accum of shadow weights and handling of clipped areas in spot shadow sampling.
---
 .../app_settings/shaders/class1/deferred/shadowUtil.glsl    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
index c927c4bf069..6ff49c7dacb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl
@@ -161,7 +161,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
 
 float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)
 {
-    float shadow = 1.0f;
+    float shadow = 0.0f;
     pos += norm * spot_shadow_offset;
 
     vec4 spos = vec4(pos,1.0);
@@ -194,6 +194,10 @@ float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)
 
         shadow /= weight;
     }
+    else
+    {
+        shadow = 1.0f;
+    }
     return shadow;
 }
 
-- 
GitLab