-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Open
Labels
Description
Description
A couple examples:
- https://discourse.threejs.org/t/shadow-banding-with-webgpurenderer-vsmshadowmap/89017/3
- https://discourse.threejs.org/t/hide-line-from-shadow/53656
Reproduction steps
- Here's the webgpu VSM example with some debug helpers enabled, and also the spotlight frustum is tighter to more closely encompass the example: https://jsfiddle.net/s79ack12
No issue so yet:

- When we tighten up the spotlight's
shadow.focus, we can see a line at the edge of the spotlight's shadow map area: https://jsfiddle.net/zm53Ladu (line 87)
This is not typical shadow acne, as it happens exclusively along the edge of the shadow map area:

- A workaround is to patch
THREE.ShadowNode.prototype.setupShadowFilterto set shadow pixels to1inside of a border around the shadow map area. In this example, fading the shadow out (or more technically, fading the light back in): https://jsfiddle.net/4675h9j8
No more map edge artifact:

(it doesn't need to be a fade, it could be a hard drop off around the edges, but I also wanted a configurable fade in my case).
Code
The problem becomes apparent (at least in this scnenario) with this particular line:
spotLight.shadow.focus = 0.3Live example
above
Screenshots
above
Version
r182, macOS 26 Safari 26
Device
Desktop
Browser
Safari
OS
MacOS