Skip to content

Commit

Permalink
bevy_pbr: Fix ClusterConfig::None (bevyengine#4483)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
robtfm committed Apr 15, 2022
1 parent 424d4d2 commit b809e8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<VisiblePointLights>();
if matches!(config, ClusterConfig::None) {
if visible_lights.is_some() {
commands.entity(view_entity).remove::<VisiblePointLights>();
}
clusters.clear();
continue;
}
Expand Down

0 comments on commit b809e8e

Please sign in to comment.