-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Voxel shadow fixes for interleaved buffers #17376
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?
Conversation
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
1 similar comment
|
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/17376/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/17376/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/17376/merge#BCU1XR#0 |
|
Devhost visualization test reporter: |
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
| #define MATRICESINDICES_OFFSET 0 | ||
| #endif | ||
|
|
||
| fn readMatrixIndices(index : u32) -> vec4f { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my attempt to get the bone matrix stuff working but I haven't been successful yet. I'm treating the storage buffer of indices as an array of u32's and then unpacking either 1 or 2-byte indices from that and converting to floats.
But I must be doing something wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to investigate this problem, but I noticed there's something wrong which is not related to morph/bones.
If you replace the alien head with a box, it works:
https://playground.babylonjs.com/?snapshot=refs/pull/17376/merge#BHCFCU#4

But if I comment out the code that checks if an animation is running, so that the voxelization code runs every two frames, there's no shadow anymore:
https://playground.babylonjs.com/?snapshot=refs/pull/17376/merge#BHCFCU#5

I was able to fix a bug (not related to the problem above, though):
With this bug fixed, if I comment out the code which regenerates the voxelization every two frames, we can see the shadow is ok (obviously, it does not take into account the animation, though):
babylonjs.webm
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
|
Devhost visualization test reporter: |
1cee238 to
ce4c445
Compare
|
@Popov72 I've included your fix and also made once that fixes the voxelization when calling it repeatedly. This allows the voxelization to work with all the animated assets that I've tried. |
|
Devhost visualization test reporter: |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
This PR adds defines to assist with vertex pulling when the vertex buffers are interleaved.
I'm also including a fix by @Popov72 for IBL shadow voxelization when using bones.