Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/bevy_light/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_light/src/point_light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/shadow_biases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERY_LARGE_CINEMA_LIGHT is 1_000_000 not 100_000_000, does this work well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, its extremely blown-out on main, seems like it was left behind during some unit change. This looks more normal

Copy link
Contributor

@DGriffin91 DGriffin91 Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like both the directional light and point light are blown out (it uses directional by default), maybe this is on purpose? With this PR the directional and point look pretty different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it was on purpose the scene wouldnt be constructed with a DirectionalLight::default added, it'd have the brightness set to match the cycler. The cycler is just from a time the units were different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really the PointLight and DirectionalLight should probably both be default, and one or the other should be Disabled by the cycler, but i dont think that works yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way or another, the PointLight and DirectionalLight match much more closely on main than in this PR. Both with the initial values on main and also the values that are used after switching.

} else {
0.0
};
Expand Down
Loading