bevy/crates/bevy_render/src
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
..
camera Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
mesh Reliable change detection (#1471) 2021-03-19 17:53:26 +00:00
pass Update to wgpu-rs 0.7 (#542) 2021-01-31 20:06:42 -08:00
pipeline Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
render_graph Rebase of existing PBR work (#1554) 2021-03-20 03:22:33 +00:00
renderer format comments (#1612) 2021-03-11 00:27:30 +00:00
shader Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
texture Improved documentation for Events (#1669) 2021-03-17 23:42:19 +00:00
wireframe Remove remaining camerapos bindings (#1708) 2021-03-22 18:10:35 +00:00
color.rs color spaces and representation (#1572) 2021-03-17 23:59:51 +00:00
colorspace.rs color spaces and representation (#1572) 2021-03-17 23:59:51 +00:00
draw.rs Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
entity.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
lib.rs Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00