-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
functions: inspect takes too long in getBounds #1612
Comments
I think the underlying challenge in this example is that the scene reuses the same meshes on many nodes, and we end up recalculating the world AABB for the same mesh hundreds of times. Repeated AABB calculation can't fully be avoided — transforming a local AABB into world space does not yield an exact world AABB, it will be too large. But we could reduce the number of AABB calculations by:
I expect we can reduce time for An option to skip Another option might be to expose individual functions like |
This could be less accurate than the current impl of min/max from each vertex in world space. See comments here. So this could lead to a breaking change, or an option which is off by default.
Yes, it's good to have underlying functions like |
Wouldn't use the conservative AABB for the final result – just as a pre-pass. So we'd only compute an exact AABB for each node if its conservative AABB is not fully contained by the scene AABB yet. Final result will still be exact, just faster (hopefully). But probably exporting the smaller functions could be good in any case! |
Is your feature request related to a problem? Please describe.
In function
inspect
, it callsgetBounds
by default, which takes too long to run in some large models.Describe the solution you'd like
Add an option to skip
getBounds
ininspect
.Describe alternatives you've considered
Get min/max from positions accessor, then apply transform, could be less accurate.
Additional context
Taking the glb file from another issue for example, it took ~24s in
getBounds
.The text was updated successfully, but these errors were encountered: