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

GLB parser incorrect index buffer construction #5869

Open
LeXXik opened this issue Nov 29, 2023 · 1 comment · May be fixed by #7042
Open

GLB parser incorrect index buffer construction #5869

LeXXik opened this issue Nov 29, 2023 · 1 comment · May be fixed by #7042
Labels

Comments

@LeXXik
Copy link
Contributor

LeXXik commented Nov 29, 2023

When GLB parser creates an index buffer, it passes a typed array to the constructor, instead of an array buffer. This results in view being a storage in the index buffer, instead of array buffer.

const indexBuffer = new IndexBuffer(device, indexFormat, indices.length, BUFFER_STATIC, indices);

@LeXXik
Copy link
Contributor Author

LeXXik commented Dec 1, 2023

For background:

I am generating a mesh collider. To avoid copying the indices, I don't use Mesh API, but use the index buffer directly. In order to avoid copying the buffer when sending to web worker, I am sending the underlying Array Buffer. This bug makes it accessing the buffer differently, depending on if the mesh was generated by procedural.js or from GLB parser:

indexBuffer.storage
vs
indexBuffer.storage.buffer

@LeXXik LeXXik linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants