فهرست منبع

fix examples broken by lightShadow change

supereggbert 6 سال پیش
والد
کامیت
aa4b0c845d
2فایلهای تغییر یافته به همراه6 افزوده شده و 7 حذف شده
  1. 3 3
      examples/webgl_shadowmap.html
  2. 3 4
      examples/webgl_shadowmap_performance.html

+ 3 - 3
examples/webgl_shadowmap.html

@@ -79,13 +79,13 @@
 				var ambient = new THREE.AmbientLight( 0x444444 );
 				scene.add( ambient );
 
-				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 2 );
+				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 5, 0.3 );
 				light.position.set( 0, 1500, 1000 );
 				light.target.position.set( 0, 0, 0 );
 
 				light.castShadow = true;
-
-				light.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 50, 1, 1200, 2500 ) );
+				light.shadow.camera.near = 1200;
+				light.shadow.camera.far = 2500;
 				light.shadow.bias = 0.0001;
 
 				light.shadow.mapSize.width = SHADOW_MAP_WIDTH;

+ 3 - 4
examples/webgl_shadowmap_performance.html

@@ -76,14 +76,13 @@
 				var ambient = new THREE.AmbientLight( 0x444444 );
 				scene.add( ambient );
 
-				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 2 );
+				light = new THREE.SpotLight( 0xffffff, 1, 0, Math.PI / 5, 0.3 );
 				light.position.set( 0, 1500, 1000 );
 				light.target.position.set( 0, 0, 0 );
 
 				light.castShadow = true;
-
-				light.shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 50, 1, 700, FAR ) );
-
+				light.shadow.camera.near = 1200;
+				light.shadow.camera.far = 2500;
 				light.shadow.bias = 0.0001;
 
 				light.shadow.mapSize.width = SHADOW_MAP_WIDTH;