-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Single-pass IBL shadow voxelization for WebGPU #17270
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
base: master
Are you sure you want to change the base?
Single-pass IBL shadow voxelization for WebGPU #17270
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17270/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/17270/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/17270/merge#BCU1XR#0 |
WebGL2 visualization test reporter: |
Devhost visualization test reporter: |
Visualization tests for WebGPU |
In a real-world scenario, I think we would let the user decide when to update the voxelization (meshes can also be moved without using animation, a custom vertex shader can apply deformation, etc.). But for a test PG, I think this is fine. Let us know when the PR is ready for review! |
This changes the voxelization strategy for WebGPU to allow it to be done in a single pass (though, generation of mips still takes additional steps). This is possible using
textureStore
to write to arbitrary texels in a 3D texture. It also uses vertex pulling to correctly determine the provoking vertex for each triangle and retrieve adjacent vertices so that we can calculate the triangle's normal. This is used to swizzle the xyz components to maximize the rasterized area and not miss voxels.Anywho, this makes updating shadows for animated meshes much more plausible. I'm not sure the best way to do this but currently, in my playground, I'm doing this:
Is there a better way to query whether there is currently an animation happening?