-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Deprecate PrimitiveMesh.custom_aabb
and ArrayMesh.custom_aabb
#99345
Deprecate PrimitiveMesh.custom_aabb
and ArrayMesh.custom_aabb
#99345
Conversation
267c25f
to
d728715
Compare
PrimitiveMesh.custom_aabb
and ArrayMesh.custom_aabb
d728715
to
a819d40
Compare
There is a very good reason to have With this change, users would have to manually set a custom AABB on every single geometry instance that uses that mesh/shader. It is much better for users to set the |
For the user to visualize the mesh it needs to be added to a mesh instance node anyway, so there will be a confusion to which custom_aabb to edit. There are also different scenarios which I'm not sure how the custom_aabb behaves (e.g. when you have a custom_aabb on the mesh resource and a different one set in GeometryInstance) Right now I added a way for both properties to update when the resource custom_aabb changes, so should I remove the deprecation and only keep that? I think the ideal way is to have the custom_aabb as a separate resource for each mesh to load separately. But thats way out of this PR scope. |
The AABB of the GeometryInstance is an AABB that surrounds all the AABBs of every surface. It is calculated by taking the min and max extents of all the surface AABBs. This becomes really important for things like particles and multimesh, since the GeometryInstance AABB encapsulates all the AABBs of all the instances. Every time an instance moves you have to update the GeometryInstance AABB (which is every frame for particles). Using GeometryInstance.custom_aabb allows you to skip those calculations (which is the reason we added it).
No, we need both properties. |
There is a redundancy in the
custom_aabb
property shared by thePrimitiveMesh, ArrayMesh
resources, andGeometryInstance3D
.I don't see the point of having 2 separate properties that do the same thing.
Also,
GeometryInstance3D.custom_aabb
can be visible because of this #89538.Note: I also did a workaround for the
PrimitiveMesh.custom_aabb
andArrayMesh.custom_aabb
: when setting those properties now theGeometryInstance3D.custom_aabb
will also update (making thecustom_abb
visible)