|
@@ -18,16 +18,15 @@ class PointLight extends Light {
|
|
|
|
|
|
get power() {
|
|
|
|
|
|
- // intensity = power per solid angle.
|
|
|
- // ref: equation (15) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
|
|
|
+ // compute the light's luminous power (in lumens) from its intensity (in candela)
|
|
|
+ // for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)
|
|
|
return this.intensity * 4 * Math.PI;
|
|
|
|
|
|
}
|
|
|
|
|
|
set power( power ) {
|
|
|
|
|
|
- // intensity = power per solid angle.
|
|
|
- // ref: equation (15) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
|
|
|
+ // set the light's intensity (in candela) from the desired luminous power (in lumens)
|
|
|
this.intensity = power / ( 4 * Math.PI );
|
|
|
|
|
|
}
|