Auto Cull 2d text #13367
Answered
by
rparrett
miketwenty1
asked this question in
Q&A
Auto Cull 2d text
#13367
-
|
I'm trying to cull 2d text so my game doesn't lag, I'm spawning a massive amount of 2d text in my game, and I want an easy way to hide it, if it's not insight of the camera. Is there an easy way to do this without recreating the wheel? I see there is "ViewVisibility" https://docs.rs/bevy/latest/bevy/prelude/struct.ViewVisibility.html, but I'm unsure how to use it. Any pointers or examples would be great! |
Beta Was this translation helpful? Give feedback.
Answered by
rparrett
May 14, 2024
Replies: 1 comment 5 replies
-
|
I suspect that adding an |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only when
TextLayoutInfois updated.Yes, you can test this for yourself by removing the
update_text_aabbfrom the app and observing the logged output as well as what should be an obvious degradation in frame rate.Yes, the Bevy system that determines visibility based on
Aabbis querying for anAabb, so embedding theAabbwithin yourCullingAabbComponentwon't work.Adding the
Aabbat spawn time will work fine, but I am adding it whenTextLayoutInfois updated so that I can give …