-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Recompute AABBs #18742
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
base: main
Are you sure you want to change the base?
Recompute AABBs #18742
Conversation
…on to avoid component insertion where mutation is possible.
tychedelia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooohh, this is such a nice longstanding issue to fix, really confused me the first time I hit it. So glad to see AssetChanged helping here. There's probably a bit of perf hit for the table scan but I think this is such a sharp edge and PostUpdate has a lot of noise anyway that I think it's totally worth it.
Agreed, but, I would expect entities with meshes is going to be a pretty manageable number, and would likely be render bottlenecked first. (could be wrong!) |
|
That reminds me, let's make the mutation queries go brrrrr |
|
Looks like this I open, need to review why: #7971 The notable bit:
|
| .before(CheckVisibility) | ||
| .after(TransformSystem::TransformPropagate) | ||
| .after(AssetEvents) | ||
| .ambiguous_with(CalculateBounds), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean to be ambiguous with itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore all ambiguities between systems in the same set.
IceSentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, might need an opt-out just to be on the safe side.
The previous versions of this seemed to suffer from various performance issues but they also didn't have access to AssetChanged that allows for such a simple implementation.
|
We should bench this before merging, but I'm inclined to merge even with a modest regression. This is a really nasty bug, and "fast but incorrect" really isn't very useful. |
|
As far as I can tell, with this setup, meshes spawned with |
|
Yep. There are a few ways we could solve this, I don't know if we have precedent for any. The closest I can think of is something like an opt-out ZST like There is no way to tell if a newly added |
|
What if we initialized Aabb to NaNs |
We could even use special NaNs with cursed marker bits!! I don't know if we should do this, but it's an exciting idea because that feature of floats is so useless normally. |
|
My unasked for take on NaNs: please don't! NaNs can easily go viral, and tracking them back to the source can be hard. This makes them expensive in terms of developer time, particularly for beginners. Glam has some asserts that can help, but they have limited coverage and are disabled by default. |
|
I’m curious what’s blocking this pull request from moving forward (besides the conflicts)? Just asking since it seems like this pull request has been waiting for a while, and it seems like something that should be resolved! RE an opt-out: having an opt-out |
|
@aevyrie I'm inclined to merge this as-is, following discussion on Discord. If you have a bit of time to resolve merge conflicts I'd appreciate it; otherwise I'll try and find the time to do it myself. |
Objective
Solution
Testing