Skip to content

Commit 1f17097

Browse files
committed
Discard samples without z values
1 parent 432d58c commit 1f17097

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ContactShadowRenderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ void main() {
277277
// At that screen space coordinate, what is the position of the object we see?
278278
vec3 samplePos = worldFromScreen(offset);
279279
280+
if (samplePos.z > mix(uNear, uFar, 0.99)) continue;
281+
280282
// The amount of occlusion is proportional to the *cosine* of the angle between
281283
// the line connecting the object to the surface and the surface normal. This is
282284
// because light coming in at an angle is more spread out and thus delivers less

0 commit comments

Comments
 (0)