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
This commit is contained in:
Robert Swain 2022-04-15 16:05:59 +00:00
parent 424d4d26f1
commit b809e8e931

View File

@ -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;
}