2
0
Mr.doob 3 жил өмнө
parent
commit
f36cd729fe
4 өөрчлөгдсөн 45 нэмэгдсэн , 100 устгасан
  1. 16 33
      build/three.cjs
  2. 16 33
      build/three.js
  3. 0 0
      build/three.min.js
  4. 13 34
      build/three.module.js

+ 16 - 33
build/three.cjs

@@ -7307,9 +7307,7 @@ class BufferAttribute {
 
 	applyMatrix4(m) {
 		for (let i = 0, l = this.count; i < l; i++) {
-			_vector$9.x = this.getX(i);
-			_vector$9.y = this.getY(i);
-			_vector$9.z = this.getZ(i);
+			_vector$9.fromBufferAttribute(this, i);
 
 			_vector$9.applyMatrix4(m);
 
@@ -7321,9 +7319,7 @@ class BufferAttribute {
 
 	applyNormalMatrix(m) {
 		for (let i = 0, l = this.count; i < l; i++) {
-			_vector$9.x = this.getX(i);
-			_vector$9.y = this.getY(i);
-			_vector$9.z = this.getZ(i);
+			_vector$9.fromBufferAttribute(this, i);
 
 			_vector$9.applyNormalMatrix(m);
 
@@ -7335,9 +7331,7 @@ class BufferAttribute {
 
 	transformDirection(m) {
 		for (let i = 0, l = this.count; i < l; i++) {
-			_vector$9.x = this.getX(i);
-			_vector$9.y = this.getY(i);
-			_vector$9.z = this.getZ(i);
+			_vector$9.fromBufferAttribute(this, i);
 
 			_vector$9.transformDirection(m);
 
@@ -10039,7 +10033,7 @@ var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 =
 var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
 
 const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
-const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 const fragment$f = "#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
@@ -16592,13 +16586,15 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 	let useOffscreenCanvas = false;
 
 	try {
-		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' && new OffscreenCanvas(1, 1).getContext('2d') !== null;
+		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' // eslint-disable-next-line compat/compat
+		&& new OffscreenCanvas(1, 1).getContext('2d') !== null;
 	} catch (err) {// Ignore any errors
 	}
 
 	function createCanvas(width, height) {
 		// Use OffscreenCanvas when available. Specially needed in web workers
-		return useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS('canvas');
+		return useOffscreenCanvas ? // eslint-disable-next-line compat/compat
+		new OffscreenCanvas(width, height) : createElementNS('canvas');
 	}
 
 	function resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {
@@ -20452,15 +20448,11 @@ function WebGLRenderer(parameters = {}) {
 				!halfFloatSupportedByExt) {
 					console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');
 					return;
-				}
+				} // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
 
-				if (_gl.checkFramebufferStatus(_gl.FRAMEBUFFER) === _gl.FRAMEBUFFER_COMPLETE) {
-					// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
-					if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
-						_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
-					}
-				} else {
-					console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');
+
+				if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
+					_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
 				}
 			} finally {
 				// restore framebuffer of current render target if necessary
@@ -20831,9 +20823,7 @@ class InterleavedBufferAttribute {
 
 	applyMatrix4(m) {
 		for (let i = 0, l = this.data.count; i < l; i++) {
-			_vector$6.x = this.getX(i);
-			_vector$6.y = this.getY(i);
-			_vector$6.z = this.getZ(i);
+			_vector$6.fromBufferAttribute(this, i);
 
 			_vector$6.applyMatrix4(m);
 
@@ -20845,9 +20835,7 @@ class InterleavedBufferAttribute {
 
 	applyNormalMatrix(m) {
 		for (let i = 0, l = this.count; i < l; i++) {
-			_vector$6.x = this.getX(i);
-			_vector$6.y = this.getY(i);
-			_vector$6.z = this.getZ(i);
+			_vector$6.fromBufferAttribute(this, i);
 
 			_vector$6.applyNormalMatrix(m);
 
@@ -20859,9 +20847,7 @@ class InterleavedBufferAttribute {
 
 	transformDirection(m) {
 		for (let i = 0, l = this.count; i < l; i++) {
-			_vector$6.x = this.getX(i);
-			_vector$6.y = this.getY(i);
-			_vector$6.z = this.getZ(i);
+			_vector$6.fromBufferAttribute(this, i);
 
 			_vector$6.transformDirection(m);
 
@@ -21354,10 +21340,7 @@ class SkinnedMesh extends Mesh {
 		const skinWeight = this.geometry.attributes.skinWeight;
 
 		for (let i = 0, l = skinWeight.count; i < l; i++) {
-			vector.x = skinWeight.getX(i);
-			vector.y = skinWeight.getY(i);
-			vector.z = skinWeight.getZ(i);
-			vector.w = skinWeight.getW(i);
+			vector.fromBufferAttribute(skinWeight, i);
 			const scale = 1.0 / vector.manhattanLength();
 
 			if (scale !== Infinity) {

+ 16 - 33
build/three.js

@@ -7309,9 +7309,7 @@
 
 		applyMatrix4(m) {
 			for (let i = 0, l = this.count; i < l; i++) {
-				_vector$9.x = this.getX(i);
-				_vector$9.y = this.getY(i);
-				_vector$9.z = this.getZ(i);
+				_vector$9.fromBufferAttribute(this, i);
 
 				_vector$9.applyMatrix4(m);
 
@@ -7323,9 +7321,7 @@
 
 		applyNormalMatrix(m) {
 			for (let i = 0, l = this.count; i < l; i++) {
-				_vector$9.x = this.getX(i);
-				_vector$9.y = this.getY(i);
-				_vector$9.z = this.getZ(i);
+				_vector$9.fromBufferAttribute(this, i);
 
 				_vector$9.applyNormalMatrix(m);
 
@@ -7337,9 +7333,7 @@
 
 		transformDirection(m) {
 			for (let i = 0, l = this.count; i < l; i++) {
-				_vector$9.x = this.getX(i);
-				_vector$9.y = this.getY(i);
-				_vector$9.z = this.getZ(i);
+				_vector$9.fromBufferAttribute(this, i);
 
 				_vector$9.transformDirection(m);
 
@@ -10041,7 +10035,7 @@
 	var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
 
 	const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
-	const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+	const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 	const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 	const fragment$f = "#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
@@ -16594,13 +16588,15 @@
 		let useOffscreenCanvas = false;
 
 		try {
-			useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' && new OffscreenCanvas(1, 1).getContext('2d') !== null;
+			useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' // eslint-disable-next-line compat/compat
+			&& new OffscreenCanvas(1, 1).getContext('2d') !== null;
 		} catch (err) {// Ignore any errors
 		}
 
 		function createCanvas(width, height) {
 			// Use OffscreenCanvas when available. Specially needed in web workers
-			return useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS('canvas');
+			return useOffscreenCanvas ? // eslint-disable-next-line compat/compat
+			new OffscreenCanvas(width, height) : createElementNS('canvas');
 		}
 
 		function resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {
@@ -20454,15 +20450,11 @@
 					!halfFloatSupportedByExt) {
 						console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');
 						return;
-					}
+					} // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
 
-					if (_gl.checkFramebufferStatus(_gl.FRAMEBUFFER) === _gl.FRAMEBUFFER_COMPLETE) {
-						// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
-						if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
-							_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
-						}
-					} else {
-						console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');
+
+					if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
+						_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
 					}
 				} finally {
 					// restore framebuffer of current render target if necessary
@@ -20833,9 +20825,7 @@
 
 		applyMatrix4(m) {
 			for (let i = 0, l = this.data.count; i < l; i++) {
-				_vector$6.x = this.getX(i);
-				_vector$6.y = this.getY(i);
-				_vector$6.z = this.getZ(i);
+				_vector$6.fromBufferAttribute(this, i);
 
 				_vector$6.applyMatrix4(m);
 
@@ -20847,9 +20837,7 @@
 
 		applyNormalMatrix(m) {
 			for (let i = 0, l = this.count; i < l; i++) {
-				_vector$6.x = this.getX(i);
-				_vector$6.y = this.getY(i);
-				_vector$6.z = this.getZ(i);
+				_vector$6.fromBufferAttribute(this, i);
 
 				_vector$6.applyNormalMatrix(m);
 
@@ -20861,9 +20849,7 @@
 
 		transformDirection(m) {
 			for (let i = 0, l = this.count; i < l; i++) {
-				_vector$6.x = this.getX(i);
-				_vector$6.y = this.getY(i);
-				_vector$6.z = this.getZ(i);
+				_vector$6.fromBufferAttribute(this, i);
 
 				_vector$6.transformDirection(m);
 
@@ -21356,10 +21342,7 @@
 			const skinWeight = this.geometry.attributes.skinWeight;
 
 			for (let i = 0, l = skinWeight.count; i < l; i++) {
-				vector.x = skinWeight.getX(i);
-				vector.y = skinWeight.getY(i);
-				vector.z = skinWeight.getZ(i);
-				vector.w = skinWeight.getW(i);
+				vector.fromBufferAttribute(skinWeight, i);
 				const scale = 1.0 / vector.manhattanLength();
 
 				if (scale !== Infinity) {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
build/three.min.js


+ 13 - 34
build/three.module.js

@@ -9517,9 +9517,7 @@ class BufferAttribute {
 
 		for ( let i = 0, l = this.count; i < l; i ++ ) {
 
-			_vector$9.x = this.getX( i );
-			_vector$9.y = this.getY( i );
-			_vector$9.z = this.getZ( i );
+			_vector$9.fromBufferAttribute( this, i );
 
 			_vector$9.applyMatrix4( m );
 
@@ -9535,9 +9533,7 @@ class BufferAttribute {
 
 		for ( let i = 0, l = this.count; i < l; i ++ ) {
 
-			_vector$9.x = this.getX( i );
-			_vector$9.y = this.getY( i );
-			_vector$9.z = this.getZ( i );
+			_vector$9.fromBufferAttribute( this, i );
 
 			_vector$9.applyNormalMatrix( m );
 
@@ -9553,9 +9549,7 @@ class BufferAttribute {
 
 		for ( let i = 0, l = this.count; i < l; i ++ ) {
 
-			_vector$9.x = this.getX( i );
-			_vector$9.y = this.getY( i );
-			_vector$9.z = this.getZ( i );
+			_vector$9.fromBufferAttribute( this, i );
 
 			_vector$9.transformDirection( m );
 
@@ -13202,7 +13196,7 @@ var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defin
 
 const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 
-const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 
@@ -22330,6 +22324,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 	try {
 
 		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
+			// eslint-disable-next-line compat/compat
 			&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;
 
 	} catch ( err ) {
@@ -22343,6 +22338,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		// Use OffscreenCanvas when available. Specially needed in web workers
 
 		return useOffscreenCanvas ?
+			// eslint-disable-next-line compat/compat
 			new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
 
 	}
@@ -27983,19 +27979,11 @@ function WebGLRenderer( parameters = {} ) {
 
 				}
 
-				if ( _gl.checkFramebufferStatus( 36160 ) === 36053 ) {
+				// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
 
-					// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
+				if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
 
-					if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
-
-						_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );
-
-					}
-
-				} else {
-
-					console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' );
+					_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );
 
 				}
 
@@ -28488,9 +28476,7 @@ class InterleavedBufferAttribute {
 
 		for ( let i = 0, l = this.data.count; i < l; i ++ ) {
 
-			_vector$6.x = this.getX( i );
-			_vector$6.y = this.getY( i );
-			_vector$6.z = this.getZ( i );
+			_vector$6.fromBufferAttribute( this, i );
 
 			_vector$6.applyMatrix4( m );
 
@@ -28506,9 +28492,7 @@ class InterleavedBufferAttribute {
 
 		for ( let i = 0, l = this.count; i < l; i ++ ) {
 
-			_vector$6.x = this.getX( i );
-			_vector$6.y = this.getY( i );
-			_vector$6.z = this.getZ( i );
+			_vector$6.fromBufferAttribute( this, i );
 
 			_vector$6.applyNormalMatrix( m );
 
@@ -28524,9 +28508,7 @@ class InterleavedBufferAttribute {
 
 		for ( let i = 0, l = this.count; i < l; i ++ ) {
 
-			_vector$6.x = this.getX( i );
-			_vector$6.y = this.getY( i );
-			_vector$6.z = this.getZ( i );
+			_vector$6.fromBufferAttribute( this, i );
 
 			_vector$6.transformDirection( m );
 
@@ -29208,10 +29190,7 @@ class SkinnedMesh extends Mesh {
 
 		for ( let i = 0, l = skinWeight.count; i < l; i ++ ) {
 
-			vector.x = skinWeight.getX( i );
-			vector.y = skinWeight.getY( i );
-			vector.z = skinWeight.getZ( i );
-			vector.w = skinWeight.getW( i );
+			vector.fromBufferAttribute( skinWeight, i );
 
 			const scale = 1.0 / vector.manhattanLength();
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно