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

LightProbe: modified constructor signature

WestLangley 6 жил өмнө
parent
commit
25237663bd

+ 1 - 1
examples/webgl_lights_lightprobe.html

@@ -104,7 +104,7 @@
 				scene.add( ambientLight );
 
 				// probe
-				lightProbe = new THREE.LightProbe( undefined, API.lightProbeIntensity );
+				lightProbe = new THREE.LightProbe( 0xffffff, API.lightProbeIntensity );
 				scene.add( lightProbe );
 
 				// light

+ 5 - 3
src/lights/LightProbe.js

@@ -10,11 +10,13 @@ import { Light } from './Light.js';
 
 // A LightProbe is a source of indirect-diffuse light
 
-function LightProbe( sh, intensity ) {
+function LightProbe( color, intensity ) {
 
-	Light.call( this, 0xffffff, intensity );
+	Light.call( this, color, intensity );
 
-	this.sh = ( sh !== undefined ) ? sh : new SphericalHarmonics3();
+	this.sh = new SphericalHarmonics3();
+
+	this.sh.coefficients[ 0 ].set( this.color.r, this.color.g, this.color.b );
 
 	this.type = 'LightProbe';