bevy/crates
robtfm 3f6068da3d fix issues with too many point lights (#3916)
# Objective

fix #3915 

## Solution

the issues are caused by
- lights are assigned to clusters before being filtered down to MAX_POINT_LIGHTS, leading to cluster counts potentially being too high
- after fixing the above, packing the count into 8 bits still causes overflow with exactly 256 lights affecting a cluster

to fix:

```assign_lights_to_clusters```
- limit extracted lights to MAX_POINT_LIGHTS, selecting based on shadow-caster & intensity (if required)
- warn if MAX_POINT_LIGHT count is exceeded

```prepare_lights```
- limit the lights assigned to a cluster to CLUSTER_COUNT_MASK (which is 1 less than MAX_POINT_LIGHTS) to avoid overflowing into the offset bits

notes:
- a better solution to the overflow may be to use more than 8 bits for cluster_count (the comment states only 14 of the remaining 24 bits are used for the offset). this would touch more of the code base but i'm happy to try if it has some benefit.
- intensity is only one way to select lights. it may be worth allowing user configuration of the light filtering, but i can't see a clean way to do that
2022-03-01 10:17:41 +00:00
..
bevy_app Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_asset Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_audio Audio control - play, pause, volume, speed, loop (#3948) 2022-03-01 01:12:11 +00:00
bevy_core Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_core_pipeline Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_crevice Don't panic in macro shape validation (#3647) 2022-01-15 22:14:43 +00:00
bevy_derive small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
bevy_diagnostic small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
bevy_dylib Release 0.6.0 (#3587) 2022-01-08 10:18:22 +00:00
bevy_dynamic_plugin Release 0.6.0 (#3587) 2022-01-08 10:18:22 +00:00
bevy_ecs Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_ecs_compile_fail_tests Release 0.6.0 (#3587) 2022-01-08 10:18:22 +00:00
bevy_gilrs Release 0.6.0 (#3587) 2022-01-08 10:18:22 +00:00
bevy_gltf Mesh vertex buffer layouts (#3959) 2022-02-23 23:21:13 +00:00
bevy_input Proper prehashing (#3963) 2022-02-18 03:26:01 +00:00
bevy_internal log spans on panic when trace is enabled (#3848) 2022-02-28 22:27:20 +00:00
bevy_log log spans on panic when trace is enabled (#3848) 2022-02-28 22:27:20 +00:00
bevy_macro_utils small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
bevy_math Release 0.6.0 (#3587) 2022-01-08 10:18:22 +00:00
bevy_pbr fix issues with too many point lights (#3916) 2022-03-01 10:17:41 +00:00
bevy_reflect Updated visibility of reflected trait (#4034) 2022-02-25 07:05:51 +00:00
bevy_render Expose draw indirect (#4056) 2022-02-28 10:26:49 +00:00
bevy_scene Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_sprite Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_tasks small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
bevy_text Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_transform small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
bevy_ui Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_utils Proper prehashing (#3963) 2022-02-18 03:26:01 +00:00
bevy_window Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
bevy_winit Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00