Browse Source

Updated builds.

Mr.doob 2 years ago
parent
commit
37c862ed1e
5 changed files with 255 additions and 15 deletions
  1. 85 5
      build/three.cjs
  2. 85 5
      build/three.js
  3. 0 0
      build/three.min.js
  4. 85 5
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 85 - 5
build/three.cjs

@@ -526,6 +526,10 @@ function denormalize( value, array ) {
 
 			return value;
 
+		case Uint32Array:
+
+			return value / 4294967295.0;
+
 		case Uint16Array:
 
 			return value / 65535.0;
@@ -534,6 +538,10 @@ function denormalize( value, array ) {
 
 			return value / 255.0;
 
+		case Int32Array:
+
+			return Math.max( value / 2147483647.0, - 1.0 );
+
 		case Int16Array:
 
 			return Math.max( value / 32767.0, - 1.0 );
@@ -558,6 +566,10 @@ function normalize( value, array ) {
 
 			return value;
 
+		case Uint32Array:
+
+			return Math.round( value * 4294967295.0 );
+
 		case Uint16Array:
 
 			return Math.round( value * 65535.0 );
@@ -566,6 +578,10 @@ function normalize( value, array ) {
 
 			return Math.round( value * 255.0 );
 
+		case Int32Array:
+
+			return Math.round( value * 2147483647.0 );
+
 		case Int16Array:
 
 			return Math.round( value * 32767.0 );
@@ -10008,6 +10024,18 @@ class Int8BufferAttribute extends BufferAttribute {
 
 		super( new Int8Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10018,6 +10046,18 @@ class Uint8BufferAttribute extends BufferAttribute {
 
 		super( new Uint8Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10038,6 +10078,18 @@ class Int16BufferAttribute extends BufferAttribute {
 
 		super( new Int16Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10048,6 +10100,18 @@ class Uint16BufferAttribute extends BufferAttribute {
 
 		super( new Uint16Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -15006,9 +15070,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 
 	}
 
-	function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
+	function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
 
-		if ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
+		if ( integer === true ) {
 
 			gl.vertexAttribIPointer( index, size, type, stride, offset );
 
@@ -15066,6 +15130,10 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 					const type = attribute.type;
 					const bytesPerElement = attribute.bytesPerElement;
 
+					// check for integer attributes (WebGL 2 only)
+
+					const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
+
 					if ( geometryAttribute.isInterleavedBufferAttribute ) {
 
 						const data = geometryAttribute.data;
@@ -15106,7 +15174,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 								type,
 								normalized,
 								stride * bytesPerElement,
-								( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
+								( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
+								integer
 							);
 
 						}
@@ -15147,7 +15216,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 								type,
 								normalized,
 								size * bytesPerElement,
-								( size / programAttribute.locationSize ) * i * bytesPerElement
+								( size / programAttribute.locationSize ) * i * bytesPerElement,
+								integer
 							);
 
 						}
@@ -17285,7 +17355,6 @@ function WebGLInfo( gl ) {
 
 	function reset() {
 
-		render.frame ++;
 		render.calls = 0;
 		render.triangles = 0;
 		render.points = 0;
@@ -17710,6 +17779,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
  *
  */
 
+
 const emptyTexture = /*@__PURE__*/ new Texture();
 const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
 const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
@@ -27923,6 +27993,12 @@ class WebGLRenderer {
 
 			}
 
+			if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+
+				console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
+
+			}
+
 			// Some experimental-webgl implementations do not have getShaderPrecisionFormat
 
 			if ( _gl.getShaderPrecisionFormat === undefined ) {
@@ -28733,6 +28809,8 @@ class WebGLRenderer {
 
 			if ( this.info.autoReset === true ) this.info.reset();
 
+			this.info.render.frame ++;
+
 			//
 
 			background.render( currentRenderList, scene );
@@ -36568,6 +36646,7 @@ function addContour( vertices, contour ) {
  * }
  */
 
+
 class ExtrudeGeometry extends BufferGeometry {
 
 	constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
@@ -49005,6 +49084,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
  * The azimuthal angle (theta) is measured from the positive z-axis.
  */
 
+
 class Spherical {
 
 	constructor( radius = 1, phi = 0, theta = 0 ) {

+ 85 - 5
build/three.js

@@ -531,6 +531,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				return value;
 
+			case Uint32Array:
+
+				return value / 4294967295.0;
+
 			case Uint16Array:
 
 				return value / 65535.0;
@@ -539,6 +543,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				return value / 255.0;
 
+			case Int32Array:
+
+				return Math.max( value / 2147483647.0, - 1.0 );
+
 			case Int16Array:
 
 				return Math.max( value / 32767.0, - 1.0 );
@@ -563,6 +571,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				return value;
 
+			case Uint32Array:
+
+				return Math.round( value * 4294967295.0 );
+
 			case Uint16Array:
 
 				return Math.round( value * 65535.0 );
@@ -571,6 +583,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				return Math.round( value * 255.0 );
 
+			case Int32Array:
+
+				return Math.round( value * 2147483647.0 );
+
 			case Int16Array:
 
 				return Math.round( value * 32767.0 );
@@ -10013,6 +10029,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			super( new Int8Array( array ), itemSize, normalized );
 
+			this.gpuType = FloatType;
+
+		}
+
+		copy( source ) {
+
+			super.copy( source );
+
+			this.gpuType = source.gpuType;
+
+			return this;
+
 		}
 
 	}
@@ -10023,6 +10051,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			super( new Uint8Array( array ), itemSize, normalized );
 
+			this.gpuType = FloatType;
+
+		}
+
+		copy( source ) {
+
+			super.copy( source );
+
+			this.gpuType = source.gpuType;
+
+			return this;
+
 		}
 
 	}
@@ -10043,6 +10083,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			super( new Int16Array( array ), itemSize, normalized );
 
+			this.gpuType = FloatType;
+
+		}
+
+		copy( source ) {
+
+			super.copy( source );
+
+			this.gpuType = source.gpuType;
+
+			return this;
+
 		}
 
 	}
@@ -10053,6 +10105,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			super( new Uint16Array( array ), itemSize, normalized );
 
+			this.gpuType = FloatType;
+
+		}
+
+		copy( source ) {
+
+			super.copy( source );
+
+			this.gpuType = source.gpuType;
+
+			return this;
+
 		}
 
 	}
@@ -15011,9 +15075,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 		}
 
-		function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
+		function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
 
-			if ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
+			if ( integer === true ) {
 
 				gl.vertexAttribIPointer( index, size, type, stride, offset );
 
@@ -15071,6 +15135,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 						const type = attribute.type;
 						const bytesPerElement = attribute.bytesPerElement;
 
+						// check for integer attributes (WebGL 2 only)
+
+						const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
+
 						if ( geometryAttribute.isInterleavedBufferAttribute ) {
 
 							const data = geometryAttribute.data;
@@ -15111,7 +15179,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 									type,
 									normalized,
 									stride * bytesPerElement,
-									( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
+									( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
+									integer
 								);
 
 							}
@@ -15152,7 +15221,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 									type,
 									normalized,
 									size * bytesPerElement,
-									( size / programAttribute.locationSize ) * i * bytesPerElement
+									( size / programAttribute.locationSize ) * i * bytesPerElement,
+									integer
 								);
 
 							}
@@ -17290,7 +17360,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 		function reset() {
 
-			render.frame ++;
 			render.calls = 0;
 			render.triangles = 0;
 			render.points = 0;
@@ -17715,6 +17784,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	 *
 	 */
 
+
 	const emptyTexture = /*@__PURE__*/ new Texture();
 	const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
 	const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
@@ -27928,6 +27998,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				}
 
+				if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+
+					console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
+
+				}
+
 				// Some experimental-webgl implementations do not have getShaderPrecisionFormat
 
 				if ( _gl.getShaderPrecisionFormat === undefined ) {
@@ -28738,6 +28814,8 @@ 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 ++;
+
 				//
 
 				background.render( currentRenderList, scene );
@@ -36573,6 +36651,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	 * }
 	 */
 
+
 	class ExtrudeGeometry extends BufferGeometry {
 
 		constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
@@ -49010,6 +49089,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	 * The azimuthal angle (theta) is measured from the positive z-axis.
 	 */
 
+
 	class Spherical {
 
 		constructor( radius = 1, phi = 0, theta = 0 ) {

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


+ 85 - 5
build/three.module.js

@@ -524,6 +524,10 @@ function denormalize( value, array ) {
 
 			return value;
 
+		case Uint32Array:
+
+			return value / 4294967295.0;
+
 		case Uint16Array:
 
 			return value / 65535.0;
@@ -532,6 +536,10 @@ function denormalize( value, array ) {
 
 			return value / 255.0;
 
+		case Int32Array:
+
+			return Math.max( value / 2147483647.0, - 1.0 );
+
 		case Int16Array:
 
 			return Math.max( value / 32767.0, - 1.0 );
@@ -556,6 +564,10 @@ function normalize( value, array ) {
 
 			return value;
 
+		case Uint32Array:
+
+			return Math.round( value * 4294967295.0 );
+
 		case Uint16Array:
 
 			return Math.round( value * 65535.0 );
@@ -564,6 +576,10 @@ function normalize( value, array ) {
 
 			return Math.round( value * 255.0 );
 
+		case Int32Array:
+
+			return Math.round( value * 2147483647.0 );
+
 		case Int16Array:
 
 			return Math.round( value * 32767.0 );
@@ -10006,6 +10022,18 @@ class Int8BufferAttribute extends BufferAttribute {
 
 		super( new Int8Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10016,6 +10044,18 @@ class Uint8BufferAttribute extends BufferAttribute {
 
 		super( new Uint8Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10036,6 +10076,18 @@ class Int16BufferAttribute extends BufferAttribute {
 
 		super( new Int16Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -10046,6 +10098,18 @@ class Uint16BufferAttribute extends BufferAttribute {
 
 		super( new Uint16Array( array ), itemSize, normalized );
 
+		this.gpuType = FloatType;
+
+	}
+
+	copy( source ) {
+
+		super.copy( source );
+
+		this.gpuType = source.gpuType;
+
+		return this;
+
 	}
 
 }
@@ -15004,9 +15068,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 
 	}
 
-	function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
+	function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
 
-		if ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
+		if ( integer === true ) {
 
 			gl.vertexAttribIPointer( index, size, type, stride, offset );
 
@@ -15064,6 +15128,10 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 					const type = attribute.type;
 					const bytesPerElement = attribute.bytesPerElement;
 
+					// check for integer attributes (WebGL 2 only)
+
+					const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
+
 					if ( geometryAttribute.isInterleavedBufferAttribute ) {
 
 						const data = geometryAttribute.data;
@@ -15104,7 +15172,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 								type,
 								normalized,
 								stride * bytesPerElement,
-								( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
+								( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
+								integer
 							);
 
 						}
@@ -15145,7 +15214,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 								type,
 								normalized,
 								size * bytesPerElement,
-								( size / programAttribute.locationSize ) * i * bytesPerElement
+								( size / programAttribute.locationSize ) * i * bytesPerElement,
+								integer
 							);
 
 						}
@@ -17283,7 +17353,6 @@ function WebGLInfo( gl ) {
 
 	function reset() {
 
-		render.frame ++;
 		render.calls = 0;
 		render.triangles = 0;
 		render.points = 0;
@@ -17708,6 +17777,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
  *
  */
 
+
 const emptyTexture = /*@__PURE__*/ new Texture();
 const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
 const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
@@ -27921,6 +27991,12 @@ class WebGLRenderer {
 
 			}
 
+			if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
+
+				console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
+
+			}
+
 			// Some experimental-webgl implementations do not have getShaderPrecisionFormat
 
 			if ( _gl.getShaderPrecisionFormat === undefined ) {
@@ -28731,6 +28807,8 @@ class WebGLRenderer {
 
 			if ( this.info.autoReset === true ) this.info.reset();
 
+			this.info.render.frame ++;
+
 			//
 
 			background.render( currentRenderList, scene );
@@ -36566,6 +36644,7 @@ function addContour( vertices, contour ) {
  * }
  */
 
+
 class ExtrudeGeometry extends BufferGeometry {
 
 	constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
@@ -49003,6 +49082,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
  * The azimuthal angle (theta) is measured from the positive z-axis.
  */
 
+
 class Spherical {
 
 	constructor( radius = 1, phi = 0, theta = 0 ) {

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


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