Skip to content

Auto Cull 2d text #13367

Answered by rparrett
miketwenty1 asked this question in Q&A
May 14, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

on every loop you are inserting a new Aabb into Text2d entitie

Only when TextLayoutInfo is updated.

Are you able to confirm that your method actually works

Yes, you can test this for yourself by removing the update_text_aabb from the app and observing the logged output as well as what should be an obvious degradation in frame rate.

Do you see anything wrong with my approach of including it as a component when spawning

Yes, the Bevy system that determines visibility based on Aabb is querying for an Aabb, so embedding the Aabb within your CullingAabbComponent won't work.

Adding the Aabb at spawn time will work fine, but I am adding it when TextLayoutInfo is updated so that I can give …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@miketwenty1
Comment options

@rparrett
Comment options

@miketwenty1
Comment options

@rparrett
Comment options

Answer selected by miketwenty1
@miketwenty1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants