-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPURenderer: Add support for VSM. #29225
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I have to improve |
It looks like we have another issue in |
The behavior in WebGL seems odd. You can see the directional light but not its shadows. The spot light is completely missing in the scene (light + shadow). |
I stall the PR for the moment since I could not figure out the root cause so far. Hopefully the issue will pop up in a different, more isolated context. |
This PR #29326 should fix it, sorry the delay, I had to deconstruct the code step by step to find the source of the problem. |
Awesome, it really works! |
Related issue: -
Description
This PR adds support for Variance Shadow Maps (VSM) to
WebGPURenderer
.This is WIP though since the current code only supports one shadow casting light. I'm not sure why the shadows of an additional shadow casting light are currently ignored. The new example illustrates this issue. You only see the shadow of the spot light but no the directional light.
Some help/support in this context would be welcome 😇 .
Side note: VSM works by preprocessing the actual shadow map with two blur passes. The render target of the second blur pass is then used as the new shadow map in the shader. The shadow information are not stored as floats in a depth texture but in special two-component
distribution
vectors. A smart calculation based on these data leads to the final occlusion value.