Bladeren bron

Updated builds.

Mugen87 1 jaar geleden
bovenliggende
commit
a3d3041896

+ 50 - 6
build/three.cjs

@@ -4292,9 +4292,10 @@ class ImageUtils {
 	 * Returns a data URI containing a representation of the given image.
 	 * Returns a data URI containing a representation of the given image.
 	 *
 	 *
 	 * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
 	 * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
+	 * @param {string} [type='image/png'] - Indicates the image format.
 	 * @return {string} The data URI.
 	 * @return {string} The data URI.
 	 */
 	 */
-	static getDataURL( image ) {
+	static getDataURL( image, type = 'image/png' ) {
 
 
 		if ( /^data:/i.test( image.src ) ) {
 		if ( /^data:/i.test( image.src ) ) {
 
 
@@ -4337,7 +4338,7 @@ class ImageUtils {
 
 
 		}
 		}
 
 
-		return canvas.toDataURL( 'image/png' );
+		return canvas.toDataURL( type );
 
 
 	}
 	}
 
 
@@ -16389,6 +16390,14 @@ class Material extends EventDispatcher {
 		 */
 		 */
 		this.forceSinglePass = false;
 		this.forceSinglePass = false;
 
 
+		/**
+		 * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.
+		 *
+		 * @type {boolean}
+		 * @default true
+		 */
+		this.allowOverride = true;
+
 		/**
 		/**
 		 * Defines whether 3D objects using this material are visible.
 		 * Defines whether 3D objects using this material are visible.
 		 *
 		 *
@@ -22786,7 +22795,8 @@ class Scene extends Object3D {
 		this.environmentRotation = new Euler();
 		this.environmentRotation = new Euler();
 
 
 		/**
 		/**
-		 * Forces everything in the scene to be rendered with the defined material.
+		 * Forces everything in the scene to be rendered with the defined material. It is possible
+		 * to exclude materials from override by setting {@link Material#allowOverride} to `false`.
 		 *
 		 *
 		 * @type {?Material}
 		 * @type {?Material}
 		 * @default null
 		 * @default null
@@ -33703,6 +33713,10 @@ class Shape extends Path {
 
 
 }
 }
 
 
+/* eslint-disable */
+// copy of mapbox/earcut version 3.0.1
+// https://github.com/mapbox/earcut/tree/v3.0.1
+
 function earcut(data, holeIndices, dim = 2) {
 function earcut(data, holeIndices, dim = 2) {
 
 
     const hasHoles = holeIndices && holeIndices.length;
     const hasHoles = holeIndices && holeIndices.length;
@@ -57261,6 +57275,28 @@ class TextureUtils {
 
 
 }
 }
 
 
+if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
+
+	__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
+		revision: REVISION,
+	} } ) );
+
+}
+
+if ( typeof window !== 'undefined' ) {
+
+	if ( window.__THREE__ ) {
+
+		console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
+
+	} else {
+
+		window.__THREE__ = REVISION;
+
+	}
+
+}
+
 function WebGLAnimation() {
 function WebGLAnimation() {
 
 
 	let context = null;
 	let context = null;
@@ -58639,7 +58675,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 						side: BackSide,
 						side: BackSide,
 						depthTest: false,
 						depthTest: false,
 						depthWrite: false,
 						depthWrite: false,
-						fog: false
+						fog: false,
+						allowOverride: false
 					} )
 					} )
 				);
 				);
 
 
@@ -58718,7 +58755,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 						side: FrontSide,
 						side: FrontSide,
 						depthTest: false,
 						depthTest: false,
 						depthWrite: false,
 						depthWrite: false,
-						fog: false
+						fog: false,
+						allowOverride: false
 					} )
 					} )
 				);
 				);
 
 
@@ -73815,8 +73853,14 @@ class WebGLRenderer {
 
 
 				const object = renderItem.object;
 				const object = renderItem.object;
 				const geometry = renderItem.geometry;
 				const geometry = renderItem.geometry;
-				const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
 				const group = renderItem.group;
 				const group = renderItem.group;
+				let material = renderItem.material;
+
+				if ( material.allowOverride === true && overrideMaterial !== null ) {
+
+					material = overrideMaterial;
+
+				}
 
 
 				if ( object.layers.test( camera.layers ) ) {
 				if ( object.layers.test( camera.layers ) ) {
 
 

+ 17 - 3
build/three.core.js

@@ -4290,9 +4290,10 @@ class ImageUtils {
 	 * Returns a data URI containing a representation of the given image.
 	 * Returns a data URI containing a representation of the given image.
 	 *
 	 *
 	 * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
 	 * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
+	 * @param {string} [type='image/png'] - Indicates the image format.
 	 * @return {string} The data URI.
 	 * @return {string} The data URI.
 	 */
 	 */
-	static getDataURL( image ) {
+	static getDataURL( image, type = 'image/png' ) {
 
 
 		if ( /^data:/i.test( image.src ) ) {
 		if ( /^data:/i.test( image.src ) ) {
 
 
@@ -4335,7 +4336,7 @@ class ImageUtils {
 
 
 		}
 		}
 
 
-		return canvas.toDataURL( 'image/png' );
+		return canvas.toDataURL( type );
 
 
 	}
 	}
 
 
@@ -16387,6 +16388,14 @@ class Material extends EventDispatcher {
 		 */
 		 */
 		this.forceSinglePass = false;
 		this.forceSinglePass = false;
 
 
+		/**
+		 * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.
+		 *
+		 * @type {boolean}
+		 * @default true
+		 */
+		this.allowOverride = true;
+
 		/**
 		/**
 		 * Defines whether 3D objects using this material are visible.
 		 * Defines whether 3D objects using this material are visible.
 		 *
 		 *
@@ -22784,7 +22793,8 @@ class Scene extends Object3D {
 		this.environmentRotation = new Euler();
 		this.environmentRotation = new Euler();
 
 
 		/**
 		/**
-		 * Forces everything in the scene to be rendered with the defined material.
+		 * Forces everything in the scene to be rendered with the defined material. It is possible
+		 * to exclude materials from override by setting {@link Material#allowOverride} to `false`.
 		 *
 		 *
 		 * @type {?Material}
 		 * @type {?Material}
 		 * @default null
 		 * @default null
@@ -33701,6 +33711,10 @@ class Shape extends Path {
 
 
 }
 }
 
 
+/* eslint-disable */
+// copy of mapbox/earcut version 3.0.1
+// https://github.com/mapbox/earcut/tree/v3.0.1
+
 function earcut(data, holeIndices, dim = 2) {
 function earcut(data, holeIndices, dim = 2) {
 
 
     const hasHoles = holeIndices && holeIndices.length;
     const hasHoles = holeIndices && holeIndices.length;

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


+ 11 - 3
build/three.module.js

@@ -1384,7 +1384,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 						side: BackSide,
 						side: BackSide,
 						depthTest: false,
 						depthTest: false,
 						depthWrite: false,
 						depthWrite: false,
-						fog: false
+						fog: false,
+						allowOverride: false
 					} )
 					} )
 				);
 				);
 
 
@@ -1463,7 +1464,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 						side: FrontSide,
 						side: FrontSide,
 						depthTest: false,
 						depthTest: false,
 						depthWrite: false,
 						depthWrite: false,
-						fog: false
+						fog: false,
+						allowOverride: false
 					} )
 					} )
 				);
 				);
 
 
@@ -16560,8 +16562,14 @@ class WebGLRenderer {
 
 
 				const object = renderItem.object;
 				const object = renderItem.object;
 				const geometry = renderItem.geometry;
 				const geometry = renderItem.geometry;
-				const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
 				const group = renderItem.group;
 				const group = renderItem.group;
+				let material = renderItem.material;
+
+				if ( material.allowOverride === true && overrideMaterial !== null ) {
+
+					material = overrideMaterial;
+
+				}
 
 
 				if ( object.layers.test( camera.layers ) ) {
 				if ( object.layers.test( camera.layers ) ) {
 
 

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


+ 12 - 11
build/three.webgpu.js

@@ -3438,7 +3438,7 @@ const Fn = ( jsFunc, nodeType ) => {
  * @function
  * @function
  * @deprecated since r168. Use {@link Fn} instead.
  * @deprecated since r168. Use {@link Fn} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const tslFn = ( ...params ) => { // @deprecated, r168
 const tslFn = ( ...params ) => { // @deprecated, r168
@@ -5275,7 +5275,7 @@ addMethodChaining( 'shiftRight', shiftRight );
  * @function
  * @function
  * @deprecated since r168. Use {@link modInt} instead.
  * @deprecated since r168. Use {@link modInt} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const remainder = ( ...params ) => { // @deprecated, r168
 const remainder = ( ...params ) => { // @deprecated, r168
@@ -6579,7 +6579,7 @@ addMethodChaining( 'select', select );
  * @function
  * @function
  * @deprecated since r168. Use {@link select} instead.
  * @deprecated since r168. Use {@link select} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {ConditionalNode}
  * @returns {ConditionalNode}
  */
  */
 const cond = ( ...params ) => { // @deprecated, r168
 const cond = ( ...params ) => { // @deprecated, r168
@@ -14353,7 +14353,7 @@ const Break = () => expression( 'break' ).append();
  * @function
  * @function
  * @deprecated since r168. Use {@link Loop} instead.
  * @deprecated since r168. Use {@link Loop} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {LoopNode}
  * @returns {LoopNode}
  */
  */
 const loop = ( ...params ) => { // @deprecated, r168
 const loop = ( ...params ) => { // @deprecated, r168
@@ -28432,7 +28432,7 @@ class StackNode extends Node {
 	 * @function
 	 * @function
 	 * @deprecated since r168. Use {@link StackNode#Else} instead.
 	 * @deprecated since r168. Use {@link StackNode#Else} instead.
 	 *
 	 *
-	 * @param  {...any} params
+	 * @param {...any} params
 	 * @returns {StackNode}
 	 * @returns {StackNode}
 	 */
 	 */
 	else( ...params ) { // @deprecated, r168
 	else( ...params ) { // @deprecated, r168
@@ -28445,7 +28445,7 @@ class StackNode extends Node {
 	/**
 	/**
 	 * @deprecated since r168. Use {@link StackNode#ElseIf} instead.
 	 * @deprecated since r168. Use {@link StackNode#ElseIf} instead.
 	 *
 	 *
-	 * @param  {...any} params
+	 * @param {...any} params
 	 * @returns {StackNode}
 	 * @returns {StackNode}
 	 */
 	 */
 	elseif( ...params ) { // @deprecated, r168
 	elseif( ...params ) { // @deprecated, r168
@@ -32419,7 +32419,7 @@ const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
  * @function
  * @function
  * @deprecated since r171. Use {@link blendBurn} instead.
  * @deprecated since r171. Use {@link blendBurn} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const burn = ( ...params ) => { // @deprecated, r171
 const burn = ( ...params ) => { // @deprecated, r171
@@ -32434,7 +32434,7 @@ const burn = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendDodge} instead.
  * @deprecated since r171. Use {@link blendDodge} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const dodge = ( ...params ) => { // @deprecated, r171
 const dodge = ( ...params ) => { // @deprecated, r171
@@ -32449,7 +32449,7 @@ const dodge = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendScreen} instead.
  * @deprecated since r171. Use {@link blendScreen} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const screen = ( ...params ) => { // @deprecated, r171
 const screen = ( ...params ) => { // @deprecated, r171
@@ -32464,7 +32464,7 @@ const screen = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendOverlay} instead.
  * @deprecated since r171. Use {@link blendOverlay} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const overlay = ( ...params ) => { // @deprecated, r171
 const overlay = ( ...params ) => { // @deprecated, r171
@@ -40730,6 +40730,7 @@ class Background extends DataMap {
 				nodeMaterial.side = BackSide;
 				nodeMaterial.side = BackSide;
 				nodeMaterial.depthTest = false;
 				nodeMaterial.depthTest = false;
 				nodeMaterial.depthWrite = false;
 				nodeMaterial.depthWrite = false;
+				nodeMaterial.allowOverride = false;
 				nodeMaterial.fog = false;
 				nodeMaterial.fog = false;
 				nodeMaterial.lights = false;
 				nodeMaterial.lights = false;
 				nodeMaterial.vertexNode = viewProj;
 				nodeMaterial.vertexNode = viewProj;
@@ -51612,7 +51613,7 @@ class Renderer {
 
 
 		//
 		//
 
 
-		if ( scene.overrideMaterial !== null ) {
+		if ( material.allowOverride === true && scene.overrideMaterial !== null ) {
 
 
 			const overrideMaterial = scene.overrideMaterial;
 			const overrideMaterial = scene.overrideMaterial;
 
 

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


+ 12 - 11
build/three.webgpu.nodes.js

@@ -3438,7 +3438,7 @@ const Fn = ( jsFunc, nodeType ) => {
  * @function
  * @function
  * @deprecated since r168. Use {@link Fn} instead.
  * @deprecated since r168. Use {@link Fn} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const tslFn = ( ...params ) => { // @deprecated, r168
 const tslFn = ( ...params ) => { // @deprecated, r168
@@ -5275,7 +5275,7 @@ addMethodChaining( 'shiftRight', shiftRight );
  * @function
  * @function
  * @deprecated since r168. Use {@link modInt} instead.
  * @deprecated since r168. Use {@link modInt} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const remainder = ( ...params ) => { // @deprecated, r168
 const remainder = ( ...params ) => { // @deprecated, r168
@@ -6579,7 +6579,7 @@ addMethodChaining( 'select', select );
  * @function
  * @function
  * @deprecated since r168. Use {@link select} instead.
  * @deprecated since r168. Use {@link select} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {ConditionalNode}
  * @returns {ConditionalNode}
  */
  */
 const cond = ( ...params ) => { // @deprecated, r168
 const cond = ( ...params ) => { // @deprecated, r168
@@ -14353,7 +14353,7 @@ const Break = () => expression( 'break' ).append();
  * @function
  * @function
  * @deprecated since r168. Use {@link Loop} instead.
  * @deprecated since r168. Use {@link Loop} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {LoopNode}
  * @returns {LoopNode}
  */
  */
 const loop = ( ...params ) => { // @deprecated, r168
 const loop = ( ...params ) => { // @deprecated, r168
@@ -28432,7 +28432,7 @@ class StackNode extends Node {
 	 * @function
 	 * @function
 	 * @deprecated since r168. Use {@link StackNode#Else} instead.
 	 * @deprecated since r168. Use {@link StackNode#Else} instead.
 	 *
 	 *
-	 * @param  {...any} params
+	 * @param {...any} params
 	 * @returns {StackNode}
 	 * @returns {StackNode}
 	 */
 	 */
 	else( ...params ) { // @deprecated, r168
 	else( ...params ) { // @deprecated, r168
@@ -28445,7 +28445,7 @@ class StackNode extends Node {
 	/**
 	/**
 	 * @deprecated since r168. Use {@link StackNode#ElseIf} instead.
 	 * @deprecated since r168. Use {@link StackNode#ElseIf} instead.
 	 *
 	 *
-	 * @param  {...any} params
+	 * @param {...any} params
 	 * @returns {StackNode}
 	 * @returns {StackNode}
 	 */
 	 */
 	elseif( ...params ) { // @deprecated, r168
 	elseif( ...params ) { // @deprecated, r168
@@ -32419,7 +32419,7 @@ const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
  * @function
  * @function
  * @deprecated since r171. Use {@link blendBurn} instead.
  * @deprecated since r171. Use {@link blendBurn} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const burn = ( ...params ) => { // @deprecated, r171
 const burn = ( ...params ) => { // @deprecated, r171
@@ -32434,7 +32434,7 @@ const burn = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendDodge} instead.
  * @deprecated since r171. Use {@link blendDodge} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const dodge = ( ...params ) => { // @deprecated, r171
 const dodge = ( ...params ) => { // @deprecated, r171
@@ -32449,7 +32449,7 @@ const dodge = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendScreen} instead.
  * @deprecated since r171. Use {@link blendScreen} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const screen = ( ...params ) => { // @deprecated, r171
 const screen = ( ...params ) => { // @deprecated, r171
@@ -32464,7 +32464,7 @@ const screen = ( ...params ) => { // @deprecated, r171
  * @function
  * @function
  * @deprecated since r171. Use {@link blendOverlay} instead.
  * @deprecated since r171. Use {@link blendOverlay} instead.
  *
  *
- * @param  {...any} params
+ * @param {...any} params
  * @returns {Function}
  * @returns {Function}
  */
  */
 const overlay = ( ...params ) => { // @deprecated, r171
 const overlay = ( ...params ) => { // @deprecated, r171
@@ -40730,6 +40730,7 @@ class Background extends DataMap {
 				nodeMaterial.side = BackSide;
 				nodeMaterial.side = BackSide;
 				nodeMaterial.depthTest = false;
 				nodeMaterial.depthTest = false;
 				nodeMaterial.depthWrite = false;
 				nodeMaterial.depthWrite = false;
+				nodeMaterial.allowOverride = false;
 				nodeMaterial.fog = false;
 				nodeMaterial.fog = false;
 				nodeMaterial.lights = false;
 				nodeMaterial.lights = false;
 				nodeMaterial.vertexNode = viewProj;
 				nodeMaterial.vertexNode = viewProj;
@@ -51612,7 +51613,7 @@ class Renderer {
 
 
 		//
 		//
 
 
-		if ( scene.overrideMaterial !== null ) {
+		if ( material.allowOverride === true && scene.overrideMaterial !== null ) {
 
 
 			const overrideMaterial = scene.overrideMaterial;
 			const overrideMaterial = scene.overrideMaterial;
 
 

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


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

粤ICP备19079148号