Selaa lähdekoodia

Updated examples that relied on SpotLight's exponent.

Mr.doob 9 vuotta sitten
vanhempi
commit
55c725062d

+ 1 - 2
examples/js/loaders/ColladaLoader.js

@@ -1258,7 +1258,6 @@ THREE.ColladaLoader = function () {
 				var intensity = lparams.intensity;
 				var distance = lparams.distance;
 				var angle = lparams.falloff_angle;
-				var exponent; // Intentionally undefined, don't know what this is yet
 
 				switch ( lparams.technique ) {
 
@@ -1275,7 +1274,7 @@ THREE.ColladaLoader = function () {
 
 					case 'spot':
 
-						light = new THREE.SpotLight( color, intensity, distance, angle, exponent );
+						light = new THREE.SpotLight( color, intensity, distance, angle );
 						light.position.set(0, 0, 1);
 						break;
 

+ 1 - 1
examples/js/loaders/deprecated/SceneLoader.js

@@ -345,7 +345,7 @@ THREE.SceneLoader.prototype = {
 								break;
 
 							case 'SpotLight':
-								light = new THREE.SpotLight( color, intensity, distance, 1 );
+								light = new THREE.SpotLight( color, intensity, distance );
 								light.angle = objJSON.angle;
 								light.position.fromArray( position );
 								light.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );

+ 8 - 7
examples/webgl_loader_ctm.html

@@ -99,17 +99,18 @@
 
 				// LIGHTS
 
-				var ambient = new THREE.AmbientLight( 0x080808 );
-				//scene.add( ambient );
+				var ambient = new THREE.AmbientLight( 0x040404 );
+				scene.add( ambient );
 
-				var light = new THREE.SpotLight( 0xffeedd, 1.2, 650, Math.PI/2, 3 );
+				var light = new THREE.SpotLight( 0xffeedd, 1.2, 650, Math.PI / 6 );
 				light.position.set( 0, -100, 500 );
 
 				light.castShadow = true;
-				light.shadowMapWidth = 2048;
-				light.shadowMapHeight = 2048;
-				light.shadowCameraFov = 45;
-				//light.shadowCameraVisible = true;
+				light.shadow.mapWidth = 1024;
+				light.shadow.mapHeight = 1024;
+				light.shadow.camera.fov = 45;
+				light.shadow.camera.far = 650;
+				// scene.add( new THREE.CameraHelper( light.shadow.camera ) );
 
 				scene.add( light );
 

+ 10 - 7
examples/webgl_loader_gltf.html

@@ -165,20 +165,23 @@
 					directionalLight.position.set( 0, -1, 1 ).normalize();
 					scene.add( directionalLight );
 
-					spot1	 = new THREE.SpotLight( 0xffffff, 1 );
+					spot1 = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 4, 0.75 );
 					spot1.position.set( -100, 200, 100 );
 					spot1.target.position.set( 0, 0, 0 );
 
 					if (sceneInfo.shadows) {
 
-					spot1.shadowCameraNear		= 1;
-					spot1.shadowCameraFar		= 1024;
-					spot1.castShadow			= true;
-					spot1.shadowBias = 0.0001;
-					spot1.shadowMapWidth = 2048;
-					spot1.shadowMapHeight = 2048;
+						spot1.shadowCameraNear = 1;
+						spot1.shadowCameraFar = 1024;
+						spot1.castShadow = true;
+						spot1.shadowBias = 0.0001;
+						spot1.shadowMapWidth = 2048;
+						spot1.shadowMapHeight = 2048;
+
 					}
+
 					scene.add( spot1 );
+
 				}
 
 				// RENDERER

+ 1 - 1
examples/webgl_materials_cubemap_dynamic.html

@@ -164,7 +164,7 @@
 				ambientLight = new THREE.AmbientLight( 0x555555 );
 				scene.add( ambientLight );
 
-				spotLight = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI/2, 1 );
+				spotLight = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI/2 );
 				spotLight.position.set( 0, 1800, 1500 );
 				spotLight.target.position.set( 0, 0, 0 );
 				spotLight.castShadow = true;

+ 1 - 1
examples/webgl_shading_physical.html

@@ -267,7 +267,7 @@
 				pointLight.position.set( 0, 0, 0 );
 				scene.add( pointLight );
 
-				sunLight = new THREE.SpotLight( 0xffffff, sunIntensity, 0, Math.PI/2, 1 );
+				sunLight = new THREE.SpotLight( 0xffffff, sunIntensity, 0, Math.PI/2 );
 				sunLight.position.set( 1000, 2000, 1000 );
 
 				sunLight.castShadow = true;

+ 1 - 1
examples/webgl_shadowmap.html

@@ -105,7 +105,7 @@
 				var ambient = new THREE.AmbientLight( 0x444444 );
 				scene.add( ambient );
 
-				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 2, 1 );
+				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 2 );
 				light.position.set( 0, 1500, 1000 );
 				light.target.position.set( 0, 0, 0 );
 

+ 1 - 1
examples/webgl_shadowmap_performance.html

@@ -100,7 +100,7 @@
 				var ambient = new THREE.AmbientLight( 0x444444 );
 				scene.add( ambient );
 
-				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI/2, 1 );
+				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI/2 );
 				light.position.set( 0, 1500, 1000 );
 				light.target.position.set( 0, 0, 0 );
 

+ 2 - 0
examples/webgl_shadowmap_viewer.html

@@ -72,6 +72,8 @@
 
 				spotLight = new THREE.SpotLight( 0xffffff );
 				spotLight.name = 'Spot Light';
+				spotLight.angle = Math.PI / 5;
+				spotLight.penumbra = 0.3;
 				spotLight.position.set( 10, 10, 5 );
 				spotLight.castShadow = true;
 				spotLight.shadowCameraNear = 8;