-
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 |
|
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: |
| // Calculate offset in float32 elements | ||
| const offset = vertexBuffer.effectiveByteOffset / sizeInBytes; | ||
| defines[`${upperName}_OFFSET`] = offset; | ||
| } |
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.
"_COMPONENT_BYTES" is not set.
| } | ||
|
|
||
| // Add vertex buffer metadata defines for proper stride/offset handling | ||
| const geometry = renderingMesh.geometry; |
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 think you want to use the new PrepareDefinesForVertexPullingMetadata function instead?
Also, I think we should pass stride and offset as a byte count instead of a float count, to more easily handle all type conversions we will have to support (for example, type of position could be a (u)byte, (u)short, (u)int, float, and for the integer types, they could be normalized or not - these are type conversions we will have to perform in the shader).
Another thing is that we should probably use uniforms and not defines to pass data, else we will basically generate a new shader for each mesh, as (at least) offset will be different for each mesh.
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.