-
-
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
Invisible UI Images when using certain transforms #5293
Comments
@superdump @cart I think we need to ensure this is fixed by 0.8; this is a severe regression. |
The clipping with x-rotation previously included in the issue description is actually not a regression, the same behavior is exhibited on 0.7. So the only regression here is the images going invisible with certain transforms. I opened another issue about the clipping and distortion present in 0.7: #5294 |
I tried a quick fix for this in #5389 |
# Objective - Fixes bevyengine#5293 - UI nodes with a rotation that made the top left corner lower than the top right corner (z rotations greater than π/4) were culled ## Solution - Do not cull nodes with a rotation, but don't do proper culling in this case As a reminder, changing rotation and scale of UI nodes is not recommended as it won't impact layout. This is a quick fix but doesn't handle properly rotations and scale in clipping/culling. This would need a lot more work as mentioned here: https://github.com/bevyengine/bevy/blob/c2b332f98a0bcab7390e4b184099202cfb4fbbe1/crates/bevy_ui/src/render/mod.rs#L404-L405
# Objective - Fixes bevyengine#5293 - UI nodes with a rotation that made the top left corner lower than the top right corner (z rotations greater than π/4) were culled ## Solution - Do not cull nodes with a rotation, but don't do proper culling in this case As a reminder, changing rotation and scale of UI nodes is not recommended as it won't impact layout. This is a quick fix but doesn't handle properly rotations and scale in clipping/culling. This would need a lot more work as mentioned here: https://github.com/bevyengine/bevy/blob/c2b332f98a0bcab7390e4b184099202cfb4fbbe1/crates/bevy_ui/src/render/mod.rs#L404-L405
# Objective - Fixes bevyengine#5293 - UI nodes with a rotation that made the top left corner lower than the top right corner (z rotations greater than π/4) were culled ## Solution - Do not cull nodes with a rotation, but don't do proper culling in this case As a reminder, changing rotation and scale of UI nodes is not recommended as it won't impact layout. This is a quick fix but doesn't handle properly rotations and scale in clipping/culling. This would need a lot more work as mentioned here: https://github.com/bevyengine/bevy/blob/c2b332f98a0bcab7390e4b184099202cfb4fbbe1/crates/bevy_ui/src/render/mod.rs#L404-L405
Bevy version
a1d3f1b
This does not reproduce on current stable version 0.7
Relevant system information
What you did
Spawned a UI image with a transform (e.g. to flip a UI sprite using rotation or scale):
What went wrong
Depending on the transform, the image either renders clipped or does not render at all.
Additional information
transform: Transform::from_rotation(Quat::from_rotation_z(0.5)),
(rotates with distortion on both)transform: Transform::from_rotation(Quat::from_rotation_z(1.0)),
(does not render on main)transform: Transform::from_scale(vec3(1.0, 0.5, 1.0)),
(scales correctly on both)transform: Transform::from_scale(vec3(1.0, -0.5, 1.0)),
(does not render on main)The text was updated successfully, but these errors were encountered: