浏览代码

Updated builds.

Mugen87 2 年之前
父节点
当前提交
7937acfccf
共有 5 个文件被更改,包括 78 次插入60 次删除
  1. 26 20
      build/three.cjs
  2. 26 20
      build/three.js
  3. 0 0
      build/three.min.js
  4. 26 20
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 26 - 20
build/three.cjs

@@ -17819,11 +17819,31 @@ function WebGLObjects( gl, geometries, attributes, info ) {
 
 			}
 
-			attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
+			if ( updateMap.get( object ) !== frame ) {
 
-			if ( object.instanceColor !== null ) {
+				attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
 
-				attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+				if ( object.instanceColor !== null ) {
+
+					attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+
+				}
+
+				updateMap.set( object, frame );
+
+			}
+
+		}
+
+		if ( object.isSkinnedMesh ) {
+
+			const skeleton = object.skeleton;
+
+			if ( updateMap.get( skeleton ) !== frame ) {
+
+				skeleton.update();
+
+				updateMap.set( skeleton, frame );
 
 			}
 
@@ -28148,7 +28168,7 @@ class WebGLRenderer {
 
 			}
 
-			if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+			if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
 
 				console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
 
@@ -28948,6 +28968,8 @@ class WebGLRenderer {
 
 			//
 
+			this.info.render.frame ++;
+
 			if ( _clippingEnabled === true ) clipping.beginShadows();
 
 			const shadowsArray = currentRenderState.state.shadowsArray;
@@ -28960,7 +28982,6 @@ class WebGLRenderer {
 
 			if ( this.info.autoReset === true ) this.info.reset();
 
-			this.info.render.frame ++;
 
 			//
 
@@ -29090,19 +29111,6 @@ class WebGLRenderer {
 
 					if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
 
-						if ( object.isSkinnedMesh ) {
-
-							// update skeleton only once in a frame
-
-							if ( object.skeleton.frame !== info.render.frame ) {
-
-								object.skeleton.update();
-								object.skeleton.frame = info.render.frame;
-
-							}
-
-						}
-
 						const geometry = objects.update( object );
 						const material = object.material;
 
@@ -31633,8 +31641,6 @@ class Skeleton {
 		this.boneTexture = null;
 		this.boneTextureSize = 0;
 
-		this.frame = - 1;
-
 		this.init();
 
 	}

+ 26 - 20
build/three.js

@@ -17824,11 +17824,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				}
 
-				attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
+				if ( updateMap.get( object ) !== frame ) {
 
-				if ( object.instanceColor !== null ) {
+					attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
 
-					attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+					if ( object.instanceColor !== null ) {
+
+						attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+
+					}
+
+					updateMap.set( object, frame );
+
+				}
+
+			}
+
+			if ( object.isSkinnedMesh ) {
+
+				const skeleton = object.skeleton;
+
+				if ( updateMap.get( skeleton ) !== frame ) {
+
+					skeleton.update();
+
+					updateMap.set( skeleton, frame );
 
 				}
 
@@ -28153,7 +28173,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				}
 
-				if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+				if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
 
 					console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
 
@@ -28953,6 +28973,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				//
 
+				this.info.render.frame ++;
+
 				if ( _clippingEnabled === true ) clipping.beginShadows();
 
 				const shadowsArray = currentRenderState.state.shadowsArray;
@@ -28965,7 +28987,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				if ( this.info.autoReset === true ) this.info.reset();
 
-				this.info.render.frame ++;
 
 				//
 
@@ -29095,19 +29116,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 						if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
 
-							if ( object.isSkinnedMesh ) {
-
-								// update skeleton only once in a frame
-
-								if ( object.skeleton.frame !== info.render.frame ) {
-
-									object.skeleton.update();
-									object.skeleton.frame = info.render.frame;
-
-								}
-
-							}
-
 							const geometry = objects.update( object );
 							const material = object.material;
 
@@ -31638,8 +31646,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			this.boneTexture = null;
 			this.boneTextureSize = 0;
 
-			this.frame = - 1;
-
 			this.init();
 
 		}

文件差异内容过多而无法显示
+ 0 - 0
build/three.min.js


+ 26 - 20
build/three.module.js

@@ -17817,11 +17817,31 @@ function WebGLObjects( gl, geometries, attributes, info ) {
 
 			}
 
-			attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
+			if ( updateMap.get( object ) !== frame ) {
 
-			if ( object.instanceColor !== null ) {
+				attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
 
-				attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+				if ( object.instanceColor !== null ) {
+
+					attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
+
+				}
+
+				updateMap.set( object, frame );
+
+			}
+
+		}
+
+		if ( object.isSkinnedMesh ) {
+
+			const skeleton = object.skeleton;
+
+			if ( updateMap.get( skeleton ) !== frame ) {
+
+				skeleton.update();
+
+				updateMap.set( skeleton, frame );
 
 			}
 
@@ -28146,7 +28166,7 @@ class WebGLRenderer {
 
 			}
 
-			if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+			if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
 
 				console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
 
@@ -28946,6 +28966,8 @@ class WebGLRenderer {
 
 			//
 
+			this.info.render.frame ++;
+
 			if ( _clippingEnabled === true ) clipping.beginShadows();
 
 			const shadowsArray = currentRenderState.state.shadowsArray;
@@ -28958,7 +28980,6 @@ class WebGLRenderer {
 
 			if ( this.info.autoReset === true ) this.info.reset();
 
-			this.info.render.frame ++;
 
 			//
 
@@ -29088,19 +29109,6 @@ class WebGLRenderer {
 
 					if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
 
-						if ( object.isSkinnedMesh ) {
-
-							// update skeleton only once in a frame
-
-							if ( object.skeleton.frame !== info.render.frame ) {
-
-								object.skeleton.update();
-								object.skeleton.frame = info.render.frame;
-
-							}
-
-						}
-
 						const geometry = objects.update( object );
 						const material = object.material;
 
@@ -31631,8 +31639,6 @@ class Skeleton {
 		this.boneTexture = null;
 		this.boneTextureSize = 0;
 
-		this.frame = - 1;
-
 		this.init();
 
 	}

文件差异内容过多而无法显示
+ 0 - 0
build/three.module.min.js


部分文件因为文件数量过多而无法显示