Sprite
culling does not update Aabb
when Handle<Image>
changes
#11892
Labels
A-Assets
Load files from disk to use for things like images, models, and sounds
A-Rendering
Drawing game state to the screen
C-Bug
An unexpected or incorrect behavior
Bevy version
0.12
What you did
I upgraded from Bevy 0.10 to 0.12 and noticed that sprites would disappear before they had completely left the camera view. I assume this is just because sprite culling was implemented (with bugs) after 0.10.
What went wrong
Here's a video. Notice how the spinning cards will pop out when their center leaves the view.
card_clipping_bug.mp4
Additional information
I know what the root cause is. When
Sprite
s are spawned, for some reason they have a "placeholder"Image
asset which is only 1x1 pixels. The functioncalculate_bounds_2d
relies on theImage
to calculate bounds when there is nocustom_size
set on theSprite
. However, the change detection on this query does not account forChanged<Handle<Image>>
.bevy/crates/bevy_sprite/src/lib.rs
Lines 130 to 165 in fe777d5
I believe the addition of
Changed<Handle<Image>>
is necessary but not sufficient to completely fix this issue, as we still need to fix #5069.Related: #10587
The text was updated successfully, but these errors were encountered: