You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gkjohnson
changed the title
Change right child offsets to be relative to parent node
Change triangle offsets to be relative to parent node
Sep 22, 2024
gkjohnson
changed the title
Change triangle offsets to be relative to parent node
Change triangle offsets to be relative to geometry range
Sep 22, 2024
Once geometry can be "optimized" in BatchedMesh (ie the sub geometry ranges will be modified to collapse unused space) the MeshBVH triangle range references will be broken since they have moved. We need a way to "fix up" the built BVHs otherwise they will all have to be regenerated from scratch. There are a couple options for handling this:
"Fix up" the entire set of BVH nodes by adjusting each stored triangle "offset" field to be adjust for the new range. This should mostly mean adding / subtracting some amount each child triangle identifier. Updating every child node could be a bit slow, though.
Adjust all triangle identifiers to star at 0 and be relative to the specified BVH range when traversing. This means "fixing up" a BVH just means modifying the MeshBVH range but would mean having access to the geometry range in all traversal functions.
cc @agargaro you might be interested in this since you've been working on BatchedMesh stuff. Not sure if you have any other thoughts. I've made an issue to discuss the BatchedMesh "optimize" function here: mrdoob/three.js#29463
It will make generating and managing subsections of the arrays more manageable. Related to #513
The text was updated successfully, but these errors were encountered: