فهرست منبع

Update builds.

Mugen87 5 سال پیش
والد
کامیت
e98a8fb1b8
3فایلهای تغییر یافته به همراه200 افزوده شده و 198 حذف شده
  1. 22 20
      build/three.js
  2. 156 158
      build/three.min.js
  3. 22 20
      build/three.module.js

+ 22 - 20
build/three.js

@@ -2173,9 +2173,11 @@
 
 
 		angleTo: function ( v ) {
 		angleTo: function ( v ) {
 
 
-			// assumes this and v are not the zero vector
+			var denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );
 
 
-			var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );
+			if ( denominator === 0 ) { console.error( 'THREE.Vector3: angleTo() can\'t handle zero length vectors.' ); }
+
+			var theta = this.dot( v ) / denominator;
 
 
 			// clamp, to handle numerical problems
 			// clamp, to handle numerical problems
 
 
@@ -8312,7 +8314,6 @@
 		this.type = 'Material';
 		this.type = 'Material';
 
 
 		this.fog = true;
 		this.fog = true;
-		this.lights = true;
 
 
 		this.blending = NormalBlending;
 		this.blending = NormalBlending;
 		this.side = FrontSide;
 		this.side = FrontSide;
@@ -8636,7 +8637,6 @@
 			this.name = source.name;
 			this.name = source.name;
 
 
 			this.fog = source.fog;
 			this.fog = source.fog;
-			this.lights = source.lights;
 
 
 			this.blending = source.blending;
 			this.blending = source.blending;
 			this.side = source.side;
 			this.side = source.side;
@@ -8785,8 +8785,6 @@
 		this.skinning = false;
 		this.skinning = false;
 		this.morphTargets = false;
 		this.morphTargets = false;
 
 
-		this.lights = false;
-
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
 	}
 	}
@@ -19319,7 +19317,6 @@
 		this.wireframeLinewidth = 1;
 		this.wireframeLinewidth = 1;
 
 
 		this.fog = false;
 		this.fog = false;
-		this.lights = false;
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
@@ -19399,7 +19396,6 @@
 		this.displacementBias = 0;
 		this.displacementBias = 0;
 
 
 		this.fog = false;
 		this.fog = false;
-		this.lights = false;
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
@@ -23059,6 +23055,8 @@
 
 
 		var session = null;
 		var session = null;
 
 
+		// var framebufferScaleFactor = 1.0;
+
 		var referenceSpace = null;
 		var referenceSpace = null;
 		var referenceSpaceType = 'local-floor';
 		var referenceSpaceType = 'local-floor';
 
 
@@ -23146,7 +23144,9 @@
 
 
 		}
 		}
 
 
-		this.setFramebufferScaleFactor = function ( value ) {
+		this.setFramebufferScaleFactor = function ( /* value */ ) {
+
+			// framebufferScaleFactor = value;
 
 
 		};
 		};
 
 
@@ -23173,6 +23173,7 @@
 				session.addEventListener( 'selectend', onSessionEvent );
 				session.addEventListener( 'selectend', onSessionEvent );
 				session.addEventListener( 'end', onSessionEnd );
 				session.addEventListener( 'end', onSessionEnd );
 
 
+				// eslint-disable-next-line no-undef
 				session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } );
 				session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } );
 
 
 				session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
 				session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
@@ -24938,9 +24939,10 @@
 
 
 			// store the light setup it was created for
 			// store the light setup it was created for
 
 
+			materialProperties.needsLights = materialNeedsLights( material );
 			materialProperties.lightsStateVersion = lightsStateVersion;
 			materialProperties.lightsStateVersion = lightsStateVersion;
 
 
-			if ( material.lights ) {
+			if ( materialProperties.needsLights ) {
 
 
 				// wire up the material to this renderer's lighting state
 				// wire up the material to this renderer's lighting state
 
 
@@ -25006,7 +25008,7 @@
 
 
 					material.needsUpdate = true;
 					material.needsUpdate = true;
 
 
-				} else if ( material.lights && materialProperties.lightsStateVersion !== lights.state.version ) {
+				} else if ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {
 
 
 					material.needsUpdate = true;
 					material.needsUpdate = true;
 
 
@@ -25190,7 +25192,7 @@
 				p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
 				p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
 				p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 				p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 
 
-				if ( material.lights ) {
+				if ( materialProperties.needsLights ) {
 
 
 					// the current material requires lighting info
 					// the current material requires lighting info
 
 
@@ -25797,6 +25799,14 @@
 
 
 		}
 		}
 
 
+		function materialNeedsLights( material ) {
+
+			return material.isMeshLambertMaterial || material.isMeshPhongMaterial ||
+				material.isMeshStandardMaterial || material.isShadowMaterial ||
+				( material.isShaderMaterial && material.lights === true );
+
+		}
+
 		//
 		//
 		this.setFramebuffer = function ( value ) {
 		this.setFramebuffer = function ( value ) {
 
 
@@ -26340,7 +26350,6 @@
 
 
 		this.sizeAttenuation = true;
 		this.sizeAttenuation = true;
 
 
-		this.lights = false;
 		this.transparent = true;
 		this.transparent = true;
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
@@ -27080,8 +27089,6 @@
 		this.linecap = 'round';
 		this.linecap = 'round';
 		this.linejoin = 'round';
 		this.linejoin = 'round';
 
 
-		this.lights = false;
-
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
 	}
 	}
@@ -27467,8 +27474,6 @@
 
 
 		this.morphTargets = false;
 		this.morphTargets = false;
 
 
-		this.lights = false;
-
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
 	}
 	}
@@ -32874,7 +32879,6 @@
 		this.wireframeLinewidth = 1;
 		this.wireframeLinewidth = 1;
 
 
 		this.fog = false;
 		this.fog = false;
-		this.lights = false;
 
 
 		this.skinning = false;
 		this.skinning = false;
 		this.morphTargets = false;
 		this.morphTargets = false;
@@ -33101,8 +33105,6 @@
 		this.morphTargets = false;
 		this.morphTargets = false;
 		this.morphNormals = false;
 		this.morphNormals = false;
 
 
-		this.lights = false;
-
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 
 	}
 	}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 156 - 158
build/three.min.js


+ 22 - 20
build/three.module.js

@@ -2167,9 +2167,11 @@ Object.assign( Vector3.prototype, {
 
 
 	angleTo: function ( v ) {
 	angleTo: function ( v ) {
 
 
-		// assumes this and v are not the zero vector
+		var denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );
 
 
-		var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );
+		if ( denominator === 0 ) console.error( 'THREE.Vector3: angleTo() can\'t handle zero length vectors.' );
+
+		var theta = this.dot( v ) / denominator;
 
 
 		// clamp, to handle numerical problems
 		// clamp, to handle numerical problems
 
 
@@ -8306,7 +8308,6 @@ function Material() {
 	this.type = 'Material';
 	this.type = 'Material';
 
 
 	this.fog = true;
 	this.fog = true;
-	this.lights = true;
 
 
 	this.blending = NormalBlending;
 	this.blending = NormalBlending;
 	this.side = FrontSide;
 	this.side = FrontSide;
@@ -8630,7 +8631,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		this.name = source.name;
 		this.name = source.name;
 
 
 		this.fog = source.fog;
 		this.fog = source.fog;
-		this.lights = source.lights;
 
 
 		this.blending = source.blending;
 		this.blending = source.blending;
 		this.side = source.side;
 		this.side = source.side;
@@ -8779,8 +8779,6 @@ function MeshBasicMaterial( parameters ) {
 	this.skinning = false;
 	this.skinning = false;
 	this.morphTargets = false;
 	this.morphTargets = false;
 
 
-	this.lights = false;
-
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
 }
 }
@@ -19306,7 +19304,6 @@ function MeshDepthMaterial( parameters ) {
 	this.wireframeLinewidth = 1;
 	this.wireframeLinewidth = 1;
 
 
 	this.fog = false;
 	this.fog = false;
-	this.lights = false;
 
 
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
@@ -19386,7 +19383,6 @@ function MeshDistanceMaterial( parameters ) {
 	this.displacementBias = 0;
 	this.displacementBias = 0;
 
 
 	this.fog = false;
 	this.fog = false;
-	this.lights = false;
 
 
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
@@ -23046,6 +23042,8 @@ function WebXRManager( renderer, gl ) {
 
 
 	var session = null;
 	var session = null;
 
 
+	// var framebufferScaleFactor = 1.0;
+
 	var referenceSpace = null;
 	var referenceSpace = null;
 	var referenceSpaceType = 'local-floor';
 	var referenceSpaceType = 'local-floor';
 
 
@@ -23133,7 +23131,9 @@ function WebXRManager( renderer, gl ) {
 
 
 	}
 	}
 
 
-	this.setFramebufferScaleFactor = function ( value ) {
+	this.setFramebufferScaleFactor = function ( /* value */ ) {
+
+		// framebufferScaleFactor = value;
 
 
 	};
 	};
 
 
@@ -23160,6 +23160,7 @@ function WebXRManager( renderer, gl ) {
 			session.addEventListener( 'selectend', onSessionEvent );
 			session.addEventListener( 'selectend', onSessionEvent );
 			session.addEventListener( 'end', onSessionEnd );
 			session.addEventListener( 'end', onSessionEnd );
 
 
+			// eslint-disable-next-line no-undef
 			session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } );
 			session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } );
 
 
 			session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
 			session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
@@ -24925,9 +24926,10 @@ function WebGLRenderer( parameters ) {
 
 
 		// store the light setup it was created for
 		// store the light setup it was created for
 
 
+		materialProperties.needsLights = materialNeedsLights( material );
 		materialProperties.lightsStateVersion = lightsStateVersion;
 		materialProperties.lightsStateVersion = lightsStateVersion;
 
 
-		if ( material.lights ) {
+		if ( materialProperties.needsLights ) {
 
 
 			// wire up the material to this renderer's lighting state
 			// wire up the material to this renderer's lighting state
 
 
@@ -24993,7 +24995,7 @@ function WebGLRenderer( parameters ) {
 
 
 				material.needsUpdate = true;
 				material.needsUpdate = true;
 
 
-			} else if ( material.lights && materialProperties.lightsStateVersion !== lights.state.version ) {
+			} else if ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {
 
 
 				material.needsUpdate = true;
 				material.needsUpdate = true;
 
 
@@ -25177,7 +25179,7 @@ function WebGLRenderer( parameters ) {
 			p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
 			p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
 			p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 			p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 
 
-			if ( material.lights ) {
+			if ( materialProperties.needsLights ) {
 
 
 				// the current material requires lighting info
 				// the current material requires lighting info
 
 
@@ -25784,6 +25786,14 @@ function WebGLRenderer( parameters ) {
 
 
 	}
 	}
 
 
+	function materialNeedsLights( material ) {
+
+		return material.isMeshLambertMaterial || material.isMeshPhongMaterial ||
+			material.isMeshStandardMaterial || material.isShadowMaterial ||
+			( material.isShaderMaterial && material.lights === true );
+
+	}
+
 	//
 	//
 	this.setFramebuffer = function ( value ) {
 	this.setFramebuffer = function ( value ) {
 
 
@@ -26327,7 +26337,6 @@ function SpriteMaterial( parameters ) {
 
 
 	this.sizeAttenuation = true;
 	this.sizeAttenuation = true;
 
 
-	this.lights = false;
 	this.transparent = true;
 	this.transparent = true;
 
 
 	this.setValues( parameters );
 	this.setValues( parameters );
@@ -27067,8 +27076,6 @@ function LineBasicMaterial( parameters ) {
 	this.linecap = 'round';
 	this.linecap = 'round';
 	this.linejoin = 'round';
 	this.linejoin = 'round';
 
 
-	this.lights = false;
-
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
 }
 }
@@ -27454,8 +27461,6 @@ function PointsMaterial( parameters ) {
 
 
 	this.morphTargets = false;
 	this.morphTargets = false;
 
 
-	this.lights = false;
-
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
 }
 }
@@ -32861,7 +32866,6 @@ function MeshNormalMaterial( parameters ) {
 	this.wireframeLinewidth = 1;
 	this.wireframeLinewidth = 1;
 
 
 	this.fog = false;
 	this.fog = false;
-	this.lights = false;
 
 
 	this.skinning = false;
 	this.skinning = false;
 	this.morphTargets = false;
 	this.morphTargets = false;
@@ -33088,8 +33092,6 @@ function MeshMatcapMaterial( parameters ) {
 	this.morphTargets = false;
 	this.morphTargets = false;
 	this.morphNormals = false;
 	this.morphNormals = false;
 
 
-	this.lights = false;
-
 	this.setValues( parameters );
 	this.setValues( parameters );
 
 
 }
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است