bevy/crates
Robert Swain ac8bbafc5c Faster view frustum culling (#4181)
# Objective

- Reduce time spent in the `check_visibility` system

## Solution

- Use `Vec3A` for all bounding volume types to leverage SIMD optimisations and to avoid repeated runtime conversions from `Vec3` to `Vec3A`
- Inline all bounding volume intersection methods
- Add on-the-fly calculated `Aabb` -> `Sphere` and do `Sphere`-`Frustum` intersection tests before `Aabb`-`Frustum` tests. This is faster for `many_cubes` but could be slower in other cases where the sphere test gives a false-positive that the `Aabb` test discards. Also, I tested precalculating the `Sphere`s and inserting them alongside the `Aabb` but this was slower. 
- Do not test meshes against the far plane. Apparently games don't do this anymore with infinite projections, and it's one fewer plane to test against. I made it optional and still do the test for culling lights but that is up for discussion.
- These collectively reduce `check_visibility` execution time in `many_cubes -- sphere` from 2.76ms to 1.48ms and increase frame rate from ~42fps to ~44fps
2022-03-19 04:41:28 +00:00
..
bevy_app Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_asset Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_audio Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_core Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_core_pipeline Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_crevice Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_derive Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_diagnostic Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_dylib Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_dynamic_plugin Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_ecs Change Cow<[ComponentId]> to Box<[ComponentId]> (#4185) 2022-03-19 04:14:27 +00:00
bevy_ecs_compile_fail_tests Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_gilrs Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_gltf Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_hierarchy Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_input Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_internal Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_log Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_macro_utils Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_math Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_pbr Faster view frustum culling (#4181) 2022-03-19 04:41:28 +00:00
bevy_reflect Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_render Faster view frustum culling (#4181) 2022-03-19 04:41:28 +00:00
bevy_scene Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_sprite Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_tasks Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_text Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_transform Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_ui Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_utils Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_window Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00
bevy_winit Bump Bevy to 0.7.0-dev (#4230) 2022-03-19 03:54:15 +00:00