From 0128cf58644b61b75f5a346717392362e95d0994 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Thu, 31 Jul 2025 21:16:27 -0400 Subject: [PATCH 1/2] Add light_consts::lumens::VERY_LARGE_CINEMA_LIGHT --- crates/bevy_light/src/lib.rs | 1 + crates/bevy_light/src/point_light.rs | 7 +++++-- examples/3d/shadow_biases.rs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/bevy_light/src/lib.rs b/crates/bevy_light/src/lib.rs index 06dc5ac7ca3eb..3e77dba4d030c 100644 --- a/crates/bevy_light/src/lib.rs +++ b/crates/bevy_light/src/lib.rs @@ -65,6 +65,7 @@ pub mod light_consts { pub const LUMENS_PER_LED_WATTS: f32 = 90.0; pub const LUMENS_PER_INCANDESCENT_WATTS: f32 = 13.8; pub const LUMENS_PER_HALOGEN_WATTS: f32 = 19.8; + pub const VERY_LARGE_CINEMA_LIGHT: f32 = 1_000_000.0; } /// Predefined for lux values in several locations. diff --git a/crates/bevy_light/src/point_light.rs b/crates/bevy_light/src/point_light.rs index f37a386200417..9fa3f0dab46ea 100644 --- a/crates/bevy_light/src/point_light.rs +++ b/crates/bevy_light/src/point_light.rs @@ -10,7 +10,10 @@ use bevy_math::Mat4; use bevy_reflect::prelude::*; use bevy_transform::components::{GlobalTransform, Transform}; -use crate::cluster::{ClusterVisibilityClass, GlobalVisibleClusterableObjects}; +use crate::{ + cluster::{ClusterVisibilityClass, GlobalVisibleClusterableObjects}, + light_consts, +}; /// A light that emits light in all directions from a central point. /// @@ -129,7 +132,7 @@ impl Default for PointLight { // 1,000,000 lumens is a very large "cinema light" capable of registering brightly at Bevy's // default "very overcast day" exposure level. For "indoor lighting" with a lower exposure, // this would be way too bright. - intensity: 1_000_000.0, + intensity: light_consts::lumens::VERY_LARGE_CINEMA_LIGHT, range: 20.0, radius: 0.0, shadows_enabled: false, diff --git a/examples/3d/shadow_biases.rs b/examples/3d/shadow_biases.rs index afd469affff54..46b70a254a3ef 100644 --- a/examples/3d/shadow_biases.rs +++ b/examples/3d/shadow_biases.rs @@ -152,7 +152,7 @@ fn toggle_light( for mut light in &mut point_lights { light.intensity = if light.intensity == 0.0 { *writer.text(*example_text, 4) = "PointLight".to_string(); - 100000000.0 + light_consts::lumens::VERY_LARGE_CINEMA_LIGHT } else { 0.0 }; From fcf010f0cfd02b75ccc91d61c0aa171f5d661c65 Mon Sep 17 00:00:00 2001 From: atlv Date: Fri, 1 Aug 2025 09:59:07 -0700 Subject: [PATCH 2/2] move doc comment --- crates/bevy_light/src/lib.rs | 3 +++ crates/bevy_light/src/point_light.rs | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_light/src/lib.rs b/crates/bevy_light/src/lib.rs index 3e77dba4d030c..15e9b3f48e62e 100644 --- a/crates/bevy_light/src/lib.rs +++ b/crates/bevy_light/src/lib.rs @@ -65,6 +65,9 @@ pub mod light_consts { pub const LUMENS_PER_LED_WATTS: f32 = 90.0; pub const LUMENS_PER_INCANDESCENT_WATTS: f32 = 13.8; pub const LUMENS_PER_HALOGEN_WATTS: f32 = 19.8; + /// 1,000,000 lumens is a very large "cinema light" capable of registering brightly at Bevy's + /// default "very overcast day" exposure level. For "indoor lighting" with a lower exposure, + /// this would be way too bright. pub const VERY_LARGE_CINEMA_LIGHT: f32 = 1_000_000.0; } diff --git a/crates/bevy_light/src/point_light.rs b/crates/bevy_light/src/point_light.rs index 9fa3f0dab46ea..39f98d448aeee 100644 --- a/crates/bevy_light/src/point_light.rs +++ b/crates/bevy_light/src/point_light.rs @@ -129,9 +129,6 @@ impl Default for PointLight { fn default() -> Self { PointLight { color: Color::WHITE, - // 1,000,000 lumens is a very large "cinema light" capable of registering brightly at Bevy's - // default "very overcast day" exposure level. For "indoor lighting" with a lower exposure, - // this would be way too bright. intensity: light_consts::lumens::VERY_LARGE_CINEMA_LIGHT, range: 20.0, radius: 0.0,