Skip to content

Commit aeec8e2

Browse files
committed
Fix bug in light_probe_blending, and address review comment
1 parent f6378ca commit aeec8e2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

crates/bevy_light/src/cluster/assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ pub(crate) fn assign_objects_to_clusters(
526526

527527
let mut update_from_object_intersections =
528528
|visible_clusterable_objects: &mut VisibleClusterableObjects| {
529-
for clusterable_object in &mut clusterable_objects {
529+
for clusterable_object in &clusterable_objects {
530530
// check if the clusterable light layers overlap the view layers
531531
if !view_layers.intersects(&clusterable_object.render_layers) {
532532
continue;

crates/bevy_pbr/src/cluster.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bevy_camera::Camera;
44
use bevy_ecs::{entity::EntityHashMap, prelude::*};
55
use bevy_light::{
66
cluster::{ClusterableObjectCounts, Clusters, GlobalClusterSettings},
7-
ClusteredDecal, EnvironmentMapLight, IrradianceVolume, LightProbe, PointLight, SpotLight,
7+
ClusteredDecal, EnvironmentMapLight, IrradianceVolume, PointLight, SpotLight,
88
};
99
use bevy_math::{uvec4, UVec3, UVec4, Vec4};
1010
use bevy_render::{
@@ -296,14 +296,17 @@ pub fn extract_clusters(
296296
Query<
297297
(
298298
Option<&RenderEntity>,
299+
Has<PointLight>,
300+
Has<SpotLight>,
299301
Has<EnvironmentMapLight>,
300302
Has<IrradianceVolume>,
301303
Has<ClusteredDecal>,
302304
),
303305
Or<(
304306
With<PointLight>,
305307
With<SpotLight>,
306-
With<LightProbe>,
308+
With<EnvironmentMapLight>,
309+
With<IrradianceVolume>,
307310
With<ClusteredDecal>,
308311
)>,
309312
>,
@@ -326,6 +329,8 @@ pub fn extract_clusters(
326329
for clusterable_entity in cluster_objects.iter() {
327330
let Ok((
328331
maybe_render_entity,
332+
is_point_light,
333+
is_spot_light,
329334
is_reflection_probe,
330335
is_irradiance_volume,
331336
is_clustered_decal,
@@ -341,7 +346,7 @@ pub fn extract_clusters(
341346
if let Some(render_entity) = maybe_render_entity {
342347
if is_clustered_decal {
343348
data.push(ExtractedClusterableObjectElement::Decal(**render_entity));
344-
} else {
349+
} else if is_point_light || is_spot_light {
345350
data.push(ExtractedClusterableObjectElement::Light(**render_entity));
346351
}
347352
}

0 commit comments

Comments
 (0)