Bladeren bron

Updated builds.

Mugen87 2 jaren geleden
bovenliggende
commit
9e2b9b73fe
4 gewijzigde bestanden met toevoegingen van 295 en 60 verwijderingen
  1. 86 20
      build/three.cjs
  2. 86 20
      build/three.js
  3. 0 0
      build/three.min.js
  4. 123 20
      build/three.module.js

+ 86 - 20
build/three.cjs

@@ -13182,28 +13182,58 @@ function setValueV1i(gl, v) {
 	if (cache[0] === v) return;
 	gl.uniform1i(this.addr, v);
 	cache[0] = v;
-} // Single integer / boolean vector (from flat array)
+} // Single integer / boolean vector (from flat array or THREE.VectorN)
 
 
 function setValueV2i(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform2iv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y) {
+			gl.uniform2i(this.addr, v.x, v.y);
+			cache[0] = v.x;
+			cache[1] = v.y;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform2iv(this.addr, v);
+		copyArray(cache, v);
+	}
 }
 
 function setValueV3i(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform3iv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {
+			gl.uniform3i(this.addr, v.x, v.y, v.z);
+			cache[0] = v.x;
+			cache[1] = v.y;
+			cache[2] = v.z;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform3iv(this.addr, v);
+		copyArray(cache, v);
+	}
 }
 
 function setValueV4i(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform4iv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {
+			gl.uniform4i(this.addr, v.x, v.y, v.z, v.w);
+			cache[0] = v.x;
+			cache[1] = v.y;
+			cache[2] = v.z;
+			cache[3] = v.w;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform4iv(this.addr, v);
+		copyArray(cache, v);
+	}
 } // Single unsigned integer
 
 
@@ -13212,28 +13242,58 @@ function setValueV1ui(gl, v) {
 	if (cache[0] === v) return;
 	gl.uniform1ui(this.addr, v);
 	cache[0] = v;
-} // Single unsigned integer vector (from flat array)
+} // Single unsigned integer vector (from flat array or THREE.VectorN)
 
 
 function setValueV2ui(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform2uiv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y) {
+			gl.uniform2ui(this.addr, v.x, v.y);
+			cache[0] = v.x;
+			cache[1] = v.y;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform2uiv(this.addr, v);
+		copyArray(cache, v);
+	}
 }
 
 function setValueV3ui(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform3uiv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {
+			gl.uniform3ui(this.addr, v.x, v.y, v.z);
+			cache[0] = v.x;
+			cache[1] = v.y;
+			cache[2] = v.z;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform3uiv(this.addr, v);
+		copyArray(cache, v);
+	}
 }
 
 function setValueV4ui(gl, v) {
 	const cache = this.cache;
-	if (arraysEqual(cache, v)) return;
-	gl.uniform4uiv(this.addr, v);
-	copyArray(cache, v);
+
+	if (v.x !== undefined) {
+		if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {
+			gl.uniform4ui(this.addr, v.x, v.y, v.z, v.w);
+			cache[0] = v.x;
+			cache[1] = v.y;
+			cache[2] = v.z;
+			cache[3] = v.w;
+		}
+	} else {
+		if (arraysEqual(cache, v)) return;
+		gl.uniform4uiv(this.addr, v);
+		copyArray(cache, v);
+	}
 } // Single texture (2D / Cube)
 
 
@@ -22069,6 +22129,8 @@ const _instanceWorldMatrix = /*@__PURE__*/new Matrix4();
 
 const _instanceIntersects = [];
 
+const _identity = /*@__PURE__*/new Matrix4();
+
 const _mesh = /*@__PURE__*/new Mesh();
 
 class InstancedMesh extends Mesh {
@@ -22079,6 +22141,10 @@ class InstancedMesh extends Mesh {
 		this.instanceColor = null;
 		this.count = count;
 		this.frustumCulled = false;
+
+		for (let i = 0; i < count; i++) {
+			this.setMatrixAt(i, _identity);
+		}
 	}
 
 	copy(source, recursive) {

+ 86 - 20
build/three.js

@@ -13184,28 +13184,58 @@
 		if (cache[0] === v) return;
 		gl.uniform1i(this.addr, v);
 		cache[0] = v;
-	} // Single integer / boolean vector (from flat array)
+	} // Single integer / boolean vector (from flat array or THREE.VectorN)
 
 
 	function setValueV2i(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform2iv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y) {
+				gl.uniform2i(this.addr, v.x, v.y);
+				cache[0] = v.x;
+				cache[1] = v.y;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform2iv(this.addr, v);
+			copyArray(cache, v);
+		}
 	}
 
 	function setValueV3i(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform3iv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {
+				gl.uniform3i(this.addr, v.x, v.y, v.z);
+				cache[0] = v.x;
+				cache[1] = v.y;
+				cache[2] = v.z;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform3iv(this.addr, v);
+			copyArray(cache, v);
+		}
 	}
 
 	function setValueV4i(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform4iv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {
+				gl.uniform4i(this.addr, v.x, v.y, v.z, v.w);
+				cache[0] = v.x;
+				cache[1] = v.y;
+				cache[2] = v.z;
+				cache[3] = v.w;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform4iv(this.addr, v);
+			copyArray(cache, v);
+		}
 	} // Single unsigned integer
 
 
@@ -13214,28 +13244,58 @@
 		if (cache[0] === v) return;
 		gl.uniform1ui(this.addr, v);
 		cache[0] = v;
-	} // Single unsigned integer vector (from flat array)
+	} // Single unsigned integer vector (from flat array or THREE.VectorN)
 
 
 	function setValueV2ui(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform2uiv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y) {
+				gl.uniform2ui(this.addr, v.x, v.y);
+				cache[0] = v.x;
+				cache[1] = v.y;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform2uiv(this.addr, v);
+			copyArray(cache, v);
+		}
 	}
 
 	function setValueV3ui(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform3uiv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {
+				gl.uniform3ui(this.addr, v.x, v.y, v.z);
+				cache[0] = v.x;
+				cache[1] = v.y;
+				cache[2] = v.z;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform3uiv(this.addr, v);
+			copyArray(cache, v);
+		}
 	}
 
 	function setValueV4ui(gl, v) {
 		const cache = this.cache;
-		if (arraysEqual(cache, v)) return;
-		gl.uniform4uiv(this.addr, v);
-		copyArray(cache, v);
+
+		if (v.x !== undefined) {
+			if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {
+				gl.uniform4ui(this.addr, v.x, v.y, v.z, v.w);
+				cache[0] = v.x;
+				cache[1] = v.y;
+				cache[2] = v.z;
+				cache[3] = v.w;
+			}
+		} else {
+			if (arraysEqual(cache, v)) return;
+			gl.uniform4uiv(this.addr, v);
+			copyArray(cache, v);
+		}
 	} // Single texture (2D / Cube)
 
 
@@ -22071,6 +22131,8 @@
 
 	const _instanceIntersects = [];
 
+	const _identity = /*@__PURE__*/new Matrix4();
+
 	const _mesh = /*@__PURE__*/new Mesh();
 
 	class InstancedMesh extends Mesh {
@@ -22081,6 +22143,10 @@
 			this.instanceColor = null;
 			this.count = count;
 			this.frustumCulled = false;
+
+			for (let i = 0; i < count; i++) {
+				this.setMatrixAt(i, _identity);
+			}
 		}
 
 		copy(source, recursive) {

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 123 - 20
build/three.module.js

@@ -17330,17 +17330,32 @@ function setValueV1i( gl, v ) {
 
 }
 
-// Single integer / boolean vector (from flat array)
+// Single integer / boolean vector (from flat array or THREE.VectorN)
 
 function setValueV2i( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
 
-	gl.uniform2iv( this.addr, v );
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {
+
+			gl.uniform2i( this.addr, v.x, v.y );
 
-	copyArray( cache, v );
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
+
+		gl.uniform2iv( this.addr, v );
+
+		copyArray( cache, v );
+
+	}
 
 }
 
@@ -17348,11 +17363,27 @@ function setValueV3i( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
 
-	gl.uniform3iv( this.addr, v );
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {
+
+			gl.uniform3i( this.addr, v.x, v.y, v.z );
+
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+			cache[ 2 ] = v.z;
 
-	copyArray( cache, v );
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
+
+		gl.uniform3iv( this.addr, v );
+
+		copyArray( cache, v );
+
+	}
 
 }
 
@@ -17360,11 +17391,28 @@ function setValueV4i( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
+
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {
+
+			gl.uniform4i( this.addr, v.x, v.y, v.z, v.w );
 
-	gl.uniform4iv( this.addr, v );
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+			cache[ 2 ] = v.z;
+			cache[ 3 ] = v.w;
+
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
 
-	copyArray( cache, v );
+		gl.uniform4iv( this.addr, v );
+
+		copyArray( cache, v );
+
+	}
 
 }
 
@@ -17382,17 +17430,32 @@ function setValueV1ui( gl, v ) {
 
 }
 
-// Single unsigned integer vector (from flat array)
+// Single unsigned integer vector (from flat array or THREE.VectorN)
 
 function setValueV2ui( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
 
-	gl.uniform2uiv( this.addr, v );
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {
 
-	copyArray( cache, v );
+			gl.uniform2ui( this.addr, v.x, v.y );
+
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
+
+		gl.uniform2uiv( this.addr, v );
+
+		copyArray( cache, v );
+
+	}
 
 }
 
@@ -17400,11 +17463,27 @@ function setValueV3ui( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
 
-	gl.uniform3uiv( this.addr, v );
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {
+
+			gl.uniform3ui( this.addr, v.x, v.y, v.z );
+
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+			cache[ 2 ] = v.z;
+
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
 
-	copyArray( cache, v );
+		gl.uniform3uiv( this.addr, v );
+
+		copyArray( cache, v );
+
+	}
 
 }
 
@@ -17412,11 +17491,28 @@ function setValueV4ui( gl, v ) {
 
 	const cache = this.cache;
 
-	if ( arraysEqual( cache, v ) ) return;
+	if ( v.x !== undefined ) {
 
-	gl.uniform4uiv( this.addr, v );
+		if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {
+
+			gl.uniform4ui( this.addr, v.x, v.y, v.z, v.w );
+
+			cache[ 0 ] = v.x;
+			cache[ 1 ] = v.y;
+			cache[ 2 ] = v.z;
+			cache[ 3 ] = v.w;
+
+		}
+
+	} else {
+
+		if ( arraysEqual( cache, v ) ) return;
+
+		gl.uniform4uiv( this.addr, v );
+
+		copyArray( cache, v );
 
-	copyArray( cache, v );
+	}
 
 }
 
@@ -30302,6 +30398,7 @@ const _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();
 
 const _instanceIntersects = [];
 
+const _identity = /*@__PURE__*/ new Matrix4();
 const _mesh = /*@__PURE__*/ new Mesh();
 
 class InstancedMesh extends Mesh {
@@ -30319,6 +30416,12 @@ class InstancedMesh extends Mesh {
 
 		this.frustumCulled = false;
 
+		for ( let i = 0; i < count; i ++ ) {
+
+			this.setMatrixAt( i, _identity );
+
+		}
+
 	}
 
 	copy( source, recursive ) {

Some files were not shown because too many files changed in this diff