-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix UI borders #10078
Fix UI borders #10078
Conversation
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.
This should work.
I think we could do smaller than adding an u32
to the sort key, but not sure it's worth it. System extract_atlas_uinodes
could extract nodes with a UiNodeType::Content
, extract_uinode_borders
with UiNodeType::Border
, extract_uinode_outlines
with UiNodeType::Outline
and then this enum could be ordered
# Objective Fixes bevyengine#10069 ## Solution Extracted UI nodes were previously stored in a `SparseSet` and had a predictable iteration order. UI borders and outlines relied on this. Now they are stored in a HashMap and that is no longer true. This adds `entity.index()` to the sort key for `TransparentUi` so that the iteration order is predictable and the "border entities" that get spawned during extraction are guaranteed to get drawn after their respective container nodes again. I **think** that everything still works for overlapping ui nodes etc, because the z value / primary sort is still controlled by the "ui stack." Text above is just my current understanding. A rendering expert should check this out. I will do some more testing when I can.
# Objective Fixes bevyengine#10069 ## Solution Extracted UI nodes were previously stored in a `SparseSet` and had a predictable iteration order. UI borders and outlines relied on this. Now they are stored in a HashMap and that is no longer true. This adds `entity.index()` to the sort key for `TransparentUi` so that the iteration order is predictable and the "border entities" that get spawned during extraction are guaranteed to get drawn after their respective container nodes again. I **think** that everything still works for overlapping ui nodes etc, because the z value / primary sort is still controlled by the "ui stack." Text above is just my current understanding. A rendering expert should check this out. I will do some more testing when I can.
Objective
Fixes #10069
Solution
Extracted UI nodes were previously stored in a
SparseSet
and had a predictable iteration order. UI borders and outlines relied on this. Now they are stored in a HashMap and that is no longer true.This adds
entity.index()
to the sort key forTransparentUi
so that the iteration order is predictable and the "border entities" that get spawned during extraction are guaranteed to get drawn after their respective container nodes again.I think that everything still works for overlapping ui nodes etc, because the z value / primary sort is still controlled by the "ui stack."
Text above is just my current understanding. A rendering expert should check this out.
I will do some more testing when I can.