Răsfoiți Sursa

Updated examples.

Mr.doob 4 luni în urmă
părinte
comite
031167d917

+ 1 - 1
examples/jsm/environments/RoomEnvironment.js

@@ -44,7 +44,7 @@ class RoomEnvironment extends Scene {
 		const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
 		const boxMaterial = new MeshStandardMaterial();
 
-		const mainLight = new PointLight( 0xffffff, 900, 28, 2 );
+		const mainLight = new PointLight( 0xffffff, 900, 0, 2 );
 		mainLight.position.set( 0.418, 16.199, 0.300 );
 		this.add( mainLight );
 

+ 2 - 17
examples/jsm/loaders/FBXLoader.js

@@ -1206,28 +1206,13 @@ class FBXTreeParser {
 
 			}
 
-			let distance = 0;
-			if ( lightAttribute.FarAttenuationEnd !== undefined ) {
-
-				if ( lightAttribute.EnableFarAttenuation !== undefined && lightAttribute.EnableFarAttenuation.value === 0 ) {
-
-					distance = 0;
-
-				} else {
-
-					distance = lightAttribute.FarAttenuationEnd.value;
-
-				}
-
-			}
-
 			// TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?
 			const decay = 1;
 
 			switch ( type ) {
 
 				case 0: // Point
-					model = new PointLight( color, intensity, distance, decay );
+					model = new PointLight( color, intensity, 0, decay );
 					break;
 
 				case 1: // Directional
@@ -1254,7 +1239,7 @@ class FBXTreeParser {
 
 					}
 
-					model = new SpotLight( color, intensity, distance, angle, penumbra, decay );
+					model = new SpotLight( color, intensity, 0, angle, penumbra, decay );
 					break;
 
 				default:

+ 1 - 1
examples/jsm/objects/Lensflare.js

@@ -22,7 +22,7 @@ import {
  * When using {@link WebGPURenderer}, use {@link LensflareMesh}.
  *
  * ```js
- * const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
+ * const light = new THREE.PointLight( 0xffffff, 1.5 );
  *
  * const lensflare = new Lensflare();
  * lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );

+ 1 - 1
examples/jsm/objects/LensflareMesh.js

@@ -25,7 +25,7 @@ import { texture, textureLoad, uv, ivec2, vec2, vec4, positionGeometry, referenc
  * When using {@link WebGLRenderer}, use {@link Lensflare}.
  *
  * ```js
- * const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
+ * const light = new THREE.PointLight( 0xffffff, 1.5 );
  *
  * const lensflare = new LensflareMesh();
  * lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );

+ 1 - 1
examples/webgl_animation_walk.html

@@ -174,7 +174,7 @@
 				controls.floorDecale = ( size / repeat ) * 4;
 
 				const bulbGeometry = new THREE.SphereGeometry( 0.05, 16, 8 );
-				const bulbLight = new THREE.PointLight( 0xffee88, 2, 500, 2 );
+				const bulbLight = new THREE.PointLight( 0xffee88, 2, 0, 2 );
 
 				const bulbMat = new THREE.MeshStandardMaterial( { emissive: 0xffffee, emissiveIntensity: 1, color: 0x000000 } );
 				bulbLight.add( new THREE.Mesh( bulbGeometry, bulbMat ) );

+ 1 - 1
examples/webgl_lensflares.html

@@ -103,7 +103,7 @@
 
 				function addLight( h, s, l, x, y, z ) {
 
-					const light = new THREE.PointLight( 0xffffff, 1.5, 2000, 0 );
+					const light = new THREE.PointLight( 0xffffff, 1.5 );
 					light.color.setHSL( h, s, l );
 					light.position.set( x, y, z );
 					scene.add( light );

+ 1 - 1
examples/webgl_lights_physical.html

@@ -91,7 +91,7 @@
 				scene = new THREE.Scene();
 
 				const bulbGeometry = new THREE.SphereGeometry( 0.02, 16, 8 );
-				bulbLight = new THREE.PointLight( 0xffee88, 1, 100, 2 );
+				bulbLight = new THREE.PointLight( 0xffee88, 1, 0, 2 );
 
 				bulbMat = new THREE.MeshStandardMaterial( {
 					emissive: 0xffffee,

+ 2 - 2
examples/webgl_materials_subsurface_scattering.html

@@ -58,14 +58,14 @@
 			scene.add( directionalLight );
 
 			const pointLight1 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c1c1 } ) );
-			pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0, 300, 0 ) );
+			pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0 ) );
 			scene.add( pointLight1 );
 			pointLight1.position.x = 0;
 			pointLight1.position.y = - 50;
 			pointLight1.position.z = 350;
 
 			const pointLight2 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c100 } ) );
-			pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75, 500, 0 ) );
+			pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75 ) );
 			scene.add( pointLight2 );
 			pointLight2.position.x = - 100;
 			pointLight2.position.y = 20;

+ 1 - 1
examples/webgl_materials_toon.html

@@ -147,7 +147,7 @@
 
 				scene.add( new THREE.AmbientLight( 0xc1c1c1, 3 ) );
 
-				const pointLight = new THREE.PointLight( 0xffffff, 2, 800, 0 );
+				const pointLight = new THREE.PointLight( 0xffffff, 2 );
 				particleLight.add( pointLight );
 
 				//

+ 4 - 4
examples/webgl_mirror.html

@@ -162,19 +162,19 @@
 				scene.add( planeLeft );
 
 				// lights
-				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
+				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5 );
 				mainLight.position.y = 60;
 				scene.add( mainLight );
 
-				const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
+				const greenLight = new THREE.PointLight( 0x00ff00, 0.5 );
 				greenLight.position.set( 550, 50, 0 );
 				scene.add( greenLight );
 
-				const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
+				const redLight = new THREE.PointLight( 0xff0000, 0.5 );
 				redLight.position.set( - 550, 50, 0 );
 				scene.add( redLight );
 
-				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
+				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5 );
 				blueLight.position.set( 0, 50, 550 );
 				scene.add( blueLight );
 

+ 4 - 4
examples/webgl_portal.html

@@ -147,19 +147,19 @@
 				scene.add( planeLeft );
 
 				// lights
-				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
+				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5 );
 				mainLight.position.y = 60;
 				scene.add( mainLight );
 
-				const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
+				const greenLight = new THREE.PointLight( 0x00ff00, 0.5 );
 				greenLight.position.set( 550, 50, 0 );
 				scene.add( greenLight );
 
-				const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
+				const redLight = new THREE.PointLight( 0xff0000, 0.5 );
 				redLight.position.set( - 550, 50, 0 );
 				scene.add( redLight );
 
-				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
+				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5 );
 				blueLight.position.set( 0, 50, 550 );
 				scene.add( blueLight );
 

+ 1 - 1
examples/webgl_postprocessing_pixel.html

@@ -148,7 +148,7 @@
 			directionalLight.shadow.mapSize.set( 2048, 2048 );
 			scene.add( directionalLight );
 
-			const spotLight = new THREE.SpotLight( 0xffc100, 10, 10, Math.PI / 16, .02, 2 );
+			const spotLight = new THREE.SpotLight( 0xffc100, 10, 0, Math.PI / 16, .02, 2 );
 			spotLight.position.set( 2, 2, 0 );
 			const target = spotLight.target;
 			scene.add( target );

+ 4 - 4
examples/webgl_refraction.html

@@ -117,19 +117,19 @@
 				scene.add( planeLeft );
 
 				// lights
-				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
+				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5 );
 				mainLight.position.y = 60;
 				scene.add( mainLight );
 
-				const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
+				const greenLight = new THREE.PointLight( 0x00ff00, 0.5 );
 				greenLight.position.set( 550, 50, 0 );
 				scene.add( greenLight );
 
-				const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
+				const redLight = new THREE.PointLight( 0xff0000, 0.5 );
 				redLight.position.set( - 550, 50, 0 );
 				scene.add( redLight );
 
-				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
+				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5 );
 				blueLight.position.set( 0, 50, 550 );
 				scene.add( blueLight );
 

+ 1 - 1
examples/webgl_shadowmap_pointlight.html

@@ -47,7 +47,7 @@
 
 					const intensity = 200;
 
-					const light = new THREE.PointLight( color, intensity, 20 );
+					const light = new THREE.PointLight( color, intensity );
 					light.castShadow = true;
 					light.shadow.bias = - 0.005; // reduces self-shadowing on double-sided objects
 					light.shadow.mapSize.width = 128;

+ 1 - 1
examples/webgpu_lensflares.html

@@ -115,7 +115,7 @@
 
 				function addLight( h, s, l, x, y, z ) {
 
-					const light = new THREE.PointLight( 0xffffff, 1.5, 2000, 0 );
+					const light = new THREE.PointLight( 0xffffff, 1.5 );
 					light.color.setHSL( h, s, l );
 					light.position.set( x, y, z );
 					scene.add( light );

+ 1 - 1
examples/webgpu_lights_custom.html

@@ -72,7 +72,7 @@
 
 					const mesh = new THREE.Mesh( sphereGeometry, material );
 
-					const light = new THREE.PointLight( hexColor, 0.1, 1 );
+					const light = new THREE.PointLight( hexColor, 0.1 );
 					light.add( mesh );
 
 					scene.add( light );

+ 1 - 1
examples/webgpu_lights_physical.html

@@ -98,7 +98,7 @@
 				scene = new THREE.Scene();
 
 				const bulbGeometry = new THREE.SphereGeometry( 0.02, 16, 8 );
-				bulbLight = new THREE.PointLight( 0xffee88, 1, 100, 2 );
+				bulbLight = new THREE.PointLight( 0xffee88, 1, 0, 2 );
 
 				bulbMat = new THREE.MeshStandardMaterial( {
 					emissive: 0xffffee,

+ 2 - 2
examples/webgpu_materials_sss.html

@@ -69,14 +69,14 @@
 				scene.add( directionalLight );
 
 				const pointLight1 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c1c1 } ) );
-				pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0, 300, 0 ) );
+				pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0 ) );
 				scene.add( pointLight1 );
 				pointLight1.position.x = 0;
 				pointLight1.position.y = - 50;
 				pointLight1.position.z = 350;
 
 				const pointLight2 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c100 } ) );
-				pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75, 500, 0 ) );
+				pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75 ) );
 				scene.add( pointLight2 );
 				pointLight2.position.x = - 100;
 				pointLight2.position.y = 20;

+ 1 - 1
examples/webgpu_materials_toon.html

@@ -168,7 +168,7 @@
 
 				scene.add( new THREE.AmbientLight( 0xc1c1c1, 3 ) );
 
-				const pointLight = new THREE.PointLight( 0xffffff, 2, 800, 0 );
+				const pointLight = new THREE.PointLight( 0xffffff, 2 );
 				particleLight.add( pointLight );
 
 				//

+ 4 - 4
examples/webgpu_mirror.html

@@ -162,19 +162,19 @@
 
 				// lights
 
-				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
+				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5 );
 				mainLight.position.y = 60;
 				scene.add( mainLight );
 
-				const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
+				const greenLight = new THREE.PointLight( 0x00ff00, 0.5 );
 				greenLight.position.set( 550, 50, 0 );
 				scene.add( greenLight );
 
-				const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
+				const redLight = new THREE.PointLight( 0xff0000, 0.5 );
 				redLight.position.set( - 550, 50, 0 );
 				scene.add( redLight );
 
-				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
+				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5 );
 				blueLight.position.set( 0, 50, 550 );
 				scene.add( blueLight );
 

+ 1 - 1
examples/webgpu_postprocessing_pixel.html

@@ -122,7 +122,7 @@
 			directionalLight.shadow.bias = - 0.0001;
 			scene.add( directionalLight );
 
-			const spotLight = new THREE.SpotLight( 0xffc100, 10, 10, Math.PI / 16, .02, 2 );
+			const spotLight = new THREE.SpotLight( 0xffc100, 10, 0, Math.PI / 16, .02, 2 );
 			spotLight.position.set( 2, 2, 0 );
 			const target = spotLight.target;
 			scene.add( target );

+ 4 - 4
examples/webgpu_refraction.html

@@ -119,19 +119,19 @@
 
 				// lights
 
-				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
+				const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5 );
 				mainLight.position.y = 60;
 				scene.add( mainLight );
 
-				const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
+				const greenLight = new THREE.PointLight( 0x00ff00, 0.5 );
 				greenLight.position.set( 550, 50, 0 );
 				scene.add( greenLight );
 
-				const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
+				const redLight = new THREE.PointLight( 0xff0000, 0.5 );
 				redLight.position.set( - 550, 50, 0 );
 				scene.add( redLight );
 
-				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
+				const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5 );
 				blueLight.position.set( 0, 50, 550 );
 				scene.add( blueLight );
 

+ 1 - 1
examples/webgpu_shadowmap_pointlight.html

@@ -47,7 +47,7 @@
 
 					const intensity = 200;
 
-					const light = new THREE.PointLight( color, intensity, 20 );
+					const light = new THREE.PointLight( color, intensity );
 					light.castShadow = true;
 					light.shadow.bias = - 0.005; // reduces self-shadowing on double-sided objects
 					light.shadow.mapSize.width = 128;

+ 1 - 1
examples/webgpu_skinning.html

@@ -57,7 +57,7 @@
 
 				//lights
 
-				const light = new THREE.PointLight( 0xffffff, 1, 100 );
+				const light = new THREE.PointLight( 0xffffff, 1 );
 				light.power = 2500;
 				camera.add( light );
 				scene.add( camera );

+ 2 - 2
examples/webgpu_skinning_instancing.html

@@ -58,13 +58,13 @@
 
 				// lights
 
-				const centerLight = new THREE.PointLight( 0xff9900, 1, 100 );
+				const centerLight = new THREE.PointLight( 0xff9900, 1 );
 				centerLight.position.y = 4.5;
 				centerLight.position.z = - 2;
 				centerLight.power = 400;
 				scene.add( centerLight );
 
-				const cameraLight = new THREE.PointLight( 0x0099ff, 1, 100 );
+				const cameraLight = new THREE.PointLight( 0x0099ff, 1 );
 				cameraLight.power = 400;
 				camera.add( cameraLight );
 				scene.add( camera );

+ 1 - 1
examples/webgpu_volume_lighting.html

@@ -166,7 +166,7 @@
 
 				// Lights
 
-				pointLight = new THREE.PointLight( 0xf9bb50, 3, 100 );
+				pointLight = new THREE.PointLight( 0xf9bb50, 3 );
 				pointLight.castShadow = true;
 				pointLight.position.set( 0, 1.4, 0 );
 				pointLight.layers.enable( LAYER_VOLUMETRIC_LIGHTING );

粤ICP备19079148号