-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Use stack_z_offsets
in all the cases we create a TransparentUi
#16197
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doup
commented
Oct 31, 2024
@@ -75,14 +75,16 @@ pub mod graph { | |||
/// When this is _not_ possible, pick a suitably unique index unlikely to clash with other things (ex: `0.1826823` not `0.1`). | |||
/// | |||
/// Offsets should be unique for a given node entity to avoid z fighting. | |||
/// These should pretty much _always_ be larger than -1.0 and smaller than 1.0 to avoid clipping into nodes | |||
/// These should pretty much _always_ be larger than -0.5 and smaller than 0.5 to avoid clipping into nodes |
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.
Technically not true (could be -0.3, 0.7), but more safe than the suggested -1.0
to 1.0
range since with 0.5
there wouldn't be overlap between two consecutive nodes.
BenjaminBrienen
approved these changes
Nov 1, 2024
BenjaminBrienen
added
A-Rendering
Drawing game state to the screen
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
labels
Nov 1, 2024
BenjaminBrienen
approved these changes
Nov 1, 2024
andriyDev
approved these changes
Nov 2, 2024
alice-i-cecile
added
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
and removed
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
labels
Nov 4, 2024
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Dec 2, 2024
…evyengine#16197) # Objective Use same pattern when creating `TransparentUi` items where the `sort_key` is the `UiNode` stack index + some offset. ## Solution Refactored to follow same pattern. ## Testing Ran few UI examples. ## Doubts Maybe `stack_z_offsets::BACKGROUND_COLOR` should be renamed. This is used for `ExtractedUiNode`, which is not only used for "background color" it's also used to render borders, images and text (I think).
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
…evyengine#16197) # Objective Use same pattern when creating `TransparentUi` items where the `sort_key` is the `UiNode` stack index + some offset. ## Solution Refactored to follow same pattern. ## Testing Ran few UI examples. ## Doubts Maybe `stack_z_offsets::BACKGROUND_COLOR` should be renamed. This is used for `ExtractedUiNode`, which is not only used for "background color" it's also used to render borders, images and text (I think).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Rendering
Drawing game state to the screen
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Use same pattern when creating
TransparentUi
items where thesort_key
is theUiNode
stack index + some offset.Solution
Refactored to follow same pattern.
Testing
Ran few UI examples.
Doubts
Maybe
stack_z_offsets::BACKGROUND_COLOR
should be renamed. This is used forExtractedUiNode
, which is not only used for "background color" it's also used to render borders, images and text (I think).