Browse Source

Updated builds.

Mugen87 2 years ago
parent
commit
1d91a4aef1
5 changed files with 610 additions and 138 deletions
  1. 206 46
      build/three.cjs
  2. 206 46
      build/three.js
  3. 0 0
      build/three.min.js
  4. 198 46
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 206 - 46
build/three.cjs

@@ -5,7 +5,7 @@
  */
 'use strict';
 
-const REVISION = '152';
+const REVISION = '153dev';
 
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -180,6 +180,15 @@ const NotEqualStencilFunc = 517;
 const GreaterEqualStencilFunc = 518;
 const AlwaysStencilFunc = 519;
 
+const NeverCompare = 512;
+const LessCompare = 513;
+const EqualCompare = 514;
+const LessEqualCompare = 515;
+const GreaterCompare = 516;
+const NotEqualCompare = 517;
+const GreaterEqualCompare = 518;
+const AlwaysCompare = 519;
+
 const StaticDrawUsage = 35044;
 const DynamicDrawUsage = 35048;
 const StreamDrawUsage = 35040;
@@ -11309,9 +11318,9 @@ class BufferGeometry extends EventDispatcher {
 
 }
 
-const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
-const _ray$2 = /*@__PURE__*/ new Ray();
-const _sphere$4 = /*@__PURE__*/ new Sphere();
+const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();
+const _ray$3 = /*@__PURE__*/ new Ray();
+const _sphere$5 = /*@__PURE__*/ new Sphere();
 const _sphereHitAt = /*@__PURE__*/ new Vector3();
 
 const _vA$1 = /*@__PURE__*/ new Vector3();
@@ -11455,41 +11464,45 @@ class Mesh extends Object3D {
 
 		if ( material === undefined ) return;
 
-		// Checking boundingSphere distance to ray
+		// test with bounding sphere in world space
 
 		if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
 
-		_sphere$4.copy( geometry.boundingSphere );
-		_sphere$4.applyMatrix4( matrixWorld );
+		_sphere$5.copy( geometry.boundingSphere );
+		_sphere$5.applyMatrix4( matrixWorld );
+
+		// check distance from ray origin to bounding sphere
 
-		_ray$2.copy( raycaster.ray ).recast( raycaster.near );
+		_ray$3.copy( raycaster.ray ).recast( raycaster.near );
 
-		if ( _sphere$4.containsPoint( _ray$2.origin ) === false ) {
+		if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) {
 
-			if ( _ray$2.intersectSphere( _sphere$4, _sphereHitAt ) === null ) return;
+			if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
 
-			if ( _ray$2.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
+			if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
 
 		}
 
-		//
+		// convert ray to local space of mesh
 
-		_inverseMatrix$2.copy( matrixWorld ).invert();
-		_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
+		_inverseMatrix$3.copy( matrixWorld ).invert();
+		_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );
 
-		// Check boundingBox before continuing
+		// test with bounding box in local space
 
 		if ( geometry.boundingBox !== null ) {
 
-			if ( _ray$2.intersectsBox( geometry.boundingBox ) === false ) return;
+			if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;
 
 		}
 
-		this._computeIntersections( raycaster, intersects );
+		// test for intersections with geometry
+
+		this._computeIntersections( raycaster, intersects, _ray$3 );
 
 	}
 
-	_computeIntersections( raycaster, intersects ) {
+	_computeIntersections( raycaster, intersects, rayLocalSpace ) {
 
 		let intersection;
 
@@ -11524,7 +11537,7 @@ class Mesh extends Object3D {
 						const b = index.getX( j + 1 );
 						const c = index.getX( j + 2 );
 
-						intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+						intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 						if ( intersection ) {
 
@@ -11549,7 +11562,7 @@ class Mesh extends Object3D {
 					const b = index.getX( i + 1 );
 					const c = index.getX( i + 2 );
 
-					intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+					intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 					if ( intersection ) {
 
@@ -11582,7 +11595,7 @@ class Mesh extends Object3D {
 						const b = j + 1;
 						const c = j + 2;
 
-						intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+						intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 						if ( intersection ) {
 
@@ -11607,7 +11620,7 @@ class Mesh extends Object3D {
 					const b = i + 1;
 					const c = i + 2;
 
-					intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+					intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 					if ( intersection ) {
 
@@ -11684,7 +11697,7 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
 			_uvC$1.fromBufferAttribute( uv1, c );
 
 			intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
-			intersection.uv2 = intersection.uv1; // Backwards compatibility
+			intersection.uv2 = intersection.uv1; // @deprecated, r152
 
 		}
 
@@ -12951,7 +12964,7 @@ class Plane {
 
 }
 
-const _sphere$3 = /*@__PURE__*/ new Sphere();
+const _sphere$4 = /*@__PURE__*/ new Sphere();
 const _vector$6 = /*@__PURE__*/ new Vector3();
 
 class Frustum {
@@ -13017,7 +13030,7 @@ class Frustum {
 
 			if ( object.boundingSphere === null ) object.computeBoundingSphere();
 
-			_sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
+			_sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
 
 		} else {
 
@@ -13025,21 +13038,21 @@ class Frustum {
 
 			if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
 
-			_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
+			_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
 
 		}
 
-		return this.intersectsSphere( _sphere$3 );
+		return this.intersectsSphere( _sphere$4 );
 
 	}
 
 	intersectsSprite( sprite ) {
 
-		_sphere$3.center.set( 0, 0, 0 );
-		_sphere$3.radius = 0.7071067811865476;
-		_sphere$3.applyMatrix4( sprite.matrixWorld );
+		_sphere$4.center.set( 0, 0, 0 );
+		_sphere$4.radius = 0.7071067811865476;
+		_sphere$4.applyMatrix4( sprite.matrixWorld );
 
-		return this.intersectsSphere( _sphere$3 );
+		return this.intersectsSphere( _sphere$4 );
 
 	}
 
@@ -19918,11 +19931,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 
 	function getChannel( value ) {
 
-		if ( value === 1 ) return 'uv1';
-		if ( value === 2 ) return 'uv2';
-		if ( value === 3 ) return 'uv3';
+		if ( value === 0 ) return 'uv';
 
-		return 'uv';
+		return `uv${ value }`;
 
 	}
 
@@ -23730,6 +23741,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
 	};
 
+	const compareToGL = {
+		[ NeverCompare ]: _gl.NEVER,
+		[ AlwaysCompare ]: _gl.ALWAYS,
+		[ LessCompare ]: _gl.LESS,
+		[ LessEqualCompare ]: _gl.LEQUAL,
+		[ EqualCompare ]: _gl.EQUAL,
+		[ GreaterEqualCompare ]: _gl.GEQUAL,
+		[ GreaterCompare ]: _gl.GREATER,
+		[ NotEqualCompare ]: _gl.NOTEQUAL
+	};
+
 	function setTextureParameters( textureType, texture, supportsMips ) {
 
 		if ( supportsMips ) {
@@ -23774,6 +23796,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 		}
 
+		if ( texture.compareFunction ) {
+
+			_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
+			_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
+
+		}
+
 		if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
 
 			const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
@@ -25867,9 +25896,31 @@ class DepthTexture extends Texture {
 		this.flipY = false;
 		this.generateMipmaps = false;
 
+		this.compareFunction = null;
+
 	}
 
 
+	copy( source ) {
+
+		super.copy( source );
+
+		this.compareFunction = source.compareFunction;
+
+		return this;
+
+	}
+
+	toJSON( meta ) {
+
+		const data = super.toJSON( meta );
+
+		if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;
+
+		return data;
+
+	}
+
 }
 
 class WebXRManager extends EventDispatcher {
@@ -27686,6 +27737,9 @@ class WebGLRenderer {
 
 		}
 
+		const uintClearColor = new Uint32Array( 4 );
+		const intClearColor = new Int32Array( 4 );
+
 		let currentRenderList = null;
 		let currentRenderState = null;
 
@@ -28150,7 +28204,65 @@ class WebGLRenderer {
 
 			let bits = 0;
 
-			if ( color ) bits |= _gl.COLOR_BUFFER_BIT;
+			if ( color ) {
+
+				// check if we're trying to clear an integer target
+				let isIntegerFormat = false;
+				if ( _currentRenderTarget !== null ) {
+
+					const targetFormat = _currentRenderTarget.texture.format;
+					isIntegerFormat = targetFormat === RGBAIntegerFormat ||
+						targetFormat === RGIntegerFormat ||
+						targetFormat === RedIntegerFormat;
+
+				}
+
+				// use the appropriate clear functions to clear the target if it's a signed
+				// or unsigned integer target
+				if ( isIntegerFormat ) {
+
+					const targetType = _currentRenderTarget.texture.type;
+					const isUnsignedType = targetType === UnsignedByteType ||
+						targetType === UnsignedIntType ||
+						targetType === UnsignedShortType ||
+						targetType === UnsignedInt248Type ||
+						targetType === UnsignedShort4444Type ||
+						targetType === UnsignedShort5551Type;
+
+					const clearColor = background.getClearColor();
+					const a = background.getClearAlpha();
+					const r = clearColor.r;
+					const g = clearColor.g;
+					const b = clearColor.b;
+
+					const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer;
+
+					if ( isUnsignedType ) {
+
+						uintClearColor[ 0 ] = r;
+						uintClearColor[ 1 ] = g;
+						uintClearColor[ 2 ] = b;
+						uintClearColor[ 3 ] = a;
+						_gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor );
+
+					} else {
+
+						intClearColor[ 0 ] = r;
+						intClearColor[ 1 ] = g;
+						intClearColor[ 2 ] = b;
+						intClearColor[ 3 ] = a;
+						_gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor );
+
+					}
+
+				} else {
+
+					bits |= _gl.COLOR_BUFFER_BIT;
+
+				}
+
+			}
+
 			if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
 			if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
 
@@ -28767,10 +28879,19 @@ class WebGLRenderer {
 
 						if ( sortObjects ) {
 
-							if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+							if ( object.boundingSphere !== undefined ) {
+
+								if ( object.boundingSphere === null ) object.computeBoundingSphere();
+								_vector3.copy( object.boundingSphere.center );
+
+							} else {
+
+								if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+								_vector3.copy( geometry.boundingSphere.center );
+
+							}
 
 							_vector3
-								.copy( geometry.boundingSphere.center )
 								.applyMatrix4( object.matrixWorld )
 								.applyMatrix4( _projScreenMatrix );
 
@@ -30976,7 +31097,9 @@ const _vector3 = /*@__PURE__*/ new Vector3();
 const _matrix4 = /*@__PURE__*/ new Matrix4();
 const _vertex = /*@__PURE__*/ new Vector3();
 
-
+const _sphere$3 = /*@__PURE__*/ new Sphere();
+const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
+const _ray$2 = /*@__PURE__*/ new Ray();
 
 class SkinnedMesh extends Mesh {
 
@@ -31055,22 +31178,47 @@ class SkinnedMesh extends Mesh {
 
 		this.skeleton = source.skeleton;
 
+		if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+		if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 		return this;
 
 	}
 
-	// raycast( raycaster, intersects ) {
+	raycast( raycaster, intersects ) {
+
+		const material = this.material;
+		const matrixWorld = this.matrixWorld;
+
+		if ( material === undefined ) return;
+
+		// test with bounding sphere in world space
 
-	// 	if ( this.boundingSphere === null ) this.computeBoundingSphere();
+		if ( this.boundingSphere === null ) this.computeBoundingSphere();
 
-	// 	_sphere.copy( this.boundingSphere );
-	// 	_sphere.applyMatrix4( this.matrixWorld );
+		_sphere$3.copy( this.boundingSphere );
+		_sphere$3.applyMatrix4( matrixWorld );
 
-	// 	if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
+		if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
 
-	// 	this._computeIntersections( raycaster, intersects );
+		// convert ray to local space of skinned mesh
 
-	// }
+		_inverseMatrix$2.copy( matrixWorld ).invert();
+		_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
+
+		// test with bounding box in local space
+
+		if ( this.boundingBox !== null ) {
+
+			if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;
+
+		}
+
+		// test for intersections with geometry
+
+		this._computeIntersections( raycaster, intersects, _ray$2 );
+
+	}
 
 	getVertexPosition( index, target ) {
 
@@ -31642,6 +31790,9 @@ class InstancedMesh extends Mesh {
 
 		this.count = source.count;
 
+		if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+		if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 		return this;
 
 	}
@@ -44157,6 +44308,7 @@ class ObjectLoader extends Loader {
 				if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
 				if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
 				if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
+				if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
 
 				if ( data.userData !== undefined ) texture.userData = data.userData;
 
@@ -51041,6 +51193,7 @@ exports.AddOperation = AddOperation;
 exports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;
 exports.AdditiveBlending = AdditiveBlending;
 exports.AlphaFormat = AlphaFormat;
+exports.AlwaysCompare = AlwaysCompare;
 exports.AlwaysDepth = AlwaysDepth;
 exports.AlwaysStencilFunc = AlwaysStencilFunc;
 exports.AmbientLight = AmbientLight;
@@ -51140,6 +51293,7 @@ exports.DynamicDrawUsage = DynamicDrawUsage;
 exports.DynamicReadUsage = DynamicReadUsage;
 exports.EdgesGeometry = EdgesGeometry;
 exports.EllipseCurve = EllipseCurve;
+exports.EqualCompare = EqualCompare;
 exports.EqualDepth = EqualDepth;
 exports.EqualStencilFunc = EqualStencilFunc;
 exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;
@@ -51161,7 +51315,9 @@ exports.Frustum = Frustum;
 exports.GLBufferAttribute = GLBufferAttribute;
 exports.GLSL1 = GLSL1;
 exports.GLSL3 = GLSL3;
+exports.GreaterCompare = GreaterCompare;
 exports.GreaterDepth = GreaterDepth;
+exports.GreaterEqualCompare = GreaterEqualCompare;
 exports.GreaterEqualDepth = GreaterEqualDepth;
 exports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;
 exports.GreaterStencilFunc = GreaterStencilFunc;
@@ -51199,7 +51355,9 @@ exports.LOD = LOD;
 exports.LatheBufferGeometry = LatheBufferGeometry;
 exports.LatheGeometry = LatheGeometry;
 exports.Layers = Layers;
+exports.LessCompare = LessCompare;
 exports.LessDepth = LessDepth;
+exports.LessEqualCompare = LessEqualCompare;
 exports.LessEqualDepth = LessEqualDepth;
 exports.LessEqualStencilFunc = LessEqualStencilFunc;
 exports.LessStencilFunc = LessStencilFunc;
@@ -51258,6 +51416,7 @@ exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;
 exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;
 exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;
 exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
+exports.NeverCompare = NeverCompare;
 exports.NeverDepth = NeverDepth;
 exports.NeverStencilFunc = NeverStencilFunc;
 exports.NoBlending = NoBlending;
@@ -51265,6 +51424,7 @@ exports.NoColorSpace = NoColorSpace;
 exports.NoToneMapping = NoToneMapping;
 exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
 exports.NormalBlending = NormalBlending;
+exports.NotEqualCompare = NotEqualCompare;
 exports.NotEqualDepth = NotEqualDepth;
 exports.NotEqualStencilFunc = NotEqualStencilFunc;
 exports.NumberKeyframeTrack = NumberKeyframeTrack;

+ 206 - 46
build/three.js

@@ -10,7 +10,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
 })(this, (function (exports) { 'use strict';
 
-	const REVISION = '152';
+	const REVISION = '153dev';
 
 	const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 	const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -185,6 +185,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	const GreaterEqualStencilFunc = 518;
 	const AlwaysStencilFunc = 519;
 
+	const NeverCompare = 512;
+	const LessCompare = 513;
+	const EqualCompare = 514;
+	const LessEqualCompare = 515;
+	const GreaterCompare = 516;
+	const NotEqualCompare = 517;
+	const GreaterEqualCompare = 518;
+	const AlwaysCompare = 519;
+
 	const StaticDrawUsage = 35044;
 	const DynamicDrawUsage = 35048;
 	const StreamDrawUsage = 35040;
@@ -11314,9 +11323,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 	}
 
-	const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
-	const _ray$2 = /*@__PURE__*/ new Ray();
-	const _sphere$4 = /*@__PURE__*/ new Sphere();
+	const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();
+	const _ray$3 = /*@__PURE__*/ new Ray();
+	const _sphere$5 = /*@__PURE__*/ new Sphere();
 	const _sphereHitAt = /*@__PURE__*/ new Vector3();
 
 	const _vA$1 = /*@__PURE__*/ new Vector3();
@@ -11460,41 +11469,45 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			if ( material === undefined ) return;
 
-			// Checking boundingSphere distance to ray
+			// test with bounding sphere in world space
 
 			if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
 
-			_sphere$4.copy( geometry.boundingSphere );
-			_sphere$4.applyMatrix4( matrixWorld );
+			_sphere$5.copy( geometry.boundingSphere );
+			_sphere$5.applyMatrix4( matrixWorld );
+
+			// check distance from ray origin to bounding sphere
 
-			_ray$2.copy( raycaster.ray ).recast( raycaster.near );
+			_ray$3.copy( raycaster.ray ).recast( raycaster.near );
 
-			if ( _sphere$4.containsPoint( _ray$2.origin ) === false ) {
+			if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) {
 
-				if ( _ray$2.intersectSphere( _sphere$4, _sphereHitAt ) === null ) return;
+				if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
 
-				if ( _ray$2.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
+				if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
 
 			}
 
-			//
+			// convert ray to local space of mesh
 
-			_inverseMatrix$2.copy( matrixWorld ).invert();
-			_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
+			_inverseMatrix$3.copy( matrixWorld ).invert();
+			_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );
 
-			// Check boundingBox before continuing
+			// test with bounding box in local space
 
 			if ( geometry.boundingBox !== null ) {
 
-				if ( _ray$2.intersectsBox( geometry.boundingBox ) === false ) return;
+				if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;
 
 			}
 
-			this._computeIntersections( raycaster, intersects );
+			// test for intersections with geometry
+
+			this._computeIntersections( raycaster, intersects, _ray$3 );
 
 		}
 
-		_computeIntersections( raycaster, intersects ) {
+		_computeIntersections( raycaster, intersects, rayLocalSpace ) {
 
 			let intersection;
 
@@ -11529,7 +11542,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 							const b = index.getX( j + 1 );
 							const c = index.getX( j + 2 );
 
-							intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+							intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 							if ( intersection ) {
 
@@ -11554,7 +11567,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 						const b = index.getX( i + 1 );
 						const c = index.getX( i + 2 );
 
-						intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+						intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 						if ( intersection ) {
 
@@ -11587,7 +11600,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 							const b = j + 1;
 							const c = j + 2;
 
-							intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+							intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 							if ( intersection ) {
 
@@ -11612,7 +11625,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 						const b = i + 1;
 						const c = i + 2;
 
-						intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
+						intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
 
 						if ( intersection ) {
 
@@ -11689,7 +11702,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				_uvC$1.fromBufferAttribute( uv1, c );
 
 				intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
-				intersection.uv2 = intersection.uv1; // Backwards compatibility
+				intersection.uv2 = intersection.uv1; // @deprecated, r152
 
 			}
 
@@ -12956,7 +12969,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 	}
 
-	const _sphere$3 = /*@__PURE__*/ new Sphere();
+	const _sphere$4 = /*@__PURE__*/ new Sphere();
 	const _vector$6 = /*@__PURE__*/ new Vector3();
 
 	class Frustum {
@@ -13022,7 +13035,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				if ( object.boundingSphere === null ) object.computeBoundingSphere();
 
-				_sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
+				_sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
 
 			} else {
 
@@ -13030,21 +13043,21 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
 
-				_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
+				_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
 
 			}
 
-			return this.intersectsSphere( _sphere$3 );
+			return this.intersectsSphere( _sphere$4 );
 
 		}
 
 		intersectsSprite( sprite ) {
 
-			_sphere$3.center.set( 0, 0, 0 );
-			_sphere$3.radius = 0.7071067811865476;
-			_sphere$3.applyMatrix4( sprite.matrixWorld );
+			_sphere$4.center.set( 0, 0, 0 );
+			_sphere$4.radius = 0.7071067811865476;
+			_sphere$4.applyMatrix4( sprite.matrixWorld );
 
-			return this.intersectsSphere( _sphere$3 );
+			return this.intersectsSphere( _sphere$4 );
 
 		}
 
@@ -19923,11 +19936,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 		function getChannel( value ) {
 
-			if ( value === 1 ) return 'uv1';
-			if ( value === 2 ) return 'uv2';
-			if ( value === 3 ) return 'uv3';
+			if ( value === 0 ) return 'uv';
 
-			return 'uv';
+			return `uv${ value }`;
 
 		}
 
@@ -23735,6 +23746,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
 		};
 
+		const compareToGL = {
+			[ NeverCompare ]: _gl.NEVER,
+			[ AlwaysCompare ]: _gl.ALWAYS,
+			[ LessCompare ]: _gl.LESS,
+			[ LessEqualCompare ]: _gl.LEQUAL,
+			[ EqualCompare ]: _gl.EQUAL,
+			[ GreaterEqualCompare ]: _gl.GEQUAL,
+			[ GreaterCompare ]: _gl.GREATER,
+			[ NotEqualCompare ]: _gl.NOTEQUAL
+		};
+
 		function setTextureParameters( textureType, texture, supportsMips ) {
 
 			if ( supportsMips ) {
@@ -23779,6 +23801,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			}
 
+			if ( texture.compareFunction ) {
+
+				_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
+				_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
+
+			}
+
 			if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
 
 				const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
@@ -25872,9 +25901,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			this.flipY = false;
 			this.generateMipmaps = false;
 
+			this.compareFunction = null;
+
 		}
 
 
+		copy( source ) {
+
+			super.copy( source );
+
+			this.compareFunction = source.compareFunction;
+
+			return this;
+
+		}
+
+		toJSON( meta ) {
+
+			const data = super.toJSON( meta );
+
+			if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;
+
+			return data;
+
+		}
+
 	}
 
 	class WebXRManager extends EventDispatcher {
@@ -27691,6 +27742,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			}
 
+			const uintClearColor = new Uint32Array( 4 );
+			const intClearColor = new Int32Array( 4 );
+
 			let currentRenderList = null;
 			let currentRenderState = null;
 
@@ -28155,7 +28209,65 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 				let bits = 0;
 
-				if ( color ) bits |= _gl.COLOR_BUFFER_BIT;
+				if ( color ) {
+
+					// check if we're trying to clear an integer target
+					let isIntegerFormat = false;
+					if ( _currentRenderTarget !== null ) {
+
+						const targetFormat = _currentRenderTarget.texture.format;
+						isIntegerFormat = targetFormat === RGBAIntegerFormat ||
+							targetFormat === RGIntegerFormat ||
+							targetFormat === RedIntegerFormat;
+
+					}
+
+					// use the appropriate clear functions to clear the target if it's a signed
+					// or unsigned integer target
+					if ( isIntegerFormat ) {
+
+						const targetType = _currentRenderTarget.texture.type;
+						const isUnsignedType = targetType === UnsignedByteType ||
+							targetType === UnsignedIntType ||
+							targetType === UnsignedShortType ||
+							targetType === UnsignedInt248Type ||
+							targetType === UnsignedShort4444Type ||
+							targetType === UnsignedShort5551Type;
+
+						const clearColor = background.getClearColor();
+						const a = background.getClearAlpha();
+						const r = clearColor.r;
+						const g = clearColor.g;
+						const b = clearColor.b;
+
+						const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer;
+
+						if ( isUnsignedType ) {
+
+							uintClearColor[ 0 ] = r;
+							uintClearColor[ 1 ] = g;
+							uintClearColor[ 2 ] = b;
+							uintClearColor[ 3 ] = a;
+							_gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor );
+
+						} else {
+
+							intClearColor[ 0 ] = r;
+							intClearColor[ 1 ] = g;
+							intClearColor[ 2 ] = b;
+							intClearColor[ 3 ] = a;
+							_gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor );
+
+						}
+
+					} else {
+
+						bits |= _gl.COLOR_BUFFER_BIT;
+
+					}
+
+				}
+
 				if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
 				if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
 
@@ -28772,10 +28884,19 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 							if ( sortObjects ) {
 
-								if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+								if ( object.boundingSphere !== undefined ) {
+
+									if ( object.boundingSphere === null ) object.computeBoundingSphere();
+									_vector3.copy( object.boundingSphere.center );
+
+								} else {
+
+									if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+									_vector3.copy( geometry.boundingSphere.center );
+
+								}
 
 								_vector3
-									.copy( geometry.boundingSphere.center )
 									.applyMatrix4( object.matrixWorld )
 									.applyMatrix4( _projScreenMatrix );
 
@@ -30981,7 +31102,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	const _matrix4 = /*@__PURE__*/ new Matrix4();
 	const _vertex = /*@__PURE__*/ new Vector3();
 
-
+	const _sphere$3 = /*@__PURE__*/ new Sphere();
+	const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
+	const _ray$2 = /*@__PURE__*/ new Ray();
 
 	class SkinnedMesh extends Mesh {
 
@@ -31060,22 +31183,47 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			this.skeleton = source.skeleton;
 
+			if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+			if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 			return this;
 
 		}
 
-		// raycast( raycaster, intersects ) {
+		raycast( raycaster, intersects ) {
+
+			const material = this.material;
+			const matrixWorld = this.matrixWorld;
+
+			if ( material === undefined ) return;
+
+			// test with bounding sphere in world space
 
-		// 	if ( this.boundingSphere === null ) this.computeBoundingSphere();
+			if ( this.boundingSphere === null ) this.computeBoundingSphere();
 
-		// 	_sphere.copy( this.boundingSphere );
-		// 	_sphere.applyMatrix4( this.matrixWorld );
+			_sphere$3.copy( this.boundingSphere );
+			_sphere$3.applyMatrix4( matrixWorld );
 
-		// 	if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
+			if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
 
-		// 	this._computeIntersections( raycaster, intersects );
+			// convert ray to local space of skinned mesh
 
-		// }
+			_inverseMatrix$2.copy( matrixWorld ).invert();
+			_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
+
+			// test with bounding box in local space
+
+			if ( this.boundingBox !== null ) {
+
+				if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;
+
+			}
+
+			// test for intersections with geometry
+
+			this._computeIntersections( raycaster, intersects, _ray$2 );
+
+		}
 
 		getVertexPosition( index, target ) {
 
@@ -31647,6 +31795,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			this.count = source.count;
 
+			if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
+			if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
+
 			return this;
 
 		}
@@ -44162,6 +44313,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 					if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
 					if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
 					if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
+					if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
 
 					if ( data.userData !== undefined ) texture.userData = data.userData;
 
@@ -51046,6 +51198,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;
 	exports.AdditiveBlending = AdditiveBlending;
 	exports.AlphaFormat = AlphaFormat;
+	exports.AlwaysCompare = AlwaysCompare;
 	exports.AlwaysDepth = AlwaysDepth;
 	exports.AlwaysStencilFunc = AlwaysStencilFunc;
 	exports.AmbientLight = AmbientLight;
@@ -51145,6 +51298,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.DynamicReadUsage = DynamicReadUsage;
 	exports.EdgesGeometry = EdgesGeometry;
 	exports.EllipseCurve = EllipseCurve;
+	exports.EqualCompare = EqualCompare;
 	exports.EqualDepth = EqualDepth;
 	exports.EqualStencilFunc = EqualStencilFunc;
 	exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;
@@ -51166,7 +51320,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.GLBufferAttribute = GLBufferAttribute;
 	exports.GLSL1 = GLSL1;
 	exports.GLSL3 = GLSL3;
+	exports.GreaterCompare = GreaterCompare;
 	exports.GreaterDepth = GreaterDepth;
+	exports.GreaterEqualCompare = GreaterEqualCompare;
 	exports.GreaterEqualDepth = GreaterEqualDepth;
 	exports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;
 	exports.GreaterStencilFunc = GreaterStencilFunc;
@@ -51204,7 +51360,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.LatheBufferGeometry = LatheBufferGeometry;
 	exports.LatheGeometry = LatheGeometry;
 	exports.Layers = Layers;
+	exports.LessCompare = LessCompare;
 	exports.LessDepth = LessDepth;
+	exports.LessEqualCompare = LessEqualCompare;
 	exports.LessEqualDepth = LessEqualDepth;
 	exports.LessEqualStencilFunc = LessEqualStencilFunc;
 	exports.LessStencilFunc = LessStencilFunc;
@@ -51263,6 +51421,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;
 	exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;
 	exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
+	exports.NeverCompare = NeverCompare;
 	exports.NeverDepth = NeverDepth;
 	exports.NeverStencilFunc = NeverStencilFunc;
 	exports.NoBlending = NoBlending;
@@ -51270,6 +51429,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	exports.NoToneMapping = NoToneMapping;
 	exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
 	exports.NormalBlending = NormalBlending;
+	exports.NotEqualCompare = NotEqualCompare;
 	exports.NotEqualDepth = NotEqualDepth;
 	exports.NotEqualStencilFunc = NotEqualStencilFunc;
 	exports.NumberKeyframeTrack = NumberKeyframeTrack;

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


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


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