Skip to content
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

Support non-normalized, non-float vertex buffers and unaligned vertex buffers #1382

Merged
merged 6 commits into from
May 22, 2024

Conversation

bghgary
Copy link
Contributor

@bghgary bghgary commented May 21, 2024

This is a replacement for #1376. The original thinking was that we will promote the non-float attributes to float which was a complex and poor performance solution. The better solution is to change the shader to take non-float attributes. Fortunately, this shader processing is already happening for WebGPU on the JS side. @Popov72 factored out the shader processor on the JS side for WebGPU to also work with Babylon Native, which also includes code that aligns the buffers to 4-byte boundaries. This native PR ties everything together and removes all the promote to float logic we had earlier to try to handle non-float attributes.

This change includes updating Babylon.js to 7.7.2. Using an older version will result in a console.error if non-normalized, non-float vertex buffers are used.

@bghgary bghgary changed the title Vertex buffer fix Support non-float vertex unaligned buffers May 21, 2024
@bghgary bghgary requested a review from ryantrem May 21, 2024 22:21
@bghgary bghgary marked this pull request as ready for review May 21, 2024 22:21
@bghgary bghgary changed the title Support non-float vertex unaligned buffers Support non-normalized, non-float vertex buffers and unaligned vertex buffers May 22, 2024
@bghgary bghgary enabled auto-merge (squash) May 22, 2024 22:11
@bghgary bghgary merged commit 59798a7 into BabylonJS:master May 22, 2024
19 checks passed
@bghgary bghgary deleted the vertex-buffer-fix-2 branch May 23, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants