From b809e8e9312af5c8b7a7a0631aef1c16bc0edcf1 Mon Sep 17 00:00:00 2001 From: Robert Swain <50659922+robtfm@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:05:59 +0000 Subject: [PATCH] bevy_pbr: Fix ClusterConfig::None (#4483) # Objective - Fix `ClusterConfig::None` - This fix is from @robtfm but they didn't have time to submit it, so I am. ## Solution - Always clear clusters and skip processing when `ClusterConfig::None` - Conditionally remove `VisiblePointLights` from the view if it is present --- crates/bevy_pbr/src/light.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs index 3b33909f2f29c..095d112cecff4 100644 --- a/crates/bevy_pbr/src/light.rs +++ b/crates/bevy_pbr/src/light.rs @@ -731,8 +731,10 @@ pub(crate) fn assign_lights_to_clusters( { let clusters = clusters.into_inner(); - if matches!(config, ClusterConfig::None) && visible_lights.is_some() { - commands.entity(view_entity).remove::(); + if matches!(config, ClusterConfig::None) { + if visible_lights.is_some() { + commands.entity(view_entity).remove::(); + } clusters.clear(); continue; }