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

Change triangle offsets to be relative to geometry range #628

Open
gkjohnson opened this issue Jan 27, 2024 · 1 comment
Open

Change triangle offsets to be relative to geometry range #628

gkjohnson opened this issue Jan 27, 2024 · 1 comment
Milestone

Comments

@gkjohnson
Copy link
Owner

gkjohnson commented Jan 27, 2024

It will make generating and managing subsections of the arrays more manageable. Related to #513

@gkjohnson gkjohnson added this to the v0.8.0 milestone Jan 27, 2024
@gkjohnson 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 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
@gkjohnson
Copy link
Owner Author

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:

  1. "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.

  2. 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

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

No branches or pull requests

1 participant