Babylon.js icon indicating copy to clipboard operation
Babylon.js copied to clipboard

Voxel shadow fixes for interleaved buffers

Open MiiBond opened this issue 2 months ago • 22 comments

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.

MiiBond avatar Oct 31 '25 18:10 MiiBond

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Oct 31 '25 18:10 bjsplat

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Oct 31 '25 18:10 bjsplat

Snapshot stored with reference name: refs/pull/17376/merge

Test environment: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/index.html

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 https://sandbox.babylonjs.com/?snapshot=refs/pull/17376/merge https://gui.babylonjs.com/?snapshot=refs/pull/17376/merge https://nme.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

bjsplat avatar Oct 31 '25 18:10 bjsplat

Interaction tests

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/interactionplaywright/index.html

bjsplat avatar Oct 31 '25 18:10 bjsplat

Devhost visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/devhostplaywright/index.html

bjsplat avatar Oct 31 '25 18:10 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgl2playwright/index.html

bjsplat avatar Oct 31 '25 18:10 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Oct 31 '25 18:10 bjsplat

Interaction tests

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/interactionplaywright/index.html

bjsplat avatar Oct 31 '25 22:10 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgl2playwright/index.html

bjsplat avatar Oct 31 '25 22:10 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Oct 31 '25 22:10 bjsplat

Devhost visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/devhostplaywright/index.html

bjsplat avatar Oct 31 '25 22:10 bjsplat

@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. Though, I suspect an animated asset that moves a lot will pass outside the bounds of the voxelization since the bounds update doesn't take skinning into account.

MiiBond avatar Nov 07 '25 19:11 MiiBond

Interaction tests

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/interactionplaywright/index.html

bjsplat avatar Nov 07 '25 19:11 bjsplat

Devhost visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/devhostplaywright/index.html

bjsplat avatar Nov 07 '25 19:11 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Nov 07 '25 20:11 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgl2playwright/index.html

bjsplat avatar Nov 07 '25 20:11 bjsplat

@MiiBond fyi cause I think some of the comments went in late :-)

sebavan avatar Nov 19 '25 00:11 sebavan

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Nov 21 '25 21:11 bjsplat

I didn't have time today, but I will review the PR tomorrow.

Popov72 avatar Nov 24 '25 18:11 Popov72

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Nov 24 '25 18:11 bjsplat

You should remove package-lock.json from the PR.

Popov72 avatar Nov 25 '25 17:11 Popov72

cc @MiiBond for the last batch of comments :-)

sebavan avatar Dec 08 '25 16:12 sebavan

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Dec 10 '25 23:12 bjsplat

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Dec 11 '25 18:12 bjsplat

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Dec 11 '25 18:12 bjsplat

I finally got back to this. I barely remember what I was doing in this code but I think I've fixed most of the issues. I can see the shadows animate now for skinned meshes and morph target meshes.

MiiBond avatar Dec 11 '25 18:12 MiiBond

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat avatar Dec 11 '25 19:12 bjsplat

Snapshot stored with reference name: refs/pull/17376/merge

Test environment: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/index.html

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 your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/17376/merge https://sandbox.babylonjs.com/?snapshot=refs/pull/17376/merge https://gui.babylonjs.com/?snapshot=refs/pull/17376/merge https://nme.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

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

bjsplat avatar Dec 11 '25 19:12 bjsplat

Interaction tests

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/interactionplaywright/index.html

bjsplat avatar Dec 11 '25 19:12 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17376/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Dec 11 '25 19:12 bjsplat