Browse Source

Updated builds.

Mr.doob 3 years ago
parent
commit
bf1848c31d
4 changed files with 375 additions and 259 deletions
  1. 117 83
      build/three.cjs
  2. 117 83
      build/three.js
  3. 0 0
      build/three.min.js
  4. 141 93
      build/three.module.js

+ 117 - 83
build/three.cjs

@@ -2510,15 +2510,6 @@ class WebGLRenderTarget extends EventDispatcher {
 		this.samples = options.samples !== undefined ? options.samples : 0;
 		this.samples = options.samples !== undefined ? options.samples : 0;
 	}
 	}
 
 
-	setTexture(texture) {
-		texture.image = {
-			width: this.width,
-			height: this.height,
-			depth: this.depth
-		};
-		this.texture = texture;
-	}
-
 	setSize(width, height, depth = 1) {
 	setSize(width, height, depth = 1) {
 		if (this.width !== width || this.height !== height || this.depth !== depth) {
 		if (this.width !== width || this.height !== height || this.depth !== depth) {
 			this.width = width;
 			this.width = width;
@@ -2563,6 +2554,79 @@ class WebGLRenderTarget extends EventDispatcher {
 
 
 WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
 WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
 
 
+class DataArrayTexture extends Texture {
+	constructor(data = null, width = 1, height = 1, depth = 1) {
+		super(null);
+		this.image = {
+			data,
+			width,
+			height,
+			depth
+		};
+		this.magFilter = NearestFilter;
+		this.minFilter = NearestFilter;
+		this.wrapR = ClampToEdgeWrapping;
+		this.generateMipmaps = false;
+		this.flipY = false;
+		this.unpackAlignment = 1;
+	}
+
+}
+
+DataArrayTexture.prototype.isDataArrayTexture = true;
+
+class WebGLArrayRenderTarget extends WebGLRenderTarget {
+	constructor(width, height, depth) {
+		super(width, height);
+		this.depth = depth;
+		this.texture = new DataArrayTexture(null, width, height, depth);
+		this.texture.isRenderTargetTexture = true;
+	}
+
+}
+
+WebGLArrayRenderTarget.prototype.isWebGLArrayRenderTarget = true;
+
+class Data3DTexture extends Texture {
+	constructor(data = null, width = 1, height = 1, depth = 1) {
+		// We're going to add .setXXX() methods for setting properties later.
+		// Users can still set in DataTexture3D directly.
+		//
+		//	const texture = new THREE.DataTexture3D( data, width, height, depth );
+		// 	texture.anisotropy = 16;
+		//
+		// See #14839
+		super(null);
+		this.image = {
+			data,
+			width,
+			height,
+			depth
+		};
+		this.magFilter = NearestFilter;
+		this.minFilter = NearestFilter;
+		this.wrapR = ClampToEdgeWrapping;
+		this.generateMipmaps = false;
+		this.flipY = false;
+		this.unpackAlignment = 1;
+	}
+
+}
+
+Data3DTexture.prototype.isData3DTexture = true;
+
+class WebGL3DRenderTarget extends WebGLRenderTarget {
+	constructor(width, height, depth) {
+		super(width, height);
+		this.depth = depth;
+		this.texture = new Data3DTexture(null, width, height, depth);
+		this.texture.isRenderTargetTexture = true;
+	}
+
+}
+
+WebGL3DRenderTarget.prototype.isWebGL3DRenderTarget = true;
+
 class WebGLMultipleRenderTargets extends WebGLRenderTarget {
 class WebGLMultipleRenderTargets extends WebGLRenderTarget {
 	constructor(width, height, count, options = {}) {
 	constructor(width, height, count, options = {}) {
 		super(width, height, options);
 		super(width, height, options);
@@ -11725,7 +11789,7 @@ class PMREMGenerator {
 		const height = 4 * this._cubeSize - 32;
 		const height = 4 * this._cubeSize - 32;
 		const params = {
 		const params = {
 			magFilter: LinearFilter,
 			magFilter: LinearFilter,
-			minFilter: NearestFilter,
+			minFilter: LinearFilter,
 			generateMipmaps: false,
 			generateMipmaps: false,
 			type: HalfFloatType,
 			type: HalfFloatType,
 			format: RGBAFormat,
 			format: RGBAFormat,
@@ -11886,10 +11950,15 @@ class PMREMGenerator {
 
 
 	_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {
 	_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {
 		const pingPongRenderTarget = this._pingPongRenderTarget;
 		const pingPongRenderTarget = this._pingPongRenderTarget;
+		cubeUVRenderTarget.texture.minFilter = NearestFilter;
+		pingPongRenderTarget.texture.minFilter = NearestFilter;
 
 
 		this._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);
 		this._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);
 
 
 		this._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);
 		this._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);
+
+		cubeUVRenderTarget.texture.minFilter = LinearFilter;
+		pingPongRenderTarget.texture.minFilter = LinearFilter;
 	}
 	}
 
 
 	_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {
 	_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {
@@ -12677,27 +12746,6 @@ function WebGLInfo(gl) {
 	};
 	};
 }
 }
 
 
-class DataTexture2DArray extends Texture {
-	constructor(data = null, width = 1, height = 1, depth = 1) {
-		super(null);
-		this.image = {
-			data,
-			width,
-			height,
-			depth
-		};
-		this.magFilter = NearestFilter;
-		this.minFilter = NearestFilter;
-		this.wrapR = ClampToEdgeWrapping;
-		this.generateMipmaps = false;
-		this.flipY = false;
-		this.unpackAlignment = 1;
-	}
-
-}
-
-DataTexture2DArray.prototype.isDataTexture2DArray = true;
-
 function numericalSort(a, b) {
 function numericalSort(a, b) {
 	return a[0] - b[0];
 	return a[0] - b[0];
 }
 }
@@ -12750,7 +12798,7 @@ function WebGLMorphtargets(gl, capabilities, textures) {
 				}
 				}
 
 
 				const buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);
 				const buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);
-				const texture = new DataTexture2DArray(buffer, width, height, numberOfMorphTargets);
+				const texture = new DataArrayTexture(buffer, width, height, numberOfMorphTargets);
 				texture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)
 				texture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)
 
 
 				texture.type = FloatType;
 				texture.type = FloatType;
@@ -12940,34 +12988,6 @@ function WebGLObjects(gl, geometries, attributes, info) {
 	};
 	};
 }
 }
 
 
-class DataTexture3D extends Texture {
-	constructor(data = null, width = 1, height = 1, depth = 1) {
-		// We're going to add .setXXX() methods for setting properties later.
-		// Users can still set in DataTexture3D directly.
-		//
-		//	const texture = new THREE.DataTexture3D( data, width, height, depth );
-		// 	texture.anisotropy = 16;
-		//
-		// See #14839
-		super(null);
-		this.image = {
-			data,
-			width,
-			height,
-			depth
-		};
-		this.magFilter = NearestFilter;
-		this.minFilter = NearestFilter;
-		this.wrapR = ClampToEdgeWrapping;
-		this.generateMipmaps = false;
-		this.flipY = false;
-		this.unpackAlignment = 1;
-	}
-
-}
-
-DataTexture3D.prototype.isDataTexture3D = true;
-
 /**
 /**
  * Uniforms of a program.
  * Uniforms of a program.
  * Those form a tree structure with a special top-level container for the root,
  * Those form a tree structure with a special top-level container for the root,
@@ -13011,8 +13031,8 @@ DataTexture3D.prototype.isDataTexture3D = true;
  *
  *
  */
  */
 const emptyTexture = new Texture();
 const emptyTexture = new Texture();
-const emptyTexture2dArray = new DataTexture2DArray();
-const emptyTexture3d = new DataTexture3D();
+const emptyArrayTexture = new DataArrayTexture();
+const empty3dTexture = new Data3DTexture();
 const emptyCubeTexture = new CubeTexture(); // --- Utilities ---
 const emptyCubeTexture = new CubeTexture(); // --- Utilities ---
 // Array Caches (provide typed arrays for temporary by size)
 // Array Caches (provide typed arrays for temporary by size)
 
 
@@ -13281,7 +13301,7 @@ function setValueT3D1(gl, v, textures) {
 		cache[0] = unit;
 		cache[0] = unit;
 	}
 	}
 
 
-	textures.setTexture3D(v || emptyTexture3d, unit);
+	textures.setTexture3D(v || empty3dTexture, unit);
 }
 }
 
 
 function setValueT6(gl, v, textures) {
 function setValueT6(gl, v, textures) {
@@ -13305,7 +13325,7 @@ function setValueT2DArray1(gl, v, textures) {
 		cache[0] = unit;
 		cache[0] = unit;
 	}
 	}
 
 
-	textures.setTexture2DArray(v || emptyTexture2dArray, unit);
+	textures.setTexture2DArray(v || emptyArrayTexture, unit);
 } // Helper to pick the right setter for the singular case
 } // Helper to pick the right setter for the singular case
 
 
 
 
@@ -13507,7 +13527,7 @@ function setValueT3DArray(gl, v, textures) {
 	gl.uniform1iv(this.addr, units);
 	gl.uniform1iv(this.addr, units);
 
 
 	for (let i = 0; i !== n; ++i) {
 	for (let i = 0; i !== n; ++i) {
-		textures.setTexture3D(v[i] || emptyTexture3d, units[i]);
+		textures.setTexture3D(v[i] || empty3dTexture, units[i]);
 	}
 	}
 }
 }
 
 
@@ -13527,7 +13547,7 @@ function setValueT2DArrayArray(gl, v, textures) {
 	gl.uniform1iv(this.addr, units);
 	gl.uniform1iv(this.addr, units);
 
 
 	for (let i = 0; i !== n; ++i) {
 	for (let i = 0; i !== n; ++i) {
-		textures.setTexture2DArray(v[i] || emptyTexture2dArray, units[i]);
+		textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]);
 	}
 	}
 } // Helper to pick the right setter for a pure (bottom-level) array
 } // Helper to pick the right setter for a pure (bottom-level) array
 
 
@@ -16965,8 +16985,8 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 
 
 	function uploadTexture(textureProperties, texture, slot) {
 	function uploadTexture(textureProperties, texture, slot) {
 		let textureType = _gl.TEXTURE_2D;
 		let textureType = _gl.TEXTURE_2D;
-		if (texture.isDataTexture2DArray) textureType = _gl.TEXTURE_2D_ARRAY;
-		if (texture.isDataTexture3D) textureType = _gl.TEXTURE_3D;
+		if (texture.isDataArrayTexture) textureType = _gl.TEXTURE_2D_ARRAY;
+		if (texture.isData3DTexture) textureType = _gl.TEXTURE_3D;
 		const forceUpload = initTexture(textureProperties, texture);
 		const forceUpload = initTexture(textureProperties, texture);
 		const source = texture.source;
 		const source = texture.source;
 		state.activeTexture(_gl.TEXTURE0 + slot);
 		state.activeTexture(_gl.TEXTURE0 + slot);
@@ -17104,7 +17124,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 						}
 						}
 					}
 					}
 				}
 				}
-			} else if (texture.isDataTexture2DArray) {
+			} else if (texture.isDataArrayTexture) {
 				if (useTexStorage) {
 				if (useTexStorage) {
 					if (allocateMemory) {
 					if (allocateMemory) {
 						state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth);
 						state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth);
@@ -17114,7 +17134,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 				} else {
 				} else {
 					state.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
 					state.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
 				}
 				}
-			} else if (texture.isDataTexture3D) {
+			} else if (texture.isData3DTexture) {
 				if (useTexStorage) {
 				if (useTexStorage) {
 					if (allocateMemory) {
 					if (allocateMemory) {
 						state.texStorage3D(_gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth);
 						state.texStorage3D(_gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth);
@@ -17494,7 +17514,6 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 
 
 		const isCube = renderTarget.isWebGLCubeRenderTarget === true;
 		const isCube = renderTarget.isWebGLCubeRenderTarget === true;
 		const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;
 		const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;
-		const isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray;
 		const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Setup framebuffer
 		const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Setup framebuffer
 
 
 		if (isCube) {
 		if (isCube) {
@@ -17582,13 +17601,11 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 		} else {
 		} else {
 			let glTextureType = _gl.TEXTURE_2D;
 			let glTextureType = _gl.TEXTURE_2D;
 
 
-			if (isRenderTarget3D) {
-				// Render targets containing layers, i.e: Texture 3D and 2d arrays
+			if (renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget) {
 				if (isWebGL2) {
 				if (isWebGL2) {
-					const isTexture3D = texture.isDataTexture3D;
-					glTextureType = isTexture3D ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;
+					glTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;
 				} else {
 				} else {
-					console.warn('THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.');
+					console.error('THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.');
 				}
 				}
 			}
 			}
 
 
@@ -19178,7 +19195,6 @@ function createCanvasElement() {
 function WebGLRenderer(parameters = {}) {
 function WebGLRenderer(parameters = {}) {
 	const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 	const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 				_context = parameters.context !== undefined ? parameters.context : null,
 				_context = parameters.context !== undefined ? parameters.context : null,
-				_alpha = parameters.alpha !== undefined ? parameters.alpha : false,
 				_depth = parameters.depth !== undefined ? parameters.depth : true,
 				_depth = parameters.depth !== undefined ? parameters.depth : true,
 				_stencil = parameters.stencil !== undefined ? parameters.stencil : true,
 				_stencil = parameters.stencil !== undefined ? parameters.stencil : true,
 				_antialias = parameters.antialias !== undefined ? parameters.antialias : false,
 				_antialias = parameters.antialias !== undefined ? parameters.antialias : false,
@@ -19187,6 +19203,14 @@ function WebGLRenderer(parameters = {}) {
 				_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',
 				_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',
 				_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;
 				_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;
 
 
+	let _alpha;
+
+	if (parameters.context !== undefined) {
+		_alpha = _context.getContextAttributes().alpha;
+	} else {
+		_alpha = parameters.alpha !== undefined ? parameters.alpha : false;
+	}
+
 	let currentRenderList = null;
 	let currentRenderList = null;
 	let currentRenderState = null; // render() can be called from within a callback triggered by another render.
 	let currentRenderState = null; // render() can be called from within a callback triggered by another render.
 	// We track this so that the nested render call gets its list and state isolated from the parent render call.
 	// We track this so that the nested render call gets its list and state isolated from the parent render call.
@@ -20393,7 +20417,7 @@ function WebGLRenderer(parameters = {}) {
 		if (renderTarget) {
 		if (renderTarget) {
 			const texture = renderTarget.texture;
 			const texture = renderTarget.texture;
 
 
-			if (texture.isDataTexture3D || texture.isDataTexture2DArray) {
+			if (texture.isData3DTexture || texture.isDataArrayTexture) {
 				isRenderTarget3D = true;
 				isRenderTarget3D = true;
 			}
 			}
 
 
@@ -20553,10 +20577,10 @@ function WebGLRenderer(parameters = {}) {
 		const glType = utils.convert(dstTexture.type);
 		const glType = utils.convert(dstTexture.type);
 		let glTarget;
 		let glTarget;
 
 
-		if (dstTexture.isDataTexture3D) {
+		if (dstTexture.isData3DTexture) {
 			textures.setTexture3D(dstTexture, 0);
 			textures.setTexture3D(dstTexture, 0);
 			glTarget = _gl.TEXTURE_3D;
 			glTarget = _gl.TEXTURE_3D;
-		} else if (dstTexture.isDataTexture2DArray) {
+		} else if (dstTexture.isDataArrayTexture) {
 			textures.setTexture2DArray(dstTexture, 0);
 			textures.setTexture2DArray(dstTexture, 0);
 			glTarget = _gl.TEXTURE_2D_ARRAY;
 			glTarget = _gl.TEXTURE_2D_ARRAY;
 		} else {
 		} else {
@@ -20592,7 +20616,7 @@ function WebGLRenderer(parameters = {}) {
 
 
 		_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);
 		_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);
 
 
-		if (srcTexture.isDataTexture || srcTexture.isDataTexture3D) {
+		if (srcTexture.isDataTexture || srcTexture.isData3DTexture) {
 			_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);
 			_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);
 		} else {
 		} else {
 			if (srcTexture.isCompressedTexture) {
 			if (srcTexture.isCompressedTexture) {
@@ -21466,8 +21490,6 @@ class DataTexture extends Texture {
 			width: width,
 			width: width,
 			height: height
 			height: height
 		};
 		};
-		this.magFilter = magFilter;
-		this.minFilter = minFilter;
 		this.generateMipmaps = false;
 		this.generateMipmaps = false;
 		this.flipY = false;
 		this.flipY = false;
 		this.unpackAlignment = 1;
 		this.unpackAlignment = 1;
@@ -36443,6 +36465,14 @@ function WebGLMultisampleRenderTarget(width, height, options) {
 	renderTarget.samples = 4;
 	renderTarget.samples = 4;
 	return renderTarget;
 	return renderTarget;
 }
 }
+function DataTexture2DArray(data, width, height, depth) {
+	console.warn('THREE.DataTexture2DArray has been renamed to DataArrayTexture.');
+	return new DataArrayTexture(data, width, height, depth);
+}
+function DataTexture3D(data, width, height, depth) {
+	console.warn('THREE.DataTexture3D has been renamed to Data3DTexture.');
+	return new Data3DTexture(data, width, height, depth);
+}
 
 
 if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 	__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {
 	__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {
@@ -36540,6 +36570,8 @@ exports.CustomToneMapping = CustomToneMapping;
 exports.CylinderBufferGeometry = CylinderGeometry;
 exports.CylinderBufferGeometry = CylinderGeometry;
 exports.CylinderGeometry = CylinderGeometry;
 exports.CylinderGeometry = CylinderGeometry;
 exports.Cylindrical = Cylindrical;
 exports.Cylindrical = Cylindrical;
+exports.Data3DTexture = Data3DTexture;
+exports.DataArrayTexture = DataArrayTexture;
 exports.DataTexture = DataTexture;
 exports.DataTexture = DataTexture;
 exports.DataTexture2DArray = DataTexture2DArray;
 exports.DataTexture2DArray = DataTexture2DArray;
 exports.DataTexture3D = DataTexture3D;
 exports.DataTexture3D = DataTexture3D;
@@ -36880,6 +36912,8 @@ exports.Vertex = Vertex;
 exports.VertexColors = VertexColors;
 exports.VertexColors = VertexColors;
 exports.VideoTexture = VideoTexture;
 exports.VideoTexture = VideoTexture;
 exports.WebGL1Renderer = WebGL1Renderer;
 exports.WebGL1Renderer = WebGL1Renderer;
+exports.WebGL3DRenderTarget = WebGL3DRenderTarget;
+exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget;
 exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
 exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
 exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
 exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
 exports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;
 exports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;

+ 117 - 83
build/three.js

@@ -2512,15 +2512,6 @@
 			this.samples = options.samples !== undefined ? options.samples : 0;
 			this.samples = options.samples !== undefined ? options.samples : 0;
 		}
 		}
 
 
-		setTexture(texture) {
-			texture.image = {
-				width: this.width,
-				height: this.height,
-				depth: this.depth
-			};
-			this.texture = texture;
-		}
-
 		setSize(width, height, depth = 1) {
 		setSize(width, height, depth = 1) {
 			if (this.width !== width || this.height !== height || this.depth !== depth) {
 			if (this.width !== width || this.height !== height || this.depth !== depth) {
 				this.width = width;
 				this.width = width;
@@ -2565,6 +2556,79 @@
 
 
 	WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
 	WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
 
 
+	class DataArrayTexture extends Texture {
+		constructor(data = null, width = 1, height = 1, depth = 1) {
+			super(null);
+			this.image = {
+				data,
+				width,
+				height,
+				depth
+			};
+			this.magFilter = NearestFilter;
+			this.minFilter = NearestFilter;
+			this.wrapR = ClampToEdgeWrapping;
+			this.generateMipmaps = false;
+			this.flipY = false;
+			this.unpackAlignment = 1;
+		}
+
+	}
+
+	DataArrayTexture.prototype.isDataArrayTexture = true;
+
+	class WebGLArrayRenderTarget extends WebGLRenderTarget {
+		constructor(width, height, depth) {
+			super(width, height);
+			this.depth = depth;
+			this.texture = new DataArrayTexture(null, width, height, depth);
+			this.texture.isRenderTargetTexture = true;
+		}
+
+	}
+
+	WebGLArrayRenderTarget.prototype.isWebGLArrayRenderTarget = true;
+
+	class Data3DTexture extends Texture {
+		constructor(data = null, width = 1, height = 1, depth = 1) {
+			// We're going to add .setXXX() methods for setting properties later.
+			// Users can still set in DataTexture3D directly.
+			//
+			//	const texture = new THREE.DataTexture3D( data, width, height, depth );
+			// 	texture.anisotropy = 16;
+			//
+			// See #14839
+			super(null);
+			this.image = {
+				data,
+				width,
+				height,
+				depth
+			};
+			this.magFilter = NearestFilter;
+			this.minFilter = NearestFilter;
+			this.wrapR = ClampToEdgeWrapping;
+			this.generateMipmaps = false;
+			this.flipY = false;
+			this.unpackAlignment = 1;
+		}
+
+	}
+
+	Data3DTexture.prototype.isData3DTexture = true;
+
+	class WebGL3DRenderTarget extends WebGLRenderTarget {
+		constructor(width, height, depth) {
+			super(width, height);
+			this.depth = depth;
+			this.texture = new Data3DTexture(null, width, height, depth);
+			this.texture.isRenderTargetTexture = true;
+		}
+
+	}
+
+	WebGL3DRenderTarget.prototype.isWebGL3DRenderTarget = true;
+
 	class WebGLMultipleRenderTargets extends WebGLRenderTarget {
 	class WebGLMultipleRenderTargets extends WebGLRenderTarget {
 		constructor(width, height, count, options = {}) {
 		constructor(width, height, count, options = {}) {
 			super(width, height, options);
 			super(width, height, options);
@@ -11727,7 +11791,7 @@
 			const height = 4 * this._cubeSize - 32;
 			const height = 4 * this._cubeSize - 32;
 			const params = {
 			const params = {
 				magFilter: LinearFilter,
 				magFilter: LinearFilter,
-				minFilter: NearestFilter,
+				minFilter: LinearFilter,
 				generateMipmaps: false,
 				generateMipmaps: false,
 				type: HalfFloatType,
 				type: HalfFloatType,
 				format: RGBAFormat,
 				format: RGBAFormat,
@@ -11888,10 +11952,15 @@
 
 
 		_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {
 		_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {
 			const pingPongRenderTarget = this._pingPongRenderTarget;
 			const pingPongRenderTarget = this._pingPongRenderTarget;
+			cubeUVRenderTarget.texture.minFilter = NearestFilter;
+			pingPongRenderTarget.texture.minFilter = NearestFilter;
 
 
 			this._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);
 			this._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);
 
 
 			this._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);
 			this._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);
+
+			cubeUVRenderTarget.texture.minFilter = LinearFilter;
+			pingPongRenderTarget.texture.minFilter = LinearFilter;
 		}
 		}
 
 
 		_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {
 		_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {
@@ -12679,27 +12748,6 @@
 		};
 		};
 	}
 	}
 
 
-	class DataTexture2DArray extends Texture {
-		constructor(data = null, width = 1, height = 1, depth = 1) {
-			super(null);
-			this.image = {
-				data,
-				width,
-				height,
-				depth
-			};
-			this.magFilter = NearestFilter;
-			this.minFilter = NearestFilter;
-			this.wrapR = ClampToEdgeWrapping;
-			this.generateMipmaps = false;
-			this.flipY = false;
-			this.unpackAlignment = 1;
-		}
-
-	}
-
-	DataTexture2DArray.prototype.isDataTexture2DArray = true;
-
 	function numericalSort(a, b) {
 	function numericalSort(a, b) {
 		return a[0] - b[0];
 		return a[0] - b[0];
 	}
 	}
@@ -12752,7 +12800,7 @@
 					}
 					}
 
 
 					const buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);
 					const buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);
-					const texture = new DataTexture2DArray(buffer, width, height, numberOfMorphTargets);
+					const texture = new DataArrayTexture(buffer, width, height, numberOfMorphTargets);
 					texture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)
 					texture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)
 
 
 					texture.type = FloatType;
 					texture.type = FloatType;
@@ -12942,34 +12990,6 @@
 		};
 		};
 	}
 	}
 
 
-	class DataTexture3D extends Texture {
-		constructor(data = null, width = 1, height = 1, depth = 1) {
-			// We're going to add .setXXX() methods for setting properties later.
-			// Users can still set in DataTexture3D directly.
-			//
-			//	const texture = new THREE.DataTexture3D( data, width, height, depth );
-			// 	texture.anisotropy = 16;
-			//
-			// See #14839
-			super(null);
-			this.image = {
-				data,
-				width,
-				height,
-				depth
-			};
-			this.magFilter = NearestFilter;
-			this.minFilter = NearestFilter;
-			this.wrapR = ClampToEdgeWrapping;
-			this.generateMipmaps = false;
-			this.flipY = false;
-			this.unpackAlignment = 1;
-		}
-
-	}
-
-	DataTexture3D.prototype.isDataTexture3D = true;
-
 	/**
 	/**
 	 * Uniforms of a program.
 	 * Uniforms of a program.
 	 * Those form a tree structure with a special top-level container for the root,
 	 * Those form a tree structure with a special top-level container for the root,
@@ -13013,8 +13033,8 @@
 	 *
 	 *
 	 */
 	 */
 	const emptyTexture = new Texture();
 	const emptyTexture = new Texture();
-	const emptyTexture2dArray = new DataTexture2DArray();
-	const emptyTexture3d = new DataTexture3D();
+	const emptyArrayTexture = new DataArrayTexture();
+	const empty3dTexture = new Data3DTexture();
 	const emptyCubeTexture = new CubeTexture(); // --- Utilities ---
 	const emptyCubeTexture = new CubeTexture(); // --- Utilities ---
 	// Array Caches (provide typed arrays for temporary by size)
 	// Array Caches (provide typed arrays for temporary by size)
 
 
@@ -13283,7 +13303,7 @@
 			cache[0] = unit;
 			cache[0] = unit;
 		}
 		}
 
 
-		textures.setTexture3D(v || emptyTexture3d, unit);
+		textures.setTexture3D(v || empty3dTexture, unit);
 	}
 	}
 
 
 	function setValueT6(gl, v, textures) {
 	function setValueT6(gl, v, textures) {
@@ -13307,7 +13327,7 @@
 			cache[0] = unit;
 			cache[0] = unit;
 		}
 		}
 
 
-		textures.setTexture2DArray(v || emptyTexture2dArray, unit);
+		textures.setTexture2DArray(v || emptyArrayTexture, unit);
 	} // Helper to pick the right setter for the singular case
 	} // Helper to pick the right setter for the singular case
 
 
 
 
@@ -13509,7 +13529,7 @@
 		gl.uniform1iv(this.addr, units);
 		gl.uniform1iv(this.addr, units);
 
 
 		for (let i = 0; i !== n; ++i) {
 		for (let i = 0; i !== n; ++i) {
-			textures.setTexture3D(v[i] || emptyTexture3d, units[i]);
+			textures.setTexture3D(v[i] || empty3dTexture, units[i]);
 		}
 		}
 	}
 	}
 
 
@@ -13529,7 +13549,7 @@
 		gl.uniform1iv(this.addr, units);
 		gl.uniform1iv(this.addr, units);
 
 
 		for (let i = 0; i !== n; ++i) {
 		for (let i = 0; i !== n; ++i) {
-			textures.setTexture2DArray(v[i] || emptyTexture2dArray, units[i]);
+			textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]);
 		}
 		}
 	} // Helper to pick the right setter for a pure (bottom-level) array
 	} // Helper to pick the right setter for a pure (bottom-level) array
 
 
@@ -16967,8 +16987,8 @@
 
 
 		function uploadTexture(textureProperties, texture, slot) {
 		function uploadTexture(textureProperties, texture, slot) {
 			let textureType = _gl.TEXTURE_2D;
 			let textureType = _gl.TEXTURE_2D;
-			if (texture.isDataTexture2DArray) textureType = _gl.TEXTURE_2D_ARRAY;
-			if (texture.isDataTexture3D) textureType = _gl.TEXTURE_3D;
+			if (texture.isDataArrayTexture) textureType = _gl.TEXTURE_2D_ARRAY;
+			if (texture.isData3DTexture) textureType = _gl.TEXTURE_3D;
 			const forceUpload = initTexture(textureProperties, texture);
 			const forceUpload = initTexture(textureProperties, texture);
 			const source = texture.source;
 			const source = texture.source;
 			state.activeTexture(_gl.TEXTURE0 + slot);
 			state.activeTexture(_gl.TEXTURE0 + slot);
@@ -17106,7 +17126,7 @@
 							}
 							}
 						}
 						}
 					}
 					}
-				} else if (texture.isDataTexture2DArray) {
+				} else if (texture.isDataArrayTexture) {
 					if (useTexStorage) {
 					if (useTexStorage) {
 						if (allocateMemory) {
 						if (allocateMemory) {
 							state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth);
 							state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth);
@@ -17116,7 +17136,7 @@
 					} else {
 					} else {
 						state.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
 						state.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
 					}
 					}
-				} else if (texture.isDataTexture3D) {
+				} else if (texture.isData3DTexture) {
 					if (useTexStorage) {
 					if (useTexStorage) {
 						if (allocateMemory) {
 						if (allocateMemory) {
 							state.texStorage3D(_gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth);
 							state.texStorage3D(_gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth);
@@ -17496,7 +17516,6 @@
 
 
 			const isCube = renderTarget.isWebGLCubeRenderTarget === true;
 			const isCube = renderTarget.isWebGLCubeRenderTarget === true;
 			const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;
 			const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;
-			const isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray;
 			const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Setup framebuffer
 			const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Setup framebuffer
 
 
 			if (isCube) {
 			if (isCube) {
@@ -17584,13 +17603,11 @@
 			} else {
 			} else {
 				let glTextureType = _gl.TEXTURE_2D;
 				let glTextureType = _gl.TEXTURE_2D;
 
 
-				if (isRenderTarget3D) {
-					// Render targets containing layers, i.e: Texture 3D and 2d arrays
+				if (renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget) {
 					if (isWebGL2) {
 					if (isWebGL2) {
-						const isTexture3D = texture.isDataTexture3D;
-						glTextureType = isTexture3D ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;
+						glTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;
 					} else {
 					} else {
-						console.warn('THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.');
+						console.error('THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.');
 					}
 					}
 				}
 				}
 
 
@@ -19180,7 +19197,6 @@
 	function WebGLRenderer(parameters = {}) {
 	function WebGLRenderer(parameters = {}) {
 		const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 		const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 					_context = parameters.context !== undefined ? parameters.context : null,
 					_context = parameters.context !== undefined ? parameters.context : null,
-					_alpha = parameters.alpha !== undefined ? parameters.alpha : false,
 					_depth = parameters.depth !== undefined ? parameters.depth : true,
 					_depth = parameters.depth !== undefined ? parameters.depth : true,
 					_stencil = parameters.stencil !== undefined ? parameters.stencil : true,
 					_stencil = parameters.stencil !== undefined ? parameters.stencil : true,
 					_antialias = parameters.antialias !== undefined ? parameters.antialias : false,
 					_antialias = parameters.antialias !== undefined ? parameters.antialias : false,
@@ -19189,6 +19205,14 @@
 					_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',
 					_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',
 					_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;
 					_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;
 
 
+		let _alpha;
+
+		if (parameters.context !== undefined) {
+			_alpha = _context.getContextAttributes().alpha;
+		} else {
+			_alpha = parameters.alpha !== undefined ? parameters.alpha : false;
+		}
+
 		let currentRenderList = null;
 		let currentRenderList = null;
 		let currentRenderState = null; // render() can be called from within a callback triggered by another render.
 		let currentRenderState = null; // render() can be called from within a callback triggered by another render.
 		// We track this so that the nested render call gets its list and state isolated from the parent render call.
 		// We track this so that the nested render call gets its list and state isolated from the parent render call.
@@ -20395,7 +20419,7 @@
 			if (renderTarget) {
 			if (renderTarget) {
 				const texture = renderTarget.texture;
 				const texture = renderTarget.texture;
 
 
-				if (texture.isDataTexture3D || texture.isDataTexture2DArray) {
+				if (texture.isData3DTexture || texture.isDataArrayTexture) {
 					isRenderTarget3D = true;
 					isRenderTarget3D = true;
 				}
 				}
 
 
@@ -20555,10 +20579,10 @@
 			const glType = utils.convert(dstTexture.type);
 			const glType = utils.convert(dstTexture.type);
 			let glTarget;
 			let glTarget;
 
 
-			if (dstTexture.isDataTexture3D) {
+			if (dstTexture.isData3DTexture) {
 				textures.setTexture3D(dstTexture, 0);
 				textures.setTexture3D(dstTexture, 0);
 				glTarget = _gl.TEXTURE_3D;
 				glTarget = _gl.TEXTURE_3D;
-			} else if (dstTexture.isDataTexture2DArray) {
+			} else if (dstTexture.isDataArrayTexture) {
 				textures.setTexture2DArray(dstTexture, 0);
 				textures.setTexture2DArray(dstTexture, 0);
 				glTarget = _gl.TEXTURE_2D_ARRAY;
 				glTarget = _gl.TEXTURE_2D_ARRAY;
 			} else {
 			} else {
@@ -20594,7 +20618,7 @@
 
 
 			_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);
 			_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);
 
 
-			if (srcTexture.isDataTexture || srcTexture.isDataTexture3D) {
+			if (srcTexture.isDataTexture || srcTexture.isData3DTexture) {
 				_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);
 				_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);
 			} else {
 			} else {
 				if (srcTexture.isCompressedTexture) {
 				if (srcTexture.isCompressedTexture) {
@@ -21468,8 +21492,6 @@
 				width: width,
 				width: width,
 				height: height
 				height: height
 			};
 			};
-			this.magFilter = magFilter;
-			this.minFilter = minFilter;
 			this.generateMipmaps = false;
 			this.generateMipmaps = false;
 			this.flipY = false;
 			this.flipY = false;
 			this.unpackAlignment = 1;
 			this.unpackAlignment = 1;
@@ -36445,6 +36467,14 @@
 		renderTarget.samples = 4;
 		renderTarget.samples = 4;
 		return renderTarget;
 		return renderTarget;
 	}
 	}
+	function DataTexture2DArray(data, width, height, depth) {
+		console.warn('THREE.DataTexture2DArray has been renamed to DataArrayTexture.');
+		return new DataArrayTexture(data, width, height, depth);
+	}
+	function DataTexture3D(data, width, height, depth) {
+		console.warn('THREE.DataTexture3D has been renamed to Data3DTexture.');
+		return new Data3DTexture(data, width, height, depth);
+	}
 
 
 	if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 	if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 		__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {
 		__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {
@@ -36542,6 +36572,8 @@
 	exports.CylinderBufferGeometry = CylinderGeometry;
 	exports.CylinderBufferGeometry = CylinderGeometry;
 	exports.CylinderGeometry = CylinderGeometry;
 	exports.CylinderGeometry = CylinderGeometry;
 	exports.Cylindrical = Cylindrical;
 	exports.Cylindrical = Cylindrical;
+	exports.Data3DTexture = Data3DTexture;
+	exports.DataArrayTexture = DataArrayTexture;
 	exports.DataTexture = DataTexture;
 	exports.DataTexture = DataTexture;
 	exports.DataTexture2DArray = DataTexture2DArray;
 	exports.DataTexture2DArray = DataTexture2DArray;
 	exports.DataTexture3D = DataTexture3D;
 	exports.DataTexture3D = DataTexture3D;
@@ -36882,6 +36914,8 @@
 	exports.VertexColors = VertexColors;
 	exports.VertexColors = VertexColors;
 	exports.VideoTexture = VideoTexture;
 	exports.VideoTexture = VideoTexture;
 	exports.WebGL1Renderer = WebGL1Renderer;
 	exports.WebGL1Renderer = WebGL1Renderer;
+	exports.WebGL3DRenderTarget = WebGL3DRenderTarget;
+	exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget;
 	exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
 	exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
 	exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
 	exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
 	exports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;
 	exports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;

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


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


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