Browse Source

fix for out of bounds shadow receiver

Nicolas Cannasse 4 years ago
parent
commit
749a95e153
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/shader/DirShadow.hx

+ 1 - 1
h3d/shader/DirShadow.hx

@@ -83,7 +83,7 @@ class DirShadow extends hxsl.Shader {
 					var shadowPos = transformedPosition * shadowProj;
 					var shadowUv = screenToUv(shadowPos.xy);
 					var depth = shadowMap.get(shadowUv.xy);
-					shadow = shadowPos.z - shadowBias > depth ? 0 : 1;
+					shadow = shadowPos.z.saturate() - shadowBias > depth ? 0 : 1;
 				}
 			}
 			dirShadow = shadow;