Skip to content

Reproduce a bug example, (Model disappeared when same 3 models pathtraced) #671

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dongho-shin
Copy link
Contributor

related : #668

2024-08-12.3.50.16-1.mov

how to reproduce a bug

  1. check enable
  2. uncheck enable
  3. check add model
  4. check enable

@dongho-shin
Copy link
Contributor Author

dongho-shin commented Mar 24, 2025

Sorry for long time to fix this @gkjohnson ,
Actually this issue was caused by MeshBVHUniformStruct.js in three-mesh-bvh, wrong length comparison
image
cachedIndexAttr is still being used as an index attribute, but the
indirectBuffer is a Buffer for reference
It is 1/3 the size of the geometry index count because of that part below
image (1)

So the first time it's cached, the simple box's case calls
count(undefined)
length(1) ← default dummy data before adding any boxes at all, which is subsequently deleted.
Add 1 box
→ count(3) length(12 box 1 index data)
Add 2 additional boxes after the string
→ count(36) length(36 box 2 boxes added to match)
So the index length was not growing properly, so the data addition was not working properly.

After the caching comparison, the following logic
image (2)
image (3)

Because of adding by indirectBuffer, the properly cached IndexAttr was not tripled accordingly, so the data was not added.

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.

1 participant