2
0
Эх сурвалжийг харах

adopt convert between power - intensity for SpotLight used by Frostbite 3.

Ben Houston 9 жил өмнө
parent
commit
e0657dd8fb

+ 4 - 4
src/lights/SpotLight.js

@@ -30,15 +30,15 @@ Object.defineProperty(THREE.SpotLight.prototype, "power", {
   get: function() {
 
 		// intensity = power per solid angle.
-		// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf
-		return this.intensity * 4 * Math.PI;
+		// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf
+		return this.intensity * Math.PI;
 
   },
 	set: function( power ) {
 
 		// intensity = power per solid angle.
-		// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf
-		this.intensity = power / ( 4 * Math.PI );
+		// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf
+		this.intensity = power / Math.PI;
 
 	}