Skip to content

Commit

Permalink
add comment on spotlight intensity divisor
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Jun 26, 2022
1 parent 612813a commit d8c362c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_pbr/src/render/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ pub fn extract_lights(
// NOTE: Map from luminous power in lumens to luminous intensity in lumens per steradian
// for a point light. See https://google.github.io/filament/Filament.html#mjx-eqn-pointLightLuminousPower
// for details.
// Note: Filament uses a divisor of PI for spotlights. We choose to use the same 4*PI divisor
// in both cases so that toggling between point light and spotlight keeps lit areas lit equally,
// which seems least surprising for users
intensity: point_light.intensity / (4.0 * std::f32::consts::PI),
range: point_light.range,
radius: point_light.radius,
Expand Down

0 comments on commit d8c362c

Please sign in to comment.