-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix ThinEngine.updateDynamicIndexBuffer #12564
Conversation
packages/dev/core/src/Engines/Extensions/engine.dynamicBuffer.ts
Outdated
Show resolved
Hide resolved
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://babylonsnapshots.z22.web.core.windows.net/refs/pull/12564/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12564/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/12564/merge#BCU1XR#0 |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
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://babylonsnapshots.z22.web.core.windows.net/refs/pull/12564/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12564/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/12564/merge#BCU1XR#0 |
and here is a very simple playground with the bug : https://playground.babylonjs.com/#VKBJN#2738 |
@sebavan @deltakosh I thought I made a comment on my changes but I cannot see it up there. Did I forget to click the "Comment" button ? 😑 I changes the codes so that the same code is used in Also There might be an issue in As a side note, concerning this function
Which does not look like a very good idea too me in case of updatable IndexBuffer, even if it should work in most cases. |
all good for me besides the formatting (just run 'npm run format:fix') |
formatted ! |
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://babylonsnapshots.z22.web.core.windows.net/refs/pull/12564/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12564/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/12564/merge#BCU1XR#0 |
This is to fix a bug we ran into.
To repro :
at creation time, provide a mesh with indices of type
Array<number>
=> if all the indies are below 65535, theArray<number>
is normallized into anUInt16Array
inThinEngine._normalizeIndexData
call
Mesh.updateIndices
with aUInt32Array
=> instead of converting toUInt16Array
as if aArray<number>
had been passed, theUInt32Array
is forwarded to WebGL, leading to wrong indexing.