bevy/crates
Aaron Winter b65ec82d46 Frustum Culling (for Sprites) (#1492)
This PR adds two systems to the sprite module that culls Sprites and AtlasSprites that are not within the camera's view.
This is achieved by removing / adding a new  `Viewable` Component dynamically.

Some of the render queries now use a `With<Viewable>` filter to only process the sprites that are actually on screen, which improves performance drastically for scene swith a large amount of sprites off-screen.

https://streamable.com/vvzh2u

This scene shows a map with a 320x320 tiles, with a grid size of 64p.
This is exactly 102400 Sprites in the entire scene.

Without this PR, this scene runs with 1 to 4 FPS.

With this PR..
.. at 720p, there are around 600 visible sprites and runs at ~215 FPS
.. at 1440p there are around 2000 visible sprites and runs at ~135 FPS

The Systems this PR adds take around 1.2ms (with 100K+ sprites in the scene)

Note:
This is only implemented for Sprites and AtlasTextureSprites.
There is no culling for 3D in this PR.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-03-24 21:29:53 +00:00
..
bevy_app System sets and run criteria v2 (#1675) 2021-03-24 20:11:55 +00:00
bevy_asset improve error message when asset type hasn't beed added to app (#1487) 2021-03-14 00:36:15 +00:00
bevy_audio Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_core Reliable change detection (#1471) 2021-03-19 17:53:26 +00:00
bevy_derive format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_diagnostic ♻️ Timer refactor to duration. Add Stopwatch struct. (#1151) 2021-03-05 19:59:14 +00:00
bevy_dylib release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
bevy_dynamic_plugin update libloading (#1543) 2021-03-03 03:11:12 +00:00
bevy_ecs System sets and run criteria v2 (#1675) 2021-03-24 20:11:55 +00:00
bevy_gilrs Resolve (most) internal system ambiguities (#1606) 2021-03-10 22:37:02 +00:00
bevy_gltf Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
bevy_input format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_internal Rebase of existing PBR work (#1554) 2021-03-20 03:22:33 +00:00
bevy_log Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_math use std clamp instead of Bevy's (#1644) 2021-03-13 18:07:14 +00:00
bevy_pbr Rebase of existing PBR work (#1554) 2021-03-20 03:22:33 +00:00
bevy_reflect fix dyn warning (#1690) 2021-03-19 02:53:26 +00:00
bevy_render Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_scene Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
bevy_sprite Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_tasks format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_text Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_transform Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
bevy_ui Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_utils Update ahash requirement from 0.6.1 to 0.7.0 (#1370) 2021-02-01 13:29:54 -08:00
bevy_wgpu color spaces and representation (#1572) 2021-03-17 23:59:51 +00:00
bevy_window Derive PartialEq for WindowMode (#1688) 2021-03-18 23:47:34 +00:00
bevy_winit format comments (#1612) 2021-03-11 00:27:30 +00:00