瀏覽代碼

Updated builds.

Mr.doob 3 年之前
父節點
當前提交
d0c062656d
共有 4 個文件被更改,包括 364 次插入1204 次删除
  1. 112 402
      build/three.cjs
  2. 112 402
      build/three.js
  3. 0 0
      build/three.min.js
  4. 140 400
      build/three.module.js

+ 112 - 402
build/three.cjs

@@ -162,7 +162,11 @@ const sRGBEncoding = 3001;
 const BasicDepthPacking = 3200;
 const RGBADepthPacking = 3201;
 const TangentSpaceNormalMap = 0;
-const ObjectSpaceNormalMap = 1;
+const ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.
+
+const NoColorSpace = '';
+const SRGBColorSpace = 'srgb';
+const LinearSRGBColorSpace = 'srgb-linear';
 const ZeroStencilOp = 0;
 const KeepStencilOp = 7680;
 const ReplaceStencilOp = 7681;
@@ -1084,6 +1088,56 @@ function createElementNS(name) {
 	return document.createElementNS('http://www.w3.org/1999/xhtml', name);
 }
 
+function SRGBToLinear(c) {
+	return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
+}
+function LinearToSRGB(c) {
+	return c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;
+} // JavaScript RGB-to-RGB transforms, defined as
+// FN[InputColorSpace][OutputColorSpace] callback functions.
+
+const FN = {
+	[SRGBColorSpace]: {
+		[LinearSRGBColorSpace]: SRGBToLinear
+	},
+	[LinearSRGBColorSpace]: {
+		[SRGBColorSpace]: LinearToSRGB
+	}
+};
+const ColorManagement = {
+	legacyMode: true,
+
+	get workingColorSpace() {
+		return LinearSRGBColorSpace;
+	},
+
+	set workingColorSpace(colorSpace) {
+		console.warn('THREE.ColorManagement: .workingColorSpace is readonly.');
+	},
+
+	convert: function (color, sourceColorSpace, targetColorSpace) {
+		if (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {
+			return color;
+		}
+
+		if (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {
+			const fn = FN[sourceColorSpace][targetColorSpace];
+			color.r = fn(color.r);
+			color.g = fn(color.g);
+			color.b = fn(color.b);
+			return color;
+		}
+
+		throw new Error('Unsupported color space conversion.');
+	},
+	fromWorkingColorSpace: function (color, targetColorSpace) {
+		return this.convert(color, this.workingColorSpace, targetColorSpace);
+	},
+	toWorkingColorSpace: function (color, sourceColorSpace) {
+		return this.convert(color, sourceColorSpace, this.workingColorSpace);
+	}
+};
+
 const _colorKeywords = {
 	'aliceblue': 0xF0F8FF,
 	'antiquewhite': 0xFAEBD7,
@@ -1234,6 +1288,11 @@ const _colorKeywords = {
 	'yellow': 0xFFFF00,
 	'yellowgreen': 0x9ACD32
 };
+const _rgb = {
+	r: 0,
+	g: 0,
+	b: 0
+};
 const _hslA = {
 	h: 0,
 	s: 0,
@@ -1254,12 +1313,11 @@ function hue2rgb(p, q, t) {
 	return p;
 }
 
-function SRGBToLinear(c) {
-	return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
-}
-
-function LinearToSRGB(c) {
-	return c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;
+function toComponents(source, target) {
+	target.r = source.r;
+	target.g = source.g;
+	target.b = source.b;
+	return target;
 }
 
 class Color {
@@ -1291,22 +1349,24 @@ class Color {
 		return this;
 	}
 
-	setHex(hex) {
+	setHex(hex, colorSpace = SRGBColorSpace) {
 		hex = Math.floor(hex);
 		this.r = (hex >> 16 & 255) / 255;
 		this.g = (hex >> 8 & 255) / 255;
 		this.b = (hex & 255) / 255;
+		ColorManagement.toWorkingColorSpace(this, colorSpace);
 		return this;
 	}
 
-	setRGB(r, g, b) {
+	setRGB(r, g, b, colorSpace = LinearSRGBColorSpace) {
 		this.r = r;
 		this.g = g;
 		this.b = b;
+		ColorManagement.toWorkingColorSpace(this, colorSpace);
 		return this;
 	}
 
-	setHSL(h, s, l) {
+	setHSL(h, s, l, colorSpace = LinearSRGBColorSpace) {
 		// h,s,l ranges are in 0.0 - 1.0
 		h = euclideanModulo(h, 1);
 		s = clamp(s, 0, 1);
@@ -1322,10 +1382,11 @@ class Color {
 			this.b = hue2rgb(q, p, h - 1 / 3);
 		}
 
+		ColorManagement.toWorkingColorSpace(this, colorSpace);
 		return this;
 	}
 
-	setStyle(style) {
+	setStyle(style, colorSpace = SRGBColorSpace) {
 		function handleAlpha(string) {
 			if (string === undefined) return;
 
@@ -1350,6 +1411,7 @@ class Color {
 						this.r = Math.min(255, parseInt(color[1], 10)) / 255;
 						this.g = Math.min(255, parseInt(color[2], 10)) / 255;
 						this.b = Math.min(255, parseInt(color[3], 10)) / 255;
+						ColorManagement.toWorkingColorSpace(this, colorSpace);
 						handleAlpha(color[4]);
 						return this;
 					}
@@ -1359,6 +1421,7 @@ class Color {
 						this.r = Math.min(100, parseInt(color[1], 10)) / 100;
 						this.g = Math.min(100, parseInt(color[2], 10)) / 100;
 						this.b = Math.min(100, parseInt(color[3], 10)) / 100;
+						ColorManagement.toWorkingColorSpace(this, colorSpace);
 						handleAlpha(color[4]);
 						return this;
 					}
@@ -1373,7 +1436,7 @@ class Color {
 						const s = parseInt(color[2], 10) / 100;
 						const l = parseInt(color[3], 10) / 100;
 						handleAlpha(color[4]);
-						return this.setHSL(h, s, l);
+						return this.setHSL(h, s, l, colorSpace);
 					}
 
 					break;
@@ -1388,30 +1451,32 @@ class Color {
 				this.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;
 				this.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;
 				this.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;
+				ColorManagement.toWorkingColorSpace(this, colorSpace);
 				return this;
 			} else if (size === 6) {
 				// #ff0000
 				this.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;
 				this.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;
 				this.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;
+				ColorManagement.toWorkingColorSpace(this, colorSpace);
 				return this;
 			}
 		}
 
 		if (style && style.length > 0) {
-			return this.setColorName(style);
+			return this.setColorName(style, colorSpace);
 		}
 
 		return this;
 	}
 
-	setColorName(style) {
+	setColorName(style, colorSpace = SRGBColorSpace) {
 		// color keywords
 		const hex = _colorKeywords[style.toLowerCase()];
 
 		if (hex !== undefined) {
 			// red
-			this.setHex(hex);
+			this.setHex(hex, colorSpace);
 		} else {
 			// unknown color
 			console.warn('THREE.Color: Unknown color ' + style);
@@ -1455,19 +1520,21 @@ class Color {
 		return this;
 	}
 
-	getHex() {
-		return clamp(this.r * 255, 0, 255) << 16 ^ clamp(this.g * 255, 0, 255) << 8 ^ clamp(this.b * 255, 0, 255) << 0;
+	getHex(colorSpace = SRGBColorSpace) {
+		ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+		return clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;
 	}
 
-	getHexString() {
-		return ('000000' + this.getHex().toString(16)).slice(-6);
+	getHexString(colorSpace = SRGBColorSpace) {
+		return ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);
 	}
 
-	getHSL(target) {
+	getHSL(target, colorSpace = LinearSRGBColorSpace) {
 		// h,s,l ranges are in 0.0 - 1.0
-		const r = this.r,
-					g = this.g,
-					b = this.b;
+		ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+		const r = _rgb.r,
+					g = _rgb.g,
+					b = _rgb.b;
 		const max = Math.max(r, g, b);
 		const min = Math.min(r, g, b);
 		let hue, saturation;
@@ -1503,8 +1570,23 @@ class Color {
 		return target;
 	}
 
-	getStyle() {
-		return 'rgb(' + (this.r * 255 | 0) + ',' + (this.g * 255 | 0) + ',' + (this.b * 255 | 0) + ')';
+	getRGB(target, colorSpace = LinearSRGBColorSpace) {
+		ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+		target.r = _rgb.r;
+		target.g = _rgb.g;
+		target.b = _rgb.b;
+		return target;
+	}
+
+	getStyle(colorSpace = SRGBColorSpace) {
+		ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+
+		if (colorSpace !== SRGBColorSpace) {
+			// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).
+			return `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;
+		}
+
+		return `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;
 	}
 
 	offsetHSL(h, s, l) {
@@ -6966,35 +7048,6 @@ Material.fromType = function
 	return null;
 };
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *	map: new THREE.Texture( <Image> ),
- *
- *	lightMap: new THREE.Texture( <Image> ),
- *	lightMapIntensity: <float>
- *
- *	aoMap: new THREE.Texture( <Image> ),
- *	aoMapIntensity: <float>
- *
- *	specularMap: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
- *	combine: THREE.Multiply,
- *	reflectivity: <float>,
- *	refractionRatio: <float>,
- *
- *	depthTest: <bool>,
- *	depthWrite: <bool>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- * }
- */
-
 class MeshBasicMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -8692,21 +8745,6 @@ var default_vertex = "void main() {\n\tgl_Position = projectionMatrix * modelVie
 
 var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
 
-/**
- * parameters = {
- *	defines: { "label" : "value" },
- *	uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } },
- *
- *	fragmentShader: <string>,
- *	vertexShader: <string>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- *
- *	lights: <bool>
- * }
- */
-
 class ShaderMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -12811,7 +12849,7 @@ function WebGLMorphtargets(gl, capabilities, textures) {
 
 						if (hasMorphColors === true) {
 							morph.fromBufferAttribute(morphColor, j);
-							if (morphColor.normalized === true) denormalize(morph, morphNormal);
+							if (morphColor.normalized === true) denormalize(morph, morphColor);
 							buffer[offset + stride + 8] = morph.x;
 							buffer[offset + stride + 9] = morph.y;
 							buffer[offset + stride + 10] = morph.z;
@@ -15337,24 +15375,6 @@ function WebGLRenderStates(extensions, capabilities) {
 	};
 }
 
-/**
- * parameters = {
- *
- *	opacity: <float>,
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>
- * }
- */
-
 class MeshDepthMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -15388,24 +15408,6 @@ class MeshDepthMaterial extends Material {
 
 MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
 
-/**
- * parameters = {
- *
- *	referencePosition: <float>,
- *	nearDistance: <float>,
- *	farDistance: <float>,
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>
- *
- * }
- */
-
 class MeshDistanceMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -21062,16 +21064,6 @@ class InterleavedBufferAttribute {
 
 InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	map: new THREE.Texture( <Image> ),
- *	alphaMap: new THREE.Texture( <Image> ),
- *	rotation: <float>,
- *	sizeAttenuation: <bool>
- * }
- */
-
 class SpriteMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -21815,17 +21807,6 @@ class InstancedMesh extends Mesh {
 
 InstancedMesh.prototype.isInstancedMesh = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *
- *	linewidth: <float>,
- *	linecap: "round",
- *	linejoin: "round"
- * }
- */
-
 class LineBasicMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -22084,19 +22065,6 @@ class LineLoop extends Line {
 
 LineLoop.prototype.isLineLoop = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *	map: new THREE.Texture( <Image> ),
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	size: <float>,
- *	sizeAttenuation: <bool>
- *
- * }
- */
-
 class PointsMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26341,12 +26309,6 @@ var Geometries = /*#__PURE__*/Object.freeze({
 	WireframeGeometry: WireframeGeometry
 });
 
-/**
- * parameters = {
- *	color: <THREE.Color>
- * }
- */
-
 class ShadowMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26376,54 +26338,6 @@ class RawShaderMaterial extends ShaderMaterial {
 
 RawShaderMaterial.prototype.isRawShaderMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	roughness: <float>,
- *	metalness: <float>,
- *	opacity: <float>,
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	lightMap: new THREE.Texture( <Image> ),
- *	lightMapIntensity: <float>
- *
- *	aoMap: new THREE.Texture( <Image> ),
- *	aoMapIntensity: <float>
- *
- *	emissive: <hex>,
- *	emissiveIntensity: <float>
- *	emissiveMap: new THREE.Texture( <Image> ),
- *
- *	bumpMap: new THREE.Texture( <Image> ),
- *	bumpScale: <float>,
- *
- *	normalMap: new THREE.Texture( <Image> ),
- *	normalMapType: THREE.TangentSpaceNormalMap,
- *	normalScale: <Vector2>,
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	roughnessMap: new THREE.Texture( <Image> ),
- *
- *	metalnessMap: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
- *	envMapIntensity: <float>
- *
- *	refractionRatio: <float>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- *
- *	flatShading: <bool>
- * }
- */
-
 class MeshStandardMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26507,39 +26421,6 @@ class MeshStandardMaterial extends Material {
 
 MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
 
-/**
- * parameters = {
- *	clearcoat: <float>,
- *	clearcoatMap: new THREE.Texture( <Image> ),
- *	clearcoatRoughness: <float>,
- *	clearcoatRoughnessMap: new THREE.Texture( <Image> ),
- *	clearcoatNormalScale: <Vector2>,
- *	clearcoatNormalMap: new THREE.Texture( <Image> ),
- *
- *	ior: <float>,
- *	reflectivity: <float>,
- *
- *	sheen: <float>,
- *	sheenColor: <Color>,
- *	sheenColorMap: new THREE.Texture( <Image> ),
- *	sheenRoughness: <float>,
- *	sheenRoughnessMap: new THREE.Texture( <Image> ),
- *
- *	transmission: <float>,
- *	transmissionMap: new THREE.Texture( <Image> ),
- *
- *	thickness: <float>,
- *	thicknessMap: new THREE.Texture( <Image> ),
- *	attenuationDistance: <float>,
- *	attenuationColor: <Color>,
- *
- *	specularIntensity: <float>,
- *	specularIntensityMap: new THREE.Texture( <Image> ),
- *	specularColor: <Color>,
- *	specularColorMap: new THREE.Texture( <Image> )
- * }
- */
-
 class MeshPhysicalMaterial extends MeshStandardMaterial {
 	constructor(parameters) {
 		super();
@@ -26652,52 +26533,6 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 
 MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	specular: <hex>,
- *	shininess: <float>,
- *	opacity: <float>,
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	lightMap: new THREE.Texture( <Image> ),
- *	lightMapIntensity: <float>
- *
- *	aoMap: new THREE.Texture( <Image> ),
- *	aoMapIntensity: <float>
- *
- *	emissive: <hex>,
- *	emissiveIntensity: <float>
- *	emissiveMap: new THREE.Texture( <Image> ),
- *
- *	bumpMap: new THREE.Texture( <Image> ),
- *	bumpScale: <float>,
- *
- *	normalMap: new THREE.Texture( <Image> ),
- *	normalMapType: THREE.TangentSpaceNormalMap,
- *	normalScale: <Vector2>,
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	specularMap: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
- *	combine: THREE.MultiplyOperation,
- *	reflectivity: <float>,
- *	refractionRatio: <float>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- *
- *	flatShading: <bool>
- * }
- */
-
 class MeshPhongMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26775,42 +26610,6 @@ class MeshPhongMaterial extends Material {
 
 MeshPhongMaterial.prototype.isMeshPhongMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *
- *	map: new THREE.Texture( <Image> ),
- *	gradientMap: new THREE.Texture( <Image> ),
- *
- *	lightMap: new THREE.Texture( <Image> ),
- *	lightMapIntensity: <float>
- *
- *	aoMap: new THREE.Texture( <Image> ),
- *	aoMapIntensity: <float>
- *
- *	emissive: <hex>,
- *	emissiveIntensity: <float>
- *	emissiveMap: new THREE.Texture( <Image> ),
- *
- *	bumpMap: new THREE.Texture( <Image> ),
- *	bumpScale: <float>,
- *
- *	normalMap: new THREE.Texture( <Image> ),
- *	normalMapType: THREE.TangentSpaceNormalMap,
- *	normalScale: <Vector2>,
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- *
- * }
- */
-
 class MeshToonMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26876,28 +26675,6 @@ class MeshToonMaterial extends Material {
 
 MeshToonMaterial.prototype.isMeshToonMaterial = true;
 
-/**
- * parameters = {
- *	opacity: <float>,
- *
- *	bumpMap: new THREE.Texture( <Image> ),
- *	bumpScale: <float>,
- *
- *	normalMap: new THREE.Texture( <Image> ),
- *	normalMapType: THREE.TangentSpaceNormalMap,
- *	normalScale: <Vector2>,
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>
- *
- *	flatShading: <bool>
- * }
- */
-
 class MeshNormalMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -26937,38 +26714,6 @@ class MeshNormalMaterial extends Material {
 
 MeshNormalMaterial.prototype.isMeshNormalMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	lightMap: new THREE.Texture( <Image> ),
- *	lightMapIntensity: <float>
- *
- *	aoMap: new THREE.Texture( <Image> ),
- *	aoMapIntensity: <float>
- *
- *	emissive: <hex>,
- *	emissiveIntensity: <float>
- *	emissiveMap: new THREE.Texture( <Image> ),
- *
- *	specularMap: new THREE.Texture( <Image> ),
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
- *	combine: THREE.Multiply,
- *	reflectivity: <float>,
- *	refractionRatio: <float>,
- *
- *	wireframe: <boolean>,
- *	wireframeLinewidth: <float>,
- *
- * }
- */
-
 class MeshLambertMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -27024,32 +26769,6 @@ class MeshLambertMaterial extends Material {
 
 MeshLambertMaterial.prototype.isMeshLambertMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *
- *	matcap: new THREE.Texture( <Image> ),
- *
- *	map: new THREE.Texture( <Image> ),
- *
- *	bumpMap: new THREE.Texture( <Image> ),
- *	bumpScale: <float>,
- *
- *	normalMap: new THREE.Texture( <Image> ),
- *	normalMapType: THREE.TangentSpaceNormalMap,
- *	normalScale: <Vector2>,
- *
- *	displacementMap: new THREE.Texture( <Image> ),
- *	displacementScale: <float>,
- *	displacementBias: <float>,
- *
- *	alphaMap: new THREE.Texture( <Image> ),
- *
- *	flatShading: <bool>
- * }
- */
-
 class MeshMatcapMaterial extends Material {
 	constructor(parameters) {
 		super();
@@ -27099,19 +26818,6 @@ class MeshMatcapMaterial extends Material {
 
 MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;
 
-/**
- * parameters = {
- *	color: <hex>,
- *	opacity: <float>,
- *
- *	linewidth: <float>,
- *
- *	scale: <float>,
- *	dashSize: <float>,
- *	gapSize: <float>
- * }
- */
-
 class LineDashedMaterial extends LineBasicMaterial {
 	constructor(parameters) {
 		super();
@@ -36725,6 +36431,7 @@ exports.ClampToEdgeWrapping = ClampToEdgeWrapping;
 exports.Clock = Clock;
 exports.Color = Color;
 exports.ColorKeyframeTrack = ColorKeyframeTrack;
+exports.ColorManagement = ColorManagement;
 exports.CompressedTexture = CompressedTexture;
 exports.CompressedTextureLoader = CompressedTextureLoader;
 exports.ConeBufferGeometry = ConeGeometry;
@@ -36872,6 +36579,7 @@ exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;
 exports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;
 exports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;
 exports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;
+exports.LinearSRGBColorSpace = LinearSRGBColorSpace;
 exports.LinearToneMapping = LinearToneMapping;
 exports.Loader = Loader;
 exports.LoaderUtils = LoaderUtils;
@@ -36915,6 +36623,7 @@ exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
 exports.NeverDepth = NeverDepth;
 exports.NeverStencilFunc = NeverStencilFunc;
 exports.NoBlending = NoBlending;
+exports.NoColorSpace = NoColorSpace;
 exports.NoColors = NoColors;
 exports.NoToneMapping = NoToneMapping;
 exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
@@ -37009,6 +36718,7 @@ exports.ReplaceStencilOp = ReplaceStencilOp;
 exports.ReverseSubtractEquation = ReverseSubtractEquation;
 exports.RingBufferGeometry = RingGeometry;
 exports.RingGeometry = RingGeometry;
+exports.SRGBColorSpace = SRGBColorSpace;
 exports.Scene = Scene;
 exports.SceneUtils = SceneUtils;
 exports.ShaderChunk = ShaderChunk;

+ 112 - 402
build/three.js

@@ -164,7 +164,11 @@
 	const BasicDepthPacking = 3200;
 	const RGBADepthPacking = 3201;
 	const TangentSpaceNormalMap = 0;
-	const ObjectSpaceNormalMap = 1;
+	const ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.
+
+	const NoColorSpace = '';
+	const SRGBColorSpace = 'srgb';
+	const LinearSRGBColorSpace = 'srgb-linear';
 	const ZeroStencilOp = 0;
 	const KeepStencilOp = 7680;
 	const ReplaceStencilOp = 7681;
@@ -1086,6 +1090,56 @@
 		return document.createElementNS('http://www.w3.org/1999/xhtml', name);
 	}
 
+	function SRGBToLinear(c) {
+		return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
+	}
+	function LinearToSRGB(c) {
+		return c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;
+	} // JavaScript RGB-to-RGB transforms, defined as
+	// FN[InputColorSpace][OutputColorSpace] callback functions.
+
+	const FN = {
+		[SRGBColorSpace]: {
+			[LinearSRGBColorSpace]: SRGBToLinear
+		},
+		[LinearSRGBColorSpace]: {
+			[SRGBColorSpace]: LinearToSRGB
+		}
+	};
+	const ColorManagement = {
+		legacyMode: true,
+
+		get workingColorSpace() {
+			return LinearSRGBColorSpace;
+		},
+
+		set workingColorSpace(colorSpace) {
+			console.warn('THREE.ColorManagement: .workingColorSpace is readonly.');
+		},
+
+		convert: function (color, sourceColorSpace, targetColorSpace) {
+			if (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {
+				return color;
+			}
+
+			if (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {
+				const fn = FN[sourceColorSpace][targetColorSpace];
+				color.r = fn(color.r);
+				color.g = fn(color.g);
+				color.b = fn(color.b);
+				return color;
+			}
+
+			throw new Error('Unsupported color space conversion.');
+		},
+		fromWorkingColorSpace: function (color, targetColorSpace) {
+			return this.convert(color, this.workingColorSpace, targetColorSpace);
+		},
+		toWorkingColorSpace: function (color, sourceColorSpace) {
+			return this.convert(color, sourceColorSpace, this.workingColorSpace);
+		}
+	};
+
 	const _colorKeywords = {
 		'aliceblue': 0xF0F8FF,
 		'antiquewhite': 0xFAEBD7,
@@ -1236,6 +1290,11 @@
 		'yellow': 0xFFFF00,
 		'yellowgreen': 0x9ACD32
 	};
+	const _rgb = {
+		r: 0,
+		g: 0,
+		b: 0
+	};
 	const _hslA = {
 		h: 0,
 		s: 0,
@@ -1256,12 +1315,11 @@
 		return p;
 	}
 
-	function SRGBToLinear(c) {
-		return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
-	}
-
-	function LinearToSRGB(c) {
-		return c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;
+	function toComponents(source, target) {
+		target.r = source.r;
+		target.g = source.g;
+		target.b = source.b;
+		return target;
 	}
 
 	class Color {
@@ -1293,22 +1351,24 @@
 			return this;
 		}
 
-		setHex(hex) {
+		setHex(hex, colorSpace = SRGBColorSpace) {
 			hex = Math.floor(hex);
 			this.r = (hex >> 16 & 255) / 255;
 			this.g = (hex >> 8 & 255) / 255;
 			this.b = (hex & 255) / 255;
+			ColorManagement.toWorkingColorSpace(this, colorSpace);
 			return this;
 		}
 
-		setRGB(r, g, b) {
+		setRGB(r, g, b, colorSpace = LinearSRGBColorSpace) {
 			this.r = r;
 			this.g = g;
 			this.b = b;
+			ColorManagement.toWorkingColorSpace(this, colorSpace);
 			return this;
 		}
 
-		setHSL(h, s, l) {
+		setHSL(h, s, l, colorSpace = LinearSRGBColorSpace) {
 			// h,s,l ranges are in 0.0 - 1.0
 			h = euclideanModulo(h, 1);
 			s = clamp(s, 0, 1);
@@ -1324,10 +1384,11 @@
 				this.b = hue2rgb(q, p, h - 1 / 3);
 			}
 
+			ColorManagement.toWorkingColorSpace(this, colorSpace);
 			return this;
 		}
 
-		setStyle(style) {
+		setStyle(style, colorSpace = SRGBColorSpace) {
 			function handleAlpha(string) {
 				if (string === undefined) return;
 
@@ -1352,6 +1413,7 @@
 							this.r = Math.min(255, parseInt(color[1], 10)) / 255;
 							this.g = Math.min(255, parseInt(color[2], 10)) / 255;
 							this.b = Math.min(255, parseInt(color[3], 10)) / 255;
+							ColorManagement.toWorkingColorSpace(this, colorSpace);
 							handleAlpha(color[4]);
 							return this;
 						}
@@ -1361,6 +1423,7 @@
 							this.r = Math.min(100, parseInt(color[1], 10)) / 100;
 							this.g = Math.min(100, parseInt(color[2], 10)) / 100;
 							this.b = Math.min(100, parseInt(color[3], 10)) / 100;
+							ColorManagement.toWorkingColorSpace(this, colorSpace);
 							handleAlpha(color[4]);
 							return this;
 						}
@@ -1375,7 +1438,7 @@
 							const s = parseInt(color[2], 10) / 100;
 							const l = parseInt(color[3], 10) / 100;
 							handleAlpha(color[4]);
-							return this.setHSL(h, s, l);
+							return this.setHSL(h, s, l, colorSpace);
 						}
 
 						break;
@@ -1390,30 +1453,32 @@
 					this.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;
 					this.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;
 					this.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;
+					ColorManagement.toWorkingColorSpace(this, colorSpace);
 					return this;
 				} else if (size === 6) {
 					// #ff0000
 					this.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;
 					this.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;
 					this.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;
+					ColorManagement.toWorkingColorSpace(this, colorSpace);
 					return this;
 				}
 			}
 
 			if (style && style.length > 0) {
-				return this.setColorName(style);
+				return this.setColorName(style, colorSpace);
 			}
 
 			return this;
 		}
 
-		setColorName(style) {
+		setColorName(style, colorSpace = SRGBColorSpace) {
 			// color keywords
 			const hex = _colorKeywords[style.toLowerCase()];
 
 			if (hex !== undefined) {
 				// red
-				this.setHex(hex);
+				this.setHex(hex, colorSpace);
 			} else {
 				// unknown color
 				console.warn('THREE.Color: Unknown color ' + style);
@@ -1457,19 +1522,21 @@
 			return this;
 		}
 
-		getHex() {
-			return clamp(this.r * 255, 0, 255) << 16 ^ clamp(this.g * 255, 0, 255) << 8 ^ clamp(this.b * 255, 0, 255) << 0;
+		getHex(colorSpace = SRGBColorSpace) {
+			ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+			return clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;
 		}
 
-		getHexString() {
-			return ('000000' + this.getHex().toString(16)).slice(-6);
+		getHexString(colorSpace = SRGBColorSpace) {
+			return ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);
 		}
 
-		getHSL(target) {
+		getHSL(target, colorSpace = LinearSRGBColorSpace) {
 			// h,s,l ranges are in 0.0 - 1.0
-			const r = this.r,
-						g = this.g,
-						b = this.b;
+			ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+			const r = _rgb.r,
+						g = _rgb.g,
+						b = _rgb.b;
 			const max = Math.max(r, g, b);
 			const min = Math.min(r, g, b);
 			let hue, saturation;
@@ -1505,8 +1572,23 @@
 			return target;
 		}
 
-		getStyle() {
-			return 'rgb(' + (this.r * 255 | 0) + ',' + (this.g * 255 | 0) + ',' + (this.b * 255 | 0) + ')';
+		getRGB(target, colorSpace = LinearSRGBColorSpace) {
+			ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+			target.r = _rgb.r;
+			target.g = _rgb.g;
+			target.b = _rgb.b;
+			return target;
+		}
+
+		getStyle(colorSpace = SRGBColorSpace) {
+			ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
+
+			if (colorSpace !== SRGBColorSpace) {
+				// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).
+				return `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;
+			}
+
+			return `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;
 		}
 
 		offsetHSL(h, s, l) {
@@ -6968,35 +7050,6 @@
 		return null;
 	};
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	lightMap: new THREE.Texture( <Image> ),
-	 *	lightMapIntensity: <float>
-	 *
-	 *	aoMap: new THREE.Texture( <Image> ),
-	 *	aoMapIntensity: <float>
-	 *
-	 *	specularMap: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
-	 *	combine: THREE.Multiply,
-	 *	reflectivity: <float>,
-	 *	refractionRatio: <float>,
-	 *
-	 *	depthTest: <bool>,
-	 *	depthWrite: <bool>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 * }
-	 */
-
 	class MeshBasicMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -8694,21 +8747,6 @@
 
 	var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
 
-	/**
-	 * parameters = {
-	 *	defines: { "label" : "value" },
-	 *	uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } },
-	 *
-	 *	fragmentShader: <string>,
-	 *	vertexShader: <string>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 *
-	 *	lights: <bool>
-	 * }
-	 */
-
 	class ShaderMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -12813,7 +12851,7 @@
 
 							if (hasMorphColors === true) {
 								morph.fromBufferAttribute(morphColor, j);
-								if (morphColor.normalized === true) denormalize(morph, morphNormal);
+								if (morphColor.normalized === true) denormalize(morph, morphColor);
 								buffer[offset + stride + 8] = morph.x;
 								buffer[offset + stride + 9] = morph.y;
 								buffer[offset + stride + 10] = morph.z;
@@ -15339,24 +15377,6 @@
 		};
 	}
 
-	/**
-	 * parameters = {
-	 *
-	 *	opacity: <float>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>
-	 * }
-	 */
-
 	class MeshDepthMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -15390,24 +15410,6 @@
 
 	MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
 
-	/**
-	 * parameters = {
-	 *
-	 *	referencePosition: <float>,
-	 *	nearDistance: <float>,
-	 *	farDistance: <float>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>
-	 *
-	 * }
-	 */
-
 	class MeshDistanceMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -21064,16 +21066,6 @@
 
 	InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	map: new THREE.Texture( <Image> ),
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *	rotation: <float>,
-	 *	sizeAttenuation: <bool>
-	 * }
-	 */
-
 	class SpriteMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -21817,17 +21809,6 @@
 
 	InstancedMesh.prototype.isInstancedMesh = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *
-	 *	linewidth: <float>,
-	 *	linecap: "round",
-	 *	linejoin: "round"
-	 * }
-	 */
-
 	class LineBasicMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -22086,19 +22067,6 @@
 
 	LineLoop.prototype.isLineLoop = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *	map: new THREE.Texture( <Image> ),
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	size: <float>,
-	 *	sizeAttenuation: <bool>
-	 *
-	 * }
-	 */
-
 	class PointsMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26343,12 +26311,6 @@
 		WireframeGeometry: WireframeGeometry
 	});
 
-	/**
-	 * parameters = {
-	 *	color: <THREE.Color>
-	 * }
-	 */
-
 	class ShadowMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26378,54 +26340,6 @@
 
 	RawShaderMaterial.prototype.isRawShaderMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	roughness: <float>,
-	 *	metalness: <float>,
-	 *	opacity: <float>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	lightMap: new THREE.Texture( <Image> ),
-	 *	lightMapIntensity: <float>
-	 *
-	 *	aoMap: new THREE.Texture( <Image> ),
-	 *	aoMapIntensity: <float>
-	 *
-	 *	emissive: <hex>,
-	 *	emissiveIntensity: <float>
-	 *	emissiveMap: new THREE.Texture( <Image> ),
-	 *
-	 *	bumpMap: new THREE.Texture( <Image> ),
-	 *	bumpScale: <float>,
-	 *
-	 *	normalMap: new THREE.Texture( <Image> ),
-	 *	normalMapType: THREE.TangentSpaceNormalMap,
-	 *	normalScale: <Vector2>,
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	roughnessMap: new THREE.Texture( <Image> ),
-	 *
-	 *	metalnessMap: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
-	 *	envMapIntensity: <float>
-	 *
-	 *	refractionRatio: <float>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 *
-	 *	flatShading: <bool>
-	 * }
-	 */
-
 	class MeshStandardMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26509,39 +26423,6 @@
 
 	MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	clearcoat: <float>,
-	 *	clearcoatMap: new THREE.Texture( <Image> ),
-	 *	clearcoatRoughness: <float>,
-	 *	clearcoatRoughnessMap: new THREE.Texture( <Image> ),
-	 *	clearcoatNormalScale: <Vector2>,
-	 *	clearcoatNormalMap: new THREE.Texture( <Image> ),
-	 *
-	 *	ior: <float>,
-	 *	reflectivity: <float>,
-	 *
-	 *	sheen: <float>,
-	 *	sheenColor: <Color>,
-	 *	sheenColorMap: new THREE.Texture( <Image> ),
-	 *	sheenRoughness: <float>,
-	 *	sheenRoughnessMap: new THREE.Texture( <Image> ),
-	 *
-	 *	transmission: <float>,
-	 *	transmissionMap: new THREE.Texture( <Image> ),
-	 *
-	 *	thickness: <float>,
-	 *	thicknessMap: new THREE.Texture( <Image> ),
-	 *	attenuationDistance: <float>,
-	 *	attenuationColor: <Color>,
-	 *
-	 *	specularIntensity: <float>,
-	 *	specularIntensityMap: new THREE.Texture( <Image> ),
-	 *	specularColor: <Color>,
-	 *	specularColorMap: new THREE.Texture( <Image> )
-	 * }
-	 */
-
 	class MeshPhysicalMaterial extends MeshStandardMaterial {
 		constructor(parameters) {
 			super();
@@ -26654,52 +26535,6 @@
 
 	MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	specular: <hex>,
-	 *	shininess: <float>,
-	 *	opacity: <float>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	lightMap: new THREE.Texture( <Image> ),
-	 *	lightMapIntensity: <float>
-	 *
-	 *	aoMap: new THREE.Texture( <Image> ),
-	 *	aoMapIntensity: <float>
-	 *
-	 *	emissive: <hex>,
-	 *	emissiveIntensity: <float>
-	 *	emissiveMap: new THREE.Texture( <Image> ),
-	 *
-	 *	bumpMap: new THREE.Texture( <Image> ),
-	 *	bumpScale: <float>,
-	 *
-	 *	normalMap: new THREE.Texture( <Image> ),
-	 *	normalMapType: THREE.TangentSpaceNormalMap,
-	 *	normalScale: <Vector2>,
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	specularMap: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
-	 *	combine: THREE.MultiplyOperation,
-	 *	reflectivity: <float>,
-	 *	refractionRatio: <float>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 *
-	 *	flatShading: <bool>
-	 * }
-	 */
-
 	class MeshPhongMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26777,42 +26612,6 @@
 
 	MeshPhongMaterial.prototype.isMeshPhongMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *	gradientMap: new THREE.Texture( <Image> ),
-	 *
-	 *	lightMap: new THREE.Texture( <Image> ),
-	 *	lightMapIntensity: <float>
-	 *
-	 *	aoMap: new THREE.Texture( <Image> ),
-	 *	aoMapIntensity: <float>
-	 *
-	 *	emissive: <hex>,
-	 *	emissiveIntensity: <float>
-	 *	emissiveMap: new THREE.Texture( <Image> ),
-	 *
-	 *	bumpMap: new THREE.Texture( <Image> ),
-	 *	bumpScale: <float>,
-	 *
-	 *	normalMap: new THREE.Texture( <Image> ),
-	 *	normalMapType: THREE.TangentSpaceNormalMap,
-	 *	normalScale: <Vector2>,
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 *
-	 * }
-	 */
-
 	class MeshToonMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26878,28 +26677,6 @@
 
 	MeshToonMaterial.prototype.isMeshToonMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	opacity: <float>,
-	 *
-	 *	bumpMap: new THREE.Texture( <Image> ),
-	 *	bumpScale: <float>,
-	 *
-	 *	normalMap: new THREE.Texture( <Image> ),
-	 *	normalMapType: THREE.TangentSpaceNormalMap,
-	 *	normalScale: <Vector2>,
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>
-	 *
-	 *	flatShading: <bool>
-	 * }
-	 */
-
 	class MeshNormalMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -26939,38 +26716,6 @@
 
 	MeshNormalMaterial.prototype.isMeshNormalMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	lightMap: new THREE.Texture( <Image> ),
-	 *	lightMapIntensity: <float>
-	 *
-	 *	aoMap: new THREE.Texture( <Image> ),
-	 *	aoMapIntensity: <float>
-	 *
-	 *	emissive: <hex>,
-	 *	emissiveIntensity: <float>
-	 *	emissiveMap: new THREE.Texture( <Image> ),
-	 *
-	 *	specularMap: new THREE.Texture( <Image> ),
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
-	 *	combine: THREE.Multiply,
-	 *	reflectivity: <float>,
-	 *	refractionRatio: <float>,
-	 *
-	 *	wireframe: <boolean>,
-	 *	wireframeLinewidth: <float>,
-	 *
-	 * }
-	 */
-
 	class MeshLambertMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -27026,32 +26771,6 @@
 
 	MeshLambertMaterial.prototype.isMeshLambertMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *
-	 *	matcap: new THREE.Texture( <Image> ),
-	 *
-	 *	map: new THREE.Texture( <Image> ),
-	 *
-	 *	bumpMap: new THREE.Texture( <Image> ),
-	 *	bumpScale: <float>,
-	 *
-	 *	normalMap: new THREE.Texture( <Image> ),
-	 *	normalMapType: THREE.TangentSpaceNormalMap,
-	 *	normalScale: <Vector2>,
-	 *
-	 *	displacementMap: new THREE.Texture( <Image> ),
-	 *	displacementScale: <float>,
-	 *	displacementBias: <float>,
-	 *
-	 *	alphaMap: new THREE.Texture( <Image> ),
-	 *
-	 *	flatShading: <bool>
-	 * }
-	 */
-
 	class MeshMatcapMaterial extends Material {
 		constructor(parameters) {
 			super();
@@ -27101,19 +26820,6 @@
 
 	MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;
 
-	/**
-	 * parameters = {
-	 *	color: <hex>,
-	 *	opacity: <float>,
-	 *
-	 *	linewidth: <float>,
-	 *
-	 *	scale: <float>,
-	 *	dashSize: <float>,
-	 *	gapSize: <float>
-	 * }
-	 */
-
 	class LineDashedMaterial extends LineBasicMaterial {
 		constructor(parameters) {
 			super();
@@ -36727,6 +36433,7 @@
 	exports.Clock = Clock;
 	exports.Color = Color;
 	exports.ColorKeyframeTrack = ColorKeyframeTrack;
+	exports.ColorManagement = ColorManagement;
 	exports.CompressedTexture = CompressedTexture;
 	exports.CompressedTextureLoader = CompressedTextureLoader;
 	exports.ConeBufferGeometry = ConeGeometry;
@@ -36874,6 +36581,7 @@
 	exports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;
 	exports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;
 	exports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;
+	exports.LinearSRGBColorSpace = LinearSRGBColorSpace;
 	exports.LinearToneMapping = LinearToneMapping;
 	exports.Loader = Loader;
 	exports.LoaderUtils = LoaderUtils;
@@ -36917,6 +36625,7 @@
 	exports.NeverDepth = NeverDepth;
 	exports.NeverStencilFunc = NeverStencilFunc;
 	exports.NoBlending = NoBlending;
+	exports.NoColorSpace = NoColorSpace;
 	exports.NoColors = NoColors;
 	exports.NoToneMapping = NoToneMapping;
 	exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
@@ -37011,6 +36720,7 @@
 	exports.ReverseSubtractEquation = ReverseSubtractEquation;
 	exports.RingBufferGeometry = RingGeometry;
 	exports.RingGeometry = RingGeometry;
+	exports.SRGBColorSpace = SRGBColorSpace;
 	exports.Scene = Scene;
 	exports.SceneUtils = SceneUtils;
 	exports.ShaderChunk = ShaderChunk;

文件差異過大導致無法顯示
+ 0 - 0
build/three.min.js


文件差異過大導致無法顯示
+ 140 - 400
build/three.module.js


部分文件因文件數量過多而無法顯示