From 55c725062d1a3e9599384d51cd21a5de47007d30 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Mon, 8 Feb 2016 12:51:10 +0900 Subject: [PATCH] Updated examples that relied on SpotLight's exponent. --- examples/js/loaders/ColladaLoader.js | 3 +-- examples/js/loaders/deprecated/SceneLoader.js | 2 +- examples/webgl_loader_ctm.html | 15 ++++++++------- examples/webgl_loader_gltf.html | 17 ++++++++++------- examples/webgl_materials_cubemap_dynamic.html | 2 +- examples/webgl_shading_physical.html | 2 +- examples/webgl_shadowmap.html | 2 +- examples/webgl_shadowmap_performance.html | 2 +- examples/webgl_shadowmap_viewer.html | 2 ++ 9 files changed, 26 insertions(+), 21 deletions(-) diff --git a/examples/js/loaders/ColladaLoader.js b/examples/js/loaders/ColladaLoader.js index a2ae582493..4d53d342ba 100644 --- a/examples/js/loaders/ColladaLoader.js +++ b/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; diff --git a/examples/js/loaders/deprecated/SceneLoader.js b/examples/js/loaders/deprecated/SceneLoader.js index 48cc780a64..0fe42b5394 100644 --- a/examples/js/loaders/deprecated/SceneLoader.js +++ b/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 ] ); diff --git a/examples/webgl_loader_ctm.html b/examples/webgl_loader_ctm.html index 6047297740..449e251fb0 100644 --- a/examples/webgl_loader_ctm.html +++ b/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 ); diff --git a/examples/webgl_loader_gltf.html b/examples/webgl_loader_gltf.html index a9d31c152f..70f3f3389a 100644 --- a/examples/webgl_loader_gltf.html +++ b/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 diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index ba38b8965d..2de840a6fd 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/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; diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index 108d8f7f8c..e8286d34a3 100644 --- a/examples/webgl_shading_physical.html +++ b/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; diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index 72cbba3619..d7b4c1d540 100644 --- a/examples/webgl_shadowmap.html +++ b/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 ); diff --git a/examples/webgl_shadowmap_performance.html b/examples/webgl_shadowmap_performance.html index 7007c90d43..e4d49adf00 100644 --- a/examples/webgl_shadowmap_performance.html +++ b/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 ); diff --git a/examples/webgl_shadowmap_viewer.html b/examples/webgl_shadowmap_viewer.html index 6721503c13..97d4950cf9 100644 --- a/examples/webgl_shadowmap_viewer.html +++ b/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; -- GitLab