bevy/crates/bevy_render/src
Robert Swain c2a9d5843d Faster assign lights to clusters (#4345)
# Objective

- Fixes #4234
- Fixes #4473 
- Built on top of #3989
- Improve performance of `assign_lights_to_clusters`

## Solution

- Remove the OBB-based cluster light assignment algorithm and calculation of view space AABBs
- Implement the 'iterative sphere refinement' algorithm used in Just Cause 3 by Emil Persson as documented in the Siggraph 2015 Practical Clustered Shading talk by Persson, on pages 42-44 http://newq.net/dl/pub/s2015_practical.pdf
- Adapt to also support orthographic projections
- Add `many_lights -- orthographic` for testing many lights using an orthographic projection

## Results

- `assign_lights_to_clusters` in `many_lights` before this PR on an M1 Max over 1500 frames had a median execution time of 1.71ms. With this PR it is 1.51ms, a reduction of 0.2ms or 11.7% for this system.

---

## Changelog

- Changed: Improved cluster light assignment performance

Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-04-15 02:53:20 +00:00
..
camera scene_viewer: load cameras (#4425) 2022-04-11 22:56:06 +00:00
color Fixed case of R == G, following original conversion formula (#4383) 2022-04-04 18:59:00 +00:00
mesh Fix loading non-TriangleList meshes without normals in gltf loader (#4376) 2022-03-31 20:43:01 +00:00
primitives Faster assign lights to clusters (#4345) 2022-04-15 02:53:20 +00:00
render_graph bevy_render: Support removal of nodes, edges, subgraphs (#3048) 2022-03-21 23:58:37 +00:00
render_phase Compute Pipeline Specialization (#3979) 2022-03-23 00:27:26 +00:00
render_resource Use storage buffers for clustered forward point lights (#3989) 2022-04-07 16:16:35 +00:00
renderer bevy_app: add tracing event with tracy.frame_mark (#4320) 2022-04-08 22:50:23 +00:00
texture Reuse texture when resolving multiple passes (#3552) 2022-04-12 19:27:30 +00:00
view Reuse texture when resolving multiple passes (#3552) 2022-04-12 19:27:30 +00:00
lib.rs unsafeify World::entities_mut (#4093) 2022-03-30 23:52:45 +00:00
render_asset.rs Introduce SystemLabel's for RenderAssetPlugin, and change Image preparation system to run before others (#3917) 2022-03-29 19:44:45 +00:00
render_component.rs Obviate the need for RunSystem, and remove it (#3817) 2022-03-15 02:16:55 +00:00
settings.rs bevy_render: Use RenderDevice to get limits/features and expose AdapterInfo (#3931) 2022-02-16 21:17:37 +00:00