diff --git a/crates/bevy_light/src/lib.rs b/crates/bevy_light/src/lib.rs index 06dc5ac7ca3eb..15e9b3f48e62e 100644 --- a/crates/bevy_light/src/lib.rs +++ b/crates/bevy_light/src/lib.rs @@ -65,6 +65,10 @@ 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; } /// 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..39f98d448aeee 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. /// @@ -126,10 +129,7 @@ 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: 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 };