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

Check skeleton RID when using cached AABB #86245

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

ecmjohnson
Copy link
Contributor

Resolves #73521 by ensuring that the RID of the provided skeleton matches that used to compute the AABB of the mesh.

testing_fix2

This comment presents the root cause of the issue.

@ecmjohnson ecmjohnson requested a review from a team as a code owner December 16, 2023 22:56
@fire fire requested a review from a team December 17, 2023 00:46
@AThousandShips AThousandShips added this to the 4.3 milestone Dec 17, 2023
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but I am a bit worried about the performance result. With this change we could end up recomputing the AABB multiple times per frame as it is never cached for a skeleton/mesh pair.

We should almost be caching on the MeshInstance level so we can guarantee that each mesh has a single skeleton. After all, this code is getting called in _update_instance_aabb()

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, thinking through it some more, this is probably fine for now. We only call this function when the Instance knows it needs to update the AABB because something has changed. So the assumption is that, if this is called, it will actually do an update.

Since the AABB is cached by the Instance already, the extra level of caching here doesn't help much.

@akien-mga akien-mga merged commit 7986324 into godotengine:master Jan 8, 2024
@akien-mga
Copy link
Member

Thanks!

@ecmjohnson ecmjohnson deleted the fix-skeleton-culling branch January 16, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ragdoll visibility is inconsistent due to culling box problems
4 participants