-
-
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
Fix text2d view-visibility #10100
Fix text2d view-visibility #10100
Conversation
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.
Assuming this works, I prefer this PR to the other one.
Don’t want to muddy the waters but since the new sprites are only created for visible entities could we just have a force_visible bool that gets set to true on the new ones? Not sure if there’s other value to tracking the original entity edit: why don’t we not extract invisible sprites and omit the check entirely? |
My understanding is that entities that are definitely not visible in any view are not extracted, but the visibility check in |
I re-did the benchmarks on power / without a sneaky bevy ant simulator running in the background / actually averaging all 1500 framerate samples (oops). |
# Objective Fixes bevyengine#9676 Possible alternative to bevyengine#9708 `Text2dBundles` are not currently drawn because the render-world-only entities for glyphs that are created in `extract_text2d_sprite` are not tracked by the per-view `VisibleEntities`. ## Solution Add an `Option<Entity>` to `ExtractedSprite` that keeps track of the original entity that caused a "glyph entity" to be created. Use that in `queue_sprites` if it exists when checking view visibility. ## Benchmarks Quick benchmarks. Average FPS over 1500 frames. | bench | before fps | after fps | diff | |-|-|-|-| |many_sprites|884.93|879.00|🟡 -0.7%| |bevymark -- --benchmark --waves 100 --per-wave 1000 --mode sprite|75.99|75.93|🟡 -0.1%| |bevymark -- --benchmark --waves 50 --per-wave 1000 --mode mesh2d|32.85|32.58|🟡 -0.8%|
# Objective Fixes bevyengine#9676 Possible alternative to bevyengine#9708 `Text2dBundles` are not currently drawn because the render-world-only entities for glyphs that are created in `extract_text2d_sprite` are not tracked by the per-view `VisibleEntities`. ## Solution Add an `Option<Entity>` to `ExtractedSprite` that keeps track of the original entity that caused a "glyph entity" to be created. Use that in `queue_sprites` if it exists when checking view visibility. ## Benchmarks Quick benchmarks. Average FPS over 1500 frames. | bench | before fps | after fps | diff | |-|-|-|-| |many_sprites|884.93|879.00|🟡 -0.7%| |bevymark -- --benchmark --waves 100 --per-wave 1000 --mode sprite|75.99|75.93|🟡 -0.1%| |bevymark -- --benchmark --waves 50 --per-wave 1000 --mode mesh2d|32.85|32.58|🟡 -0.8%|
Objective
Fixes #9676
Possible alternative to #9708
Text2dBundles
are not currently drawn because the render-world-only entities for glyphs that are created inextract_text2d_sprite
are not tracked by the per-viewVisibleEntities
.Solution
Add an
Option<Entity>
toExtractedSprite
that keeps track of the original entity that caused a "glyph entity" to be created.Use that in
queue_sprites
if it exists when checking view visibility.Benchmarks
Quick benchmarks. Average FPS over 1500 frames.