Mr.doob 1 mese fa
parent
commit
0766ef9b6d

+ 11 - 12
build/three.cjs

@@ -20409,7 +20409,7 @@ class Mesh extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -28912,7 +28912,7 @@ class Line extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -29447,7 +29447,7 @@ class Points extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -42701,7 +42701,7 @@ class KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default ''
  * @default ''
  */
  */
 KeyframeTrack.prototype.ValueTypeName = '';
 KeyframeTrack.prototype.ValueTypeName = '';
@@ -42758,7 +42758,7 @@ class BooleanKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'bool'
  * @default 'bool'
  */
  */
 BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
 BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
@@ -42807,7 +42807,7 @@ class ColorKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'color'
  * @default 'color'
  */
  */
 ColorKeyframeTrack.prototype.ValueTypeName = 'color';
 ColorKeyframeTrack.prototype.ValueTypeName = 'color';
@@ -42838,7 +42838,7 @@ class NumberKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'number'
  * @default 'number'
  */
  */
 NumberKeyframeTrack.prototype.ValueTypeName = 'number';
 NumberKeyframeTrack.prototype.ValueTypeName = 'number';
@@ -42925,7 +42925,7 @@ class QuaternionKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'quaternion'
  * @default 'quaternion'
  */
  */
 QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
 QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
@@ -42961,7 +42961,7 @@ class StringKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'string'
  * @default 'string'
  */
  */
 StringKeyframeTrack.prototype.ValueTypeName = 'string';
 StringKeyframeTrack.prototype.ValueTypeName = 'string';
@@ -43010,7 +43010,7 @@ class VectorKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'vector'
  * @default 'vector'
  */
  */
 VectorKeyframeTrack.prototype.ValueTypeName = 'vector';
 VectorKeyframeTrack.prototype.ValueTypeName = 'vector';
@@ -69556,9 +69556,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 	try {
 	try {
 
 
 		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
 		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
-			// eslint-disable-next-line compat/compat
 			&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;
 			&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;
 
 
+
 	} catch ( err ) {
 	} catch ( err ) {
 
 
 		// Ignore any errors
 		// Ignore any errors
@@ -69570,7 +69570,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		// Use OffscreenCanvas when available. Specially needed in web workers
 		// Use OffscreenCanvas when available. Specially needed in web workers
 
 
 		return useOffscreenCanvas ?
 		return useOffscreenCanvas ?
-			// eslint-disable-next-line compat/compat
 			new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
 			new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
 
 
 	}
 	}

+ 10 - 10
build/three.core.js

@@ -20407,7 +20407,7 @@ class Mesh extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -28910,7 +28910,7 @@ class Line extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -29445,7 +29445,7 @@ class Points extends Object3D {
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * morph targets name, the value its attribute index. This member is `undefined`
 		 * by default and only set when morph targets are detected in the geometry.
 		 * by default and only set when morph targets are detected in the geometry.
 		 *
 		 *
-		 * @type {Object<String,number>|undefined}
+		 * @type {Object<string,number>|undefined}
 		 * @default undefined
 		 * @default undefined
 		 */
 		 */
 		this.morphTargetDictionary = undefined;
 		this.morphTargetDictionary = undefined;
@@ -42699,7 +42699,7 @@ class KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default ''
  * @default ''
  */
  */
 KeyframeTrack.prototype.ValueTypeName = '';
 KeyframeTrack.prototype.ValueTypeName = '';
@@ -42756,7 +42756,7 @@ class BooleanKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'bool'
  * @default 'bool'
  */
  */
 BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
 BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
@@ -42805,7 +42805,7 @@ class ColorKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'color'
  * @default 'color'
  */
  */
 ColorKeyframeTrack.prototype.ValueTypeName = 'color';
 ColorKeyframeTrack.prototype.ValueTypeName = 'color';
@@ -42836,7 +42836,7 @@ class NumberKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'number'
  * @default 'number'
  */
  */
 NumberKeyframeTrack.prototype.ValueTypeName = 'number';
 NumberKeyframeTrack.prototype.ValueTypeName = 'number';
@@ -42923,7 +42923,7 @@ class QuaternionKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'quaternion'
  * @default 'quaternion'
  */
  */
 QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
 QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
@@ -42959,7 +42959,7 @@ class StringKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'string'
  * @default 'string'
  */
  */
 StringKeyframeTrack.prototype.ValueTypeName = 'string';
 StringKeyframeTrack.prototype.ValueTypeName = 'string';
@@ -43008,7 +43008,7 @@ class VectorKeyframeTrack extends KeyframeTrack {
 /**
 /**
  * The value type name.
  * The value type name.
  *
  *
- * @type {String}
+ * @type {string}
  * @default 'vector'
  * @default 'vector'
  */
  */
 VectorKeyframeTrack.prototype.ValueTypeName = 'vector';
 VectorKeyframeTrack.prototype.ValueTypeName = 'vector';

+ 1 - 2
build/three.module.js

@@ -10485,9 +10485,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 	try {
 	try {
 
 
 		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
 		useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
-			// eslint-disable-next-line compat/compat
 			&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;
 			&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;
 
 
+
 	} catch ( err ) {
 	} catch ( err ) {
 
 
 		// Ignore any errors
 		// Ignore any errors
@@ -10499,7 +10499,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		// Use OffscreenCanvas when available. Specially needed in web workers
 		// Use OffscreenCanvas when available. Specially needed in web workers
 
 
 		return useOffscreenCanvas ?
 		return useOffscreenCanvas ?
-			// eslint-disable-next-line compat/compat
 			new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
 			new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
 
 
 	}
 	}

+ 82 - 50
build/three.webgpu.js

@@ -2238,6 +2238,19 @@ class ArrayElementNode extends Node { // @TODO: If extending from TempNode it br
 
 
 	}
 	}
 
 
+	/**
+	 * This method is overwritten since the member type is inferred from the array-like node.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @param {string} name - The member name.
+	 * @return {string} The member type.
+	 */
+	getMemberType( builder, name ) {
+
+		return this.node.getMemberType( builder, name );
+
+	}
+
 	generate( builder ) {
 	generate( builder ) {
 
 
 		const indexType = this.indexNode.getNodeType( builder );
 		const indexType = this.indexNode.getNodeType( builder );
@@ -3669,7 +3682,7 @@ const ShaderNodeProxy = function ( NodeClass, scope = null, factor = null, setti
 
 
 const ShaderNodeImmutable = function ( NodeClass, ...params ) {
 const ShaderNodeImmutable = function ( NodeClass, ...params ) {
 
 
-	return nodeObject( new NodeClass( ...nodeArray( params ) ) );
+	return new NodeClass( ...nodeArray( params ) );
 
 
 };
 };
 
 
@@ -4101,7 +4114,7 @@ const ConvertType = function ( type, cacheMap = null ) {
 
 
 				error( `TSL: Invalid parameter for the type "${ type }".` );
 				error( `TSL: Invalid parameter for the type "${ type }".` );
 
 
-				return nodeObject( new ConstNode( 0, type ) );
+				return new ConstNode( 0, type );
 
 
 			}
 			}
 
 
@@ -4393,8 +4406,8 @@ const mat2 = new ConvertType( 'mat2' );
 const mat3 = new ConvertType( 'mat3' );
 const mat3 = new ConvertType( 'mat3' );
 const mat4 = new ConvertType( 'mat4' );
 const mat4 = new ConvertType( 'mat4' );
 
 
-const string = ( value = '' ) => nodeObject( new ConstNode( value, 'string' ) );
-const arrayBuffer = ( value ) => nodeObject( new ConstNode( value, 'ArrayBuffer' ) );
+const string = ( value = '' ) => new ConstNode( value, 'string' );
+const arrayBuffer = ( value ) => new ConstNode( value, 'ArrayBuffer' );
 
 
 addMethodChaining( 'toColor', color );
 addMethodChaining( 'toColor', color );
 addMethodChaining( 'toFloat', float );
 addMethodChaining( 'toFloat', float );
@@ -4559,7 +4572,7 @@ class PropertyNode extends Node {
  * @param {?string} [name=null] - The name of the property in the shader.
  * @param {?string} [name=null] - The name of the property in the shader.
  * @returns {PropertyNode}
  * @returns {PropertyNode}
  */
  */
-const property = ( type, name ) => nodeObject( new PropertyNode( type, name ) );
+const property = ( type, name ) => new PropertyNode( type, name );
 
 
 /**
 /**
  * TSL function for creating a varying property node.
  * TSL function for creating a varying property node.
@@ -4570,7 +4583,7 @@ const property = ( type, name ) => nodeObject( new PropertyNode( type, name ) );
  * @param {?string} [name=null] - The name of the varying in the shader.
  * @param {?string} [name=null] - The name of the varying in the shader.
  * @returns {PropertyNode}
  * @returns {PropertyNode}
  */
  */
-const varyingProperty = ( type, name ) => nodeObject( new PropertyNode( type, name, true ) );
+const varyingProperty = ( type, name ) => new PropertyNode( type, name, true );
 
 
 /**
 /**
  * TSL object that represents the shader variable `DiffuseColor`.
  * TSL object that represents the shader variable `DiffuseColor`.
@@ -5193,7 +5206,7 @@ const uniform = ( value, type ) => {
 
 
 	}
 	}
 
 
-	return nodeObject( new UniformNode( value, nodeType ) );
+	return new UniformNode( value, nodeType );
 
 
 };
 };
 
 
@@ -5277,7 +5290,7 @@ class ArrayNode extends TempNode {
 
 
 		if ( this.nodeType === null ) {
 		if ( this.nodeType === null ) {
 
 
-			this.nodeType = this.values[ 0 ].getNodeType( builder );
+			return this.values[ 0 ].getNodeType( builder );
 
 
 		}
 		}
 
 
@@ -5297,6 +5310,25 @@ class ArrayNode extends TempNode {
 
 
 	}
 	}
 
 
+	/**
+	 * Returns the type of a member variable.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @param {string} name - The name of the member variable.
+	 * @return {string} The type of the member variable.
+	 */
+	getMemberType( builder, name ) {
+
+		if ( this.nodeType === null ) {
+
+			return this.values[ 0 ].getMemberType( builder, name );
+
+		}
+
+		return super.getMemberType( builder, name );
+
+	}
+
 	/**
 	/**
 	 * This method builds the output node and returns the resulting array as a shader string.
 	 * This method builds the output node and returns the resulting array as a shader string.
 	 *
 	 *
@@ -9214,7 +9246,7 @@ class ReferenceBaseNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new ReferenceElementNode$1( this, nodeObject( indexNode ) ) );
+		return new ReferenceElementNode$1( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -9353,7 +9385,7 @@ class ReferenceBaseNode extends Node {
  * @param {Object} object - The object the property belongs to.
  * @param {Object} object - The object the property belongs to.
  * @returns {ReferenceBaseNode}
  * @returns {ReferenceBaseNode}
  */
  */
-const reference$1 = ( name, type, object ) => nodeObject( new ReferenceBaseNode( name, type, object ) );
+const reference$1 = ( name, type, object ) => new ReferenceBaseNode( name, type, object );
 
 
 /**
 /**
  * This node is a special type of reference node which is intended
  * This node is a special type of reference node which is intended
@@ -9427,7 +9459,7 @@ class RendererReferenceNode extends ReferenceBaseNode {
  * the node refers to the renderer of the current state.
  * the node refers to the renderer of the current state.
  * @returns {RendererReferenceNode}
  * @returns {RendererReferenceNode}
  */
  */
-const rendererReference = ( name, type, renderer = null ) => nodeObject( new RendererReferenceNode( name, type, renderer ) );
+const rendererReference = ( name, type, renderer = null ) => new RendererReferenceNode( name, type, renderer );
 
 
 /**
 /**
  * This node represents a tone mapping operation.
  * This node represents a tone mapping operation.
@@ -11339,7 +11371,7 @@ class AttributeNode extends Node {
  * @param {?string} [nodeType=null] - The node type.
  * @param {?string} [nodeType=null] - The node type.
  * @returns {AttributeNode}
  * @returns {AttributeNode}
  */
  */
-const attribute = ( name, nodeType = null ) => nodeObject( new AttributeNode( name, nodeType ) );
+const attribute = ( name, nodeType = null ) => new AttributeNode( name, nodeType );
 
 
 /**
 /**
  * TSL function for creating an uv attribute node with the given index.
  * TSL function for creating an uv attribute node with the given index.
@@ -12557,7 +12589,7 @@ class BufferNode extends UniformNode {
  * @param {number} count - The count of buffer elements.
  * @param {number} count - The count of buffer elements.
  * @returns {BufferNode}
  * @returns {BufferNode}
  */
  */
-const buffer = ( value, type, count ) => nodeObject( new BufferNode( value, type, count ) );
+const buffer = ( value, type, count ) => new BufferNode( value, type, count );
 
 
 /**
 /**
  * Represents the element access on uniform array nodes.
  * Represents the element access on uniform array nodes.
@@ -12883,7 +12915,7 @@ class UniformArrayNode extends BufferNode {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new UniformArrayElementNode( this, nodeObject( indexNode ) ) );
+		return new UniformArrayElementNode( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -12898,7 +12930,7 @@ class UniformArrayNode extends BufferNode {
  * @param {?string} [nodeType] - The data type of the array elements.
  * @param {?string} [nodeType] - The data type of the array elements.
  * @returns {UniformArrayNode}
  * @returns {UniformArrayNode}
  */
  */
-const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) );
+const uniformArray = ( values, nodeType ) => new UniformArrayNode( values, nodeType );
 
 
 /**
 /**
  * The node allows to set values for built-in shader variables. That is
  * The node allows to set values for built-in shader variables. That is
@@ -14844,7 +14876,7 @@ class ReferenceNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new ReferenceElementNode( this, nodeObject( indexNode ) ) );
+		return new ReferenceElementNode( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -15051,7 +15083,7 @@ class ReferenceNode extends Node {
  * @param {?Object} [object] - The object the property belongs to.
  * @param {?Object} [object] - The object the property belongs to.
  * @returns {ReferenceNode}
  * @returns {ReferenceNode}
  */
  */
-const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );
+const reference = ( name, type, object ) => new ReferenceNode( name, type, object );
 
 
 /**
 /**
  * TSL function for creating a reference node. Use this function if you want need a reference
  * TSL function for creating a reference node. Use this function if you want need a reference
@@ -15065,7 +15097,7 @@ const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name,
  * @param {Object} object - An array-like object the property belongs to.
  * @param {Object} object - An array-like object the property belongs to.
  * @returns {ReferenceNode}
  * @returns {ReferenceNode}
  */
  */
-const referenceBuffer = ( name, type, count, object ) => nodeObject( new ReferenceNode( name, type, object, count ) );
+const referenceBuffer = ( name, type, count, object ) => new ReferenceNode( name, type, object, count );
 
 
 /**
 /**
  * This node is a special type of reference node which is intended
  * This node is a special type of reference node which is intended
@@ -15146,7 +15178,7 @@ class MaterialReferenceNode extends ReferenceNode {
  * When no material is set, the node refers to the material of the current rendered object.
  * When no material is set, the node refers to the material of the current rendered object.
  * @returns {MaterialReferenceNode}
  * @returns {MaterialReferenceNode}
  */
  */
-const materialReference = ( name, type, material = null ) => nodeObject( new MaterialReferenceNode( name, type, material ) );
+const materialReference = ( name, type, material = null ) => new MaterialReferenceNode( name, type, material );
 
 
 // Normal Mapping Without Precomputed Tangents
 // Normal Mapping Without Precomputed Tangents
 // http://www.thetenthplanet.de/archives/1180
 // http://www.thetenthplanet.de/archives/1180
@@ -16959,7 +16991,7 @@ class StorageBufferNode extends BufferNode {
  * @param {number} [count=0] - The buffer count.
  * @param {number} [count=0] - The buffer count.
  * @returns {StorageBufferNode}
  * @returns {StorageBufferNode}
  */
  */
-const storage = ( value, type = null, count = 0 ) => nodeObject( new StorageBufferNode( value, type, count ) );
+const storage = ( value, type = null, count = 0 ) => new StorageBufferNode( value, type, count );
 
 
 /**
 /**
  * @tsl
  * @tsl
@@ -17902,7 +17934,7 @@ class SkinningNode extends Node {
  * @param {SkinnedMesh} skinnedMesh - The skinned mesh.
  * @param {SkinnedMesh} skinnedMesh - The skinned mesh.
  * @returns {SkinningNode}
  * @returns {SkinningNode}
  */
  */
-const skinning = ( skinnedMesh ) => nodeObject( new SkinningNode( skinnedMesh ) );
+const skinning = ( skinnedMesh ) => new SkinningNode( skinnedMesh );
 
 
 /**
 /**
  * TSL function for computing skinning.
  * TSL function for computing skinning.
@@ -19579,7 +19611,7 @@ ClippingNode.HARDWARE = 'hardware';
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const clipping = () => nodeObject( new ClippingNode() );
+const clipping = () => new ClippingNode();
 
 
 /**
 /**
  * TSL function for setting up alpha to coverage.
  * TSL function for setting up alpha to coverage.
@@ -19588,7 +19620,7 @@ const clipping = () => nodeObject( new ClippingNode() );
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const clippingAlpha = () => nodeObject( new ClippingNode( ClippingNode.ALPHA_TO_COVERAGE ) );
+const clippingAlpha = () => new ClippingNode( ClippingNode.ALPHA_TO_COVERAGE );
 
 
 /**
 /**
  * TSL function for setting up hardware-based clipping.
  * TSL function for setting up hardware-based clipping.
@@ -19597,7 +19629,7 @@ const clippingAlpha = () => nodeObject( new ClippingNode( ClippingNode.ALPHA_TO_
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const hardwareClipping = () => nodeObject( new ClippingNode( ClippingNode.HARDWARE ) );
+const hardwareClipping = () => new ClippingNode( ClippingNode.HARDWARE );
 
 
 // See: https://casual-effects.com/research/Wyman2017Hashed/index.html
 // See: https://casual-effects.com/research/Wyman2017Hashed/index.html
 
 
@@ -19767,7 +19799,7 @@ class VertexColorNode extends AttributeNode {
  * @param {number} [index=0] - The attribute index.
  * @param {number} [index=0] - The attribute index.
  * @returns {VertexColorNode}
  * @returns {VertexColorNode}
  */
  */
-const vertexColor = ( index = 0 ) => nodeObject( new VertexColorNode( index ) );
+const vertexColor = ( index = 0 ) => new VertexColorNode( index );
 
 
 /**
 /**
  * Represents a "Color Burn" blend mode.
  * Represents a "Color Burn" blend mode.
@@ -33146,7 +33178,7 @@ class ParameterNode extends PropertyNode {
  * @param {?string} name - The name of the parameter in the shader.
  * @param {?string} name - The name of the parameter in the shader.
  * @returns {ParameterNode}
  * @returns {ParameterNode}
  */
  */
-const parameter = ( type, name ) => nodeObject( new ParameterNode( type, name ) );
+const parameter = ( type, name ) => new ParameterNode( type, name );
 
 
 /**
 /**
  * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
  * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
@@ -33814,7 +33846,7 @@ const struct = ( membersLayout, name = null ) => {
 
 
 		}
 		}
 
 
-		return nodeObject( new StructNode( structLayout, values ) );
+		return new StructNode( structLayout, values );
 
 
 	};
 	};
 
 
@@ -36107,7 +36139,7 @@ class ReflectorBaseNode extends Node {
  * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node.
  * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node.
  * @returns {ReflectorNode}
  * @returns {ReflectorNode}
  */
  */
-const reflector = ( parameters ) => nodeObject( new ReflectorNode( parameters ) );
+const reflector = ( parameters ) => new ReflectorNode( parameters );
 
 
 const _camera = /*@__PURE__*/ new OrthographicCamera( -1, 1, 1, -1, 0, 1 );
 const _camera = /*@__PURE__*/ new OrthographicCamera( -1, 1, 1, -1, 0, 1 );
 
 
@@ -36724,7 +36756,7 @@ class SampleNode extends Node {
  * @param {?Node<vec2>} [uv=null] - The UV node to be used in the texture sampling.
  * @param {?Node<vec2>} [uv=null] - The UV node to be used in the texture sampling.
  * @returns {SampleNode} The created SampleNode instance wrapped as a node object.
  * @returns {SampleNode} The created SampleNode instance wrapped as a node object.
  */
  */
-const sample = ( callback, uv = null ) => nodeObject( new SampleNode( callback, nodeObject( uv ) ) );
+const sample = ( callback, uv = null ) => new SampleNode( callback, nodeObject( uv ) );
 
 
 /**
 /**
  * EventNode is a node that executes a callback during specific update phases.
  * EventNode is a node that executes a callback during specific update phases.
@@ -36798,7 +36830,7 @@ EventNode.BEFORE_MATERIAL = 'beforeMaterial';
  * @param {Function} callback - The callback function.
  * @param {Function} callback - The callback function.
  * @returns {EventNode}
  * @returns {EventNode}
  */
  */
-const createEvent = ( type, callback ) => nodeObject( new EventNode( type, callback ) ).toStack();
+const createEvent = ( type, callback ) => new EventNode( type, callback ).toStack();
 
 
 /**
 /**
  * Creates an event that triggers a function every time an object (Mesh|Sprite) is rendered.
  * Creates an event that triggers a function every time an object (Mesh|Sprite) is rendered.
@@ -37725,7 +37757,7 @@ class UserDataNode extends ReferenceNode {
  * @param {?Object} userData - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated.
  * @param {?Object} userData - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated.
  * @returns {UserDataNode}
  * @returns {UserDataNode}
  */
  */
-const userData = ( name, inputType, userData ) => nodeObject( new UserDataNode( name, inputType, userData ) );
+const userData = ( name, inputType, userData ) => new UserDataNode( name, inputType, userData );
 
 
 const _objectData = new WeakMap();
 const _objectData = new WeakMap();
 
 
@@ -38746,7 +38778,7 @@ class PassNode extends TempNode {
 
 
 		if ( textureNode === undefined ) {
 		if ( textureNode === undefined ) {
 
 
-			textureNode = nodeObject( new PassMultipleTextureNode( this, name ) );
+			textureNode = new PassMultipleTextureNode( this, name );
 			textureNode.updateTexture();
 			textureNode.updateTexture();
 			this._textureNodes[ name ] = textureNode;
 			this._textureNodes[ name ] = textureNode;
 
 
@@ -38770,7 +38802,7 @@ class PassNode extends TempNode {
 
 
 			if ( this._textureNodes[ name ] === undefined ) this.getTextureNode( name );
 			if ( this._textureNodes[ name ] === undefined ) this.getTextureNode( name );
 
 
-			textureNode = nodeObject( new PassMultipleTextureNode( this, name, true ) );
+			textureNode = new PassMultipleTextureNode( this, name, true );
 			textureNode.updateTexture();
 			textureNode.updateTexture();
 			this._previousTextureNodes[ name ] = textureNode;
 			this._previousTextureNodes[ name ] = textureNode;
 
 
@@ -39111,7 +39143,7 @@ PassNode.DEPTH = 'depth';
  * @param {Object} options - Options for the internal render target.
  * @param {Object} options - Options for the internal render target.
  * @returns {PassNode}
  * @returns {PassNode}
  */
  */
-const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.COLOR, scene, camera, options ) );
+const pass = ( scene, camera, options ) => new PassNode( PassNode.COLOR, scene, camera, options );
 
 
 /**
 /**
  * TSL function for creating a pass texture node.
  * TSL function for creating a pass texture node.
@@ -39122,7 +39154,7 @@ const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.CO
  * @param {Texture} texture - The output texture.
  * @param {Texture} texture - The output texture.
  * @returns {PassTextureNode}
  * @returns {PassTextureNode}
  */
  */
-const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass, texture ) );
+const passTexture = ( pass, texture ) => new PassTextureNode( pass, texture );
 
 
 /**
 /**
  * TSL function for creating a depth pass node.
  * TSL function for creating a depth pass node.
@@ -39134,7 +39166,7 @@ const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass,
  * @param {Object} options - Options for the internal render target.
  * @param {Object} options - Options for the internal render target.
  * @returns {PassNode}
  * @returns {PassNode}
  */
  */
-const depthPass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.DEPTH, scene, camera, options ) );
+const depthPass = ( scene, camera, options ) => new PassNode( PassNode.DEPTH, scene, camera, options );
 
 
 /**
 /**
  * Represents a render pass for producing a toon outline effect on compatible objects.
  * Represents a render pass for producing a toon outline effect on compatible objects.
@@ -39898,7 +39930,7 @@ const nativeFn = ( code, includes = [], language = '' ) => {
 
 
 	}
 	}
 
 
-	const functionNode = nodeObject( new FunctionNode( code, includes, language ) );
+	const functionNode = new FunctionNode( code, includes, language );
 
 
 	const fn = ( ...params ) => functionNode.call( ...params );
 	const fn = ( ...params ) => functionNode.call( ...params );
 	fn.functionNode = functionNode;
 	fn.functionNode = functionNode;
@@ -41327,7 +41359,7 @@ class ComputeBuiltinNode extends Node {
  * @param {string} nodeType - The node type.
  * @param {string} nodeType - The node type.
  * @returns {ComputeBuiltinNode}
  * @returns {ComputeBuiltinNode}
  */
  */
-const computeBuiltin = ( name, nodeType ) => nodeObject( new ComputeBuiltinNode( name, nodeType ) );
+const computeBuiltin = ( name, nodeType ) => new ComputeBuiltinNode( name, nodeType );
 
 
 /**
 /**
  * Represents the number of workgroups dispatched by the compute shader.
  * Represents the number of workgroups dispatched by the compute shader.
@@ -41688,7 +41720,7 @@ class WorkgroupInfoNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new WorkgroupInfoElementNode( this, indexNode ) );
+		return new WorkgroupInfoElementNode( this, indexNode );
 
 
 	}
 	}
 
 
@@ -41712,7 +41744,7 @@ class WorkgroupInfoNode extends Node {
  * @param {number} [count=0] - The number of elements in the buffer.
  * @param {number} [count=0] - The number of elements in the buffer.
  * @returns {WorkgroupInfoNode}
  * @returns {WorkgroupInfoNode}
  */
  */
-const workgroupArray = ( type, count ) => nodeObject( new WorkgroupInfoNode( 'Workgroup', type, count ) );
+const workgroupArray = ( type, count ) => new WorkgroupInfoNode( 'Workgroup', type, count );
 
 
 /**
 /**
  * `AtomicFunctionNode` represents any function that can operate on atomic variable types
  * `AtomicFunctionNode` represents any function that can operate on atomic variable types
@@ -42016,7 +42048,7 @@ class SubgroupFunctionNode extends TempNode {
 		/**
 		/**
 		 * The subgroup/wave intrinsic method to construct.
 		 * The subgroup/wave intrinsic method to construct.
 		 *
 		 *
-		 * @type {String}
+		 * @type {string}
 		 */
 		 */
 		this.method = method;
 		this.method = method;
 
 
@@ -42798,7 +42830,7 @@ class LightsNode extends Node {
 
 
 					if ( ! _lightsNodeRef.has( light ) ) {
 					if ( ! _lightsNodeRef.has( light ) ) {
 
 
-						lightNode = nodeObject( new lightNodeClass( light ) );
+						lightNode = new lightNodeClass( light );
 						_lightsNodeRef.set( light, lightNode );
 						_lightsNodeRef.set( light, lightNode );
 
 
 					} else {
 					} else {
@@ -43012,7 +43044,7 @@ class LightsNode extends Node {
  * @param {Array<Light>} lights - An array of lights.
  * @param {Array<Light>} lights - An array of lights.
  * @return {LightsNode} The created lights node.
  * @return {LightsNode} The created lights node.
  */
  */
-const lights = ( lights = [] ) => nodeObject( new LightsNode() ).setLights( lights );
+const lights = ( lights = [] ) => new LightsNode().setLights( lights );
 
 
 /**
 /**
  * Base class for all shadow nodes.
  * Base class for all shadow nodes.
@@ -44399,7 +44431,7 @@ class ShadowNode extends ShadowBaseNode {
  * @param {?LightShadow} [shadow] - The light shadow.
  * @param {?LightShadow} [shadow] - The light shadow.
  * @return {ShadowNode} The created shadow node.
  * @return {ShadowNode} The created shadow node.
  */
  */
-const shadow = ( light, shadow ) => nodeObject( new ShadowNode( light, shadow ) );
+const shadow = ( light, shadow ) => new ShadowNode( light, shadow );
 
 
 const _clearColor$1 = /*@__PURE__*/ new Color();
 const _clearColor$1 = /*@__PURE__*/ new Color();
 const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();
 const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();
@@ -44696,7 +44728,7 @@ class PointShadowNode extends ShadowNode {
  * @param {?PointLightShadow} [shadow=null] - An optional point light shadow.
  * @param {?PointLightShadow} [shadow=null] - An optional point light shadow.
  * @return {PointShadowNode} The created point shadow node.
  * @return {PointShadowNode} The created point shadow node.
  */
  */
-const pointShadow = ( light, shadow ) => nodeObject( new PointShadowNode( light, shadow ) );
+const pointShadow = ( light, shadow ) => new PointShadowNode( light, shadow );
 
 
 /**
 /**
  * Base class for analytic light nodes.
  * Base class for analytic light nodes.
@@ -72219,7 +72251,9 @@ class WebGPUTextureUtils {
 				}
 				}
 			);
 			);
 
 
-		} catch ( _ ) {} // try/catch has been added to fix bad video frame data on certain devices, see #32391
+			// try/catch has been added to fix bad video frame data on certain devices, see #32391
+
+		} catch ( _ ) {}
 
 
 	}
 	}
 
 
@@ -75047,9 +75081,7 @@ ${ flowData.code }
 
 
 		}
 		}
 
 
-		let code = bindingSnippets.join( '\n' );
-		code += bufferSnippets.join( '\n' );
-		code += structSnippets.join( '\n' );
+		const code = [ ...bindingSnippets, ...bufferSnippets, ...structSnippets ].join( '\n' );
 
 
 		return code;
 		return code;
 
 
@@ -81454,7 +81486,7 @@ class NodeLoader extends Loader {
 
 
 		}
 		}
 
 
-		return nodeObject( new this.nodes[ type ]() );
+		return new this.nodes[ type ]();
 
 
 	}
 	}
 
 

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


+ 82 - 50
build/three.webgpu.nodes.js

@@ -2238,6 +2238,19 @@ class ArrayElementNode extends Node { // @TODO: If extending from TempNode it br
 
 
 	}
 	}
 
 
+	/**
+	 * This method is overwritten since the member type is inferred from the array-like node.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @param {string} name - The member name.
+	 * @return {string} The member type.
+	 */
+	getMemberType( builder, name ) {
+
+		return this.node.getMemberType( builder, name );
+
+	}
+
 	generate( builder ) {
 	generate( builder ) {
 
 
 		const indexType = this.indexNode.getNodeType( builder );
 		const indexType = this.indexNode.getNodeType( builder );
@@ -3669,7 +3682,7 @@ const ShaderNodeProxy = function ( NodeClass, scope = null, factor = null, setti
 
 
 const ShaderNodeImmutable = function ( NodeClass, ...params ) {
 const ShaderNodeImmutable = function ( NodeClass, ...params ) {
 
 
-	return nodeObject( new NodeClass( ...nodeArray( params ) ) );
+	return new NodeClass( ...nodeArray( params ) );
 
 
 };
 };
 
 
@@ -4101,7 +4114,7 @@ const ConvertType = function ( type, cacheMap = null ) {
 
 
 				error( `TSL: Invalid parameter for the type "${ type }".` );
 				error( `TSL: Invalid parameter for the type "${ type }".` );
 
 
-				return nodeObject( new ConstNode( 0, type ) );
+				return new ConstNode( 0, type );
 
 
 			}
 			}
 
 
@@ -4393,8 +4406,8 @@ const mat2 = new ConvertType( 'mat2' );
 const mat3 = new ConvertType( 'mat3' );
 const mat3 = new ConvertType( 'mat3' );
 const mat4 = new ConvertType( 'mat4' );
 const mat4 = new ConvertType( 'mat4' );
 
 
-const string = ( value = '' ) => nodeObject( new ConstNode( value, 'string' ) );
-const arrayBuffer = ( value ) => nodeObject( new ConstNode( value, 'ArrayBuffer' ) );
+const string = ( value = '' ) => new ConstNode( value, 'string' );
+const arrayBuffer = ( value ) => new ConstNode( value, 'ArrayBuffer' );
 
 
 addMethodChaining( 'toColor', color );
 addMethodChaining( 'toColor', color );
 addMethodChaining( 'toFloat', float );
 addMethodChaining( 'toFloat', float );
@@ -4559,7 +4572,7 @@ class PropertyNode extends Node {
  * @param {?string} [name=null] - The name of the property in the shader.
  * @param {?string} [name=null] - The name of the property in the shader.
  * @returns {PropertyNode}
  * @returns {PropertyNode}
  */
  */
-const property = ( type, name ) => nodeObject( new PropertyNode( type, name ) );
+const property = ( type, name ) => new PropertyNode( type, name );
 
 
 /**
 /**
  * TSL function for creating a varying property node.
  * TSL function for creating a varying property node.
@@ -4570,7 +4583,7 @@ const property = ( type, name ) => nodeObject( new PropertyNode( type, name ) );
  * @param {?string} [name=null] - The name of the varying in the shader.
  * @param {?string} [name=null] - The name of the varying in the shader.
  * @returns {PropertyNode}
  * @returns {PropertyNode}
  */
  */
-const varyingProperty = ( type, name ) => nodeObject( new PropertyNode( type, name, true ) );
+const varyingProperty = ( type, name ) => new PropertyNode( type, name, true );
 
 
 /**
 /**
  * TSL object that represents the shader variable `DiffuseColor`.
  * TSL object that represents the shader variable `DiffuseColor`.
@@ -5193,7 +5206,7 @@ const uniform = ( value, type ) => {
 
 
 	}
 	}
 
 
-	return nodeObject( new UniformNode( value, nodeType ) );
+	return new UniformNode( value, nodeType );
 
 
 };
 };
 
 
@@ -5277,7 +5290,7 @@ class ArrayNode extends TempNode {
 
 
 		if ( this.nodeType === null ) {
 		if ( this.nodeType === null ) {
 
 
-			this.nodeType = this.values[ 0 ].getNodeType( builder );
+			return this.values[ 0 ].getNodeType( builder );
 
 
 		}
 		}
 
 
@@ -5297,6 +5310,25 @@ class ArrayNode extends TempNode {
 
 
 	}
 	}
 
 
+	/**
+	 * Returns the type of a member variable.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @param {string} name - The name of the member variable.
+	 * @return {string} The type of the member variable.
+	 */
+	getMemberType( builder, name ) {
+
+		if ( this.nodeType === null ) {
+
+			return this.values[ 0 ].getMemberType( builder, name );
+
+		}
+
+		return super.getMemberType( builder, name );
+
+	}
+
 	/**
 	/**
 	 * This method builds the output node and returns the resulting array as a shader string.
 	 * This method builds the output node and returns the resulting array as a shader string.
 	 *
 	 *
@@ -9214,7 +9246,7 @@ class ReferenceBaseNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new ReferenceElementNode$1( this, nodeObject( indexNode ) ) );
+		return new ReferenceElementNode$1( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -9353,7 +9385,7 @@ class ReferenceBaseNode extends Node {
  * @param {Object} object - The object the property belongs to.
  * @param {Object} object - The object the property belongs to.
  * @returns {ReferenceBaseNode}
  * @returns {ReferenceBaseNode}
  */
  */
-const reference$1 = ( name, type, object ) => nodeObject( new ReferenceBaseNode( name, type, object ) );
+const reference$1 = ( name, type, object ) => new ReferenceBaseNode( name, type, object );
 
 
 /**
 /**
  * This node is a special type of reference node which is intended
  * This node is a special type of reference node which is intended
@@ -9427,7 +9459,7 @@ class RendererReferenceNode extends ReferenceBaseNode {
  * the node refers to the renderer of the current state.
  * the node refers to the renderer of the current state.
  * @returns {RendererReferenceNode}
  * @returns {RendererReferenceNode}
  */
  */
-const rendererReference = ( name, type, renderer = null ) => nodeObject( new RendererReferenceNode( name, type, renderer ) );
+const rendererReference = ( name, type, renderer = null ) => new RendererReferenceNode( name, type, renderer );
 
 
 /**
 /**
  * This node represents a tone mapping operation.
  * This node represents a tone mapping operation.
@@ -11339,7 +11371,7 @@ class AttributeNode extends Node {
  * @param {?string} [nodeType=null] - The node type.
  * @param {?string} [nodeType=null] - The node type.
  * @returns {AttributeNode}
  * @returns {AttributeNode}
  */
  */
-const attribute = ( name, nodeType = null ) => nodeObject( new AttributeNode( name, nodeType ) );
+const attribute = ( name, nodeType = null ) => new AttributeNode( name, nodeType );
 
 
 /**
 /**
  * TSL function for creating an uv attribute node with the given index.
  * TSL function for creating an uv attribute node with the given index.
@@ -12557,7 +12589,7 @@ class BufferNode extends UniformNode {
  * @param {number} count - The count of buffer elements.
  * @param {number} count - The count of buffer elements.
  * @returns {BufferNode}
  * @returns {BufferNode}
  */
  */
-const buffer = ( value, type, count ) => nodeObject( new BufferNode( value, type, count ) );
+const buffer = ( value, type, count ) => new BufferNode( value, type, count );
 
 
 /**
 /**
  * Represents the element access on uniform array nodes.
  * Represents the element access on uniform array nodes.
@@ -12883,7 +12915,7 @@ class UniformArrayNode extends BufferNode {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new UniformArrayElementNode( this, nodeObject( indexNode ) ) );
+		return new UniformArrayElementNode( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -12898,7 +12930,7 @@ class UniformArrayNode extends BufferNode {
  * @param {?string} [nodeType] - The data type of the array elements.
  * @param {?string} [nodeType] - The data type of the array elements.
  * @returns {UniformArrayNode}
  * @returns {UniformArrayNode}
  */
  */
-const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) );
+const uniformArray = ( values, nodeType ) => new UniformArrayNode( values, nodeType );
 
 
 /**
 /**
  * The node allows to set values for built-in shader variables. That is
  * The node allows to set values for built-in shader variables. That is
@@ -14844,7 +14876,7 @@ class ReferenceNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new ReferenceElementNode( this, nodeObject( indexNode ) ) );
+		return new ReferenceElementNode( this, nodeObject( indexNode ) );
 
 
 	}
 	}
 
 
@@ -15051,7 +15083,7 @@ class ReferenceNode extends Node {
  * @param {?Object} [object] - The object the property belongs to.
  * @param {?Object} [object] - The object the property belongs to.
  * @returns {ReferenceNode}
  * @returns {ReferenceNode}
  */
  */
-const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );
+const reference = ( name, type, object ) => new ReferenceNode( name, type, object );
 
 
 /**
 /**
  * TSL function for creating a reference node. Use this function if you want need a reference
  * TSL function for creating a reference node. Use this function if you want need a reference
@@ -15065,7 +15097,7 @@ const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name,
  * @param {Object} object - An array-like object the property belongs to.
  * @param {Object} object - An array-like object the property belongs to.
  * @returns {ReferenceNode}
  * @returns {ReferenceNode}
  */
  */
-const referenceBuffer = ( name, type, count, object ) => nodeObject( new ReferenceNode( name, type, object, count ) );
+const referenceBuffer = ( name, type, count, object ) => new ReferenceNode( name, type, object, count );
 
 
 /**
 /**
  * This node is a special type of reference node which is intended
  * This node is a special type of reference node which is intended
@@ -15146,7 +15178,7 @@ class MaterialReferenceNode extends ReferenceNode {
  * When no material is set, the node refers to the material of the current rendered object.
  * When no material is set, the node refers to the material of the current rendered object.
  * @returns {MaterialReferenceNode}
  * @returns {MaterialReferenceNode}
  */
  */
-const materialReference = ( name, type, material = null ) => nodeObject( new MaterialReferenceNode( name, type, material ) );
+const materialReference = ( name, type, material = null ) => new MaterialReferenceNode( name, type, material );
 
 
 // Normal Mapping Without Precomputed Tangents
 // Normal Mapping Without Precomputed Tangents
 // http://www.thetenthplanet.de/archives/1180
 // http://www.thetenthplanet.de/archives/1180
@@ -16959,7 +16991,7 @@ class StorageBufferNode extends BufferNode {
  * @param {number} [count=0] - The buffer count.
  * @param {number} [count=0] - The buffer count.
  * @returns {StorageBufferNode}
  * @returns {StorageBufferNode}
  */
  */
-const storage = ( value, type = null, count = 0 ) => nodeObject( new StorageBufferNode( value, type, count ) );
+const storage = ( value, type = null, count = 0 ) => new StorageBufferNode( value, type, count );
 
 
 /**
 /**
  * @tsl
  * @tsl
@@ -17902,7 +17934,7 @@ class SkinningNode extends Node {
  * @param {SkinnedMesh} skinnedMesh - The skinned mesh.
  * @param {SkinnedMesh} skinnedMesh - The skinned mesh.
  * @returns {SkinningNode}
  * @returns {SkinningNode}
  */
  */
-const skinning = ( skinnedMesh ) => nodeObject( new SkinningNode( skinnedMesh ) );
+const skinning = ( skinnedMesh ) => new SkinningNode( skinnedMesh );
 
 
 /**
 /**
  * TSL function for computing skinning.
  * TSL function for computing skinning.
@@ -19579,7 +19611,7 @@ ClippingNode.HARDWARE = 'hardware';
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const clipping = () => nodeObject( new ClippingNode() );
+const clipping = () => new ClippingNode();
 
 
 /**
 /**
  * TSL function for setting up alpha to coverage.
  * TSL function for setting up alpha to coverage.
@@ -19588,7 +19620,7 @@ const clipping = () => nodeObject( new ClippingNode() );
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const clippingAlpha = () => nodeObject( new ClippingNode( ClippingNode.ALPHA_TO_COVERAGE ) );
+const clippingAlpha = () => new ClippingNode( ClippingNode.ALPHA_TO_COVERAGE );
 
 
 /**
 /**
  * TSL function for setting up hardware-based clipping.
  * TSL function for setting up hardware-based clipping.
@@ -19597,7 +19629,7 @@ const clippingAlpha = () => nodeObject( new ClippingNode( ClippingNode.ALPHA_TO_
  * @function
  * @function
  * @returns {ClippingNode}
  * @returns {ClippingNode}
  */
  */
-const hardwareClipping = () => nodeObject( new ClippingNode( ClippingNode.HARDWARE ) );
+const hardwareClipping = () => new ClippingNode( ClippingNode.HARDWARE );
 
 
 // See: https://casual-effects.com/research/Wyman2017Hashed/index.html
 // See: https://casual-effects.com/research/Wyman2017Hashed/index.html
 
 
@@ -19767,7 +19799,7 @@ class VertexColorNode extends AttributeNode {
  * @param {number} [index=0] - The attribute index.
  * @param {number} [index=0] - The attribute index.
  * @returns {VertexColorNode}
  * @returns {VertexColorNode}
  */
  */
-const vertexColor = ( index = 0 ) => nodeObject( new VertexColorNode( index ) );
+const vertexColor = ( index = 0 ) => new VertexColorNode( index );
 
 
 /**
 /**
  * Represents a "Color Burn" blend mode.
  * Represents a "Color Burn" blend mode.
@@ -33146,7 +33178,7 @@ class ParameterNode extends PropertyNode {
  * @param {?string} name - The name of the parameter in the shader.
  * @param {?string} name - The name of the parameter in the shader.
  * @returns {ParameterNode}
  * @returns {ParameterNode}
  */
  */
-const parameter = ( type, name ) => nodeObject( new ParameterNode( type, name ) );
+const parameter = ( type, name ) => new ParameterNode( type, name );
 
 
 /**
 /**
  * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
  * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
@@ -33814,7 +33846,7 @@ const struct = ( membersLayout, name = null ) => {
 
 
 		}
 		}
 
 
-		return nodeObject( new StructNode( structLayout, values ) );
+		return new StructNode( structLayout, values );
 
 
 	};
 	};
 
 
@@ -36107,7 +36139,7 @@ class ReflectorBaseNode extends Node {
  * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node.
  * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node.
  * @returns {ReflectorNode}
  * @returns {ReflectorNode}
  */
  */
-const reflector = ( parameters ) => nodeObject( new ReflectorNode( parameters ) );
+const reflector = ( parameters ) => new ReflectorNode( parameters );
 
 
 const _camera = /*@__PURE__*/ new OrthographicCamera( -1, 1, 1, -1, 0, 1 );
 const _camera = /*@__PURE__*/ new OrthographicCamera( -1, 1, 1, -1, 0, 1 );
 
 
@@ -36724,7 +36756,7 @@ class SampleNode extends Node {
  * @param {?Node<vec2>} [uv=null] - The UV node to be used in the texture sampling.
  * @param {?Node<vec2>} [uv=null] - The UV node to be used in the texture sampling.
  * @returns {SampleNode} The created SampleNode instance wrapped as a node object.
  * @returns {SampleNode} The created SampleNode instance wrapped as a node object.
  */
  */
-const sample = ( callback, uv = null ) => nodeObject( new SampleNode( callback, nodeObject( uv ) ) );
+const sample = ( callback, uv = null ) => new SampleNode( callback, nodeObject( uv ) );
 
 
 /**
 /**
  * EventNode is a node that executes a callback during specific update phases.
  * EventNode is a node that executes a callback during specific update phases.
@@ -36798,7 +36830,7 @@ EventNode.BEFORE_MATERIAL = 'beforeMaterial';
  * @param {Function} callback - The callback function.
  * @param {Function} callback - The callback function.
  * @returns {EventNode}
  * @returns {EventNode}
  */
  */
-const createEvent = ( type, callback ) => nodeObject( new EventNode( type, callback ) ).toStack();
+const createEvent = ( type, callback ) => new EventNode( type, callback ).toStack();
 
 
 /**
 /**
  * Creates an event that triggers a function every time an object (Mesh|Sprite) is rendered.
  * Creates an event that triggers a function every time an object (Mesh|Sprite) is rendered.
@@ -37725,7 +37757,7 @@ class UserDataNode extends ReferenceNode {
  * @param {?Object} userData - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated.
  * @param {?Object} userData - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated.
  * @returns {UserDataNode}
  * @returns {UserDataNode}
  */
  */
-const userData = ( name, inputType, userData ) => nodeObject( new UserDataNode( name, inputType, userData ) );
+const userData = ( name, inputType, userData ) => new UserDataNode( name, inputType, userData );
 
 
 const _objectData = new WeakMap();
 const _objectData = new WeakMap();
 
 
@@ -38746,7 +38778,7 @@ class PassNode extends TempNode {
 
 
 		if ( textureNode === undefined ) {
 		if ( textureNode === undefined ) {
 
 
-			textureNode = nodeObject( new PassMultipleTextureNode( this, name ) );
+			textureNode = new PassMultipleTextureNode( this, name );
 			textureNode.updateTexture();
 			textureNode.updateTexture();
 			this._textureNodes[ name ] = textureNode;
 			this._textureNodes[ name ] = textureNode;
 
 
@@ -38770,7 +38802,7 @@ class PassNode extends TempNode {
 
 
 			if ( this._textureNodes[ name ] === undefined ) this.getTextureNode( name );
 			if ( this._textureNodes[ name ] === undefined ) this.getTextureNode( name );
 
 
-			textureNode = nodeObject( new PassMultipleTextureNode( this, name, true ) );
+			textureNode = new PassMultipleTextureNode( this, name, true );
 			textureNode.updateTexture();
 			textureNode.updateTexture();
 			this._previousTextureNodes[ name ] = textureNode;
 			this._previousTextureNodes[ name ] = textureNode;
 
 
@@ -39111,7 +39143,7 @@ PassNode.DEPTH = 'depth';
  * @param {Object} options - Options for the internal render target.
  * @param {Object} options - Options for the internal render target.
  * @returns {PassNode}
  * @returns {PassNode}
  */
  */
-const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.COLOR, scene, camera, options ) );
+const pass = ( scene, camera, options ) => new PassNode( PassNode.COLOR, scene, camera, options );
 
 
 /**
 /**
  * TSL function for creating a pass texture node.
  * TSL function for creating a pass texture node.
@@ -39122,7 +39154,7 @@ const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.CO
  * @param {Texture} texture - The output texture.
  * @param {Texture} texture - The output texture.
  * @returns {PassTextureNode}
  * @returns {PassTextureNode}
  */
  */
-const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass, texture ) );
+const passTexture = ( pass, texture ) => new PassTextureNode( pass, texture );
 
 
 /**
 /**
  * TSL function for creating a depth pass node.
  * TSL function for creating a depth pass node.
@@ -39134,7 +39166,7 @@ const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass,
  * @param {Object} options - Options for the internal render target.
  * @param {Object} options - Options for the internal render target.
  * @returns {PassNode}
  * @returns {PassNode}
  */
  */
-const depthPass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.DEPTH, scene, camera, options ) );
+const depthPass = ( scene, camera, options ) => new PassNode( PassNode.DEPTH, scene, camera, options );
 
 
 /**
 /**
  * Represents a render pass for producing a toon outline effect on compatible objects.
  * Represents a render pass for producing a toon outline effect on compatible objects.
@@ -39898,7 +39930,7 @@ const nativeFn = ( code, includes = [], language = '' ) => {
 
 
 	}
 	}
 
 
-	const functionNode = nodeObject( new FunctionNode( code, includes, language ) );
+	const functionNode = new FunctionNode( code, includes, language );
 
 
 	const fn = ( ...params ) => functionNode.call( ...params );
 	const fn = ( ...params ) => functionNode.call( ...params );
 	fn.functionNode = functionNode;
 	fn.functionNode = functionNode;
@@ -41327,7 +41359,7 @@ class ComputeBuiltinNode extends Node {
  * @param {string} nodeType - The node type.
  * @param {string} nodeType - The node type.
  * @returns {ComputeBuiltinNode}
  * @returns {ComputeBuiltinNode}
  */
  */
-const computeBuiltin = ( name, nodeType ) => nodeObject( new ComputeBuiltinNode( name, nodeType ) );
+const computeBuiltin = ( name, nodeType ) => new ComputeBuiltinNode( name, nodeType );
 
 
 /**
 /**
  * Represents the number of workgroups dispatched by the compute shader.
  * Represents the number of workgroups dispatched by the compute shader.
@@ -41688,7 +41720,7 @@ class WorkgroupInfoNode extends Node {
 	 */
 	 */
 	element( indexNode ) {
 	element( indexNode ) {
 
 
-		return nodeObject( new WorkgroupInfoElementNode( this, indexNode ) );
+		return new WorkgroupInfoElementNode( this, indexNode );
 
 
 	}
 	}
 
 
@@ -41712,7 +41744,7 @@ class WorkgroupInfoNode extends Node {
  * @param {number} [count=0] - The number of elements in the buffer.
  * @param {number} [count=0] - The number of elements in the buffer.
  * @returns {WorkgroupInfoNode}
  * @returns {WorkgroupInfoNode}
  */
  */
-const workgroupArray = ( type, count ) => nodeObject( new WorkgroupInfoNode( 'Workgroup', type, count ) );
+const workgroupArray = ( type, count ) => new WorkgroupInfoNode( 'Workgroup', type, count );
 
 
 /**
 /**
  * `AtomicFunctionNode` represents any function that can operate on atomic variable types
  * `AtomicFunctionNode` represents any function that can operate on atomic variable types
@@ -42016,7 +42048,7 @@ class SubgroupFunctionNode extends TempNode {
 		/**
 		/**
 		 * The subgroup/wave intrinsic method to construct.
 		 * The subgroup/wave intrinsic method to construct.
 		 *
 		 *
-		 * @type {String}
+		 * @type {string}
 		 */
 		 */
 		this.method = method;
 		this.method = method;
 
 
@@ -42798,7 +42830,7 @@ class LightsNode extends Node {
 
 
 					if ( ! _lightsNodeRef.has( light ) ) {
 					if ( ! _lightsNodeRef.has( light ) ) {
 
 
-						lightNode = nodeObject( new lightNodeClass( light ) );
+						lightNode = new lightNodeClass( light );
 						_lightsNodeRef.set( light, lightNode );
 						_lightsNodeRef.set( light, lightNode );
 
 
 					} else {
 					} else {
@@ -43012,7 +43044,7 @@ class LightsNode extends Node {
  * @param {Array<Light>} lights - An array of lights.
  * @param {Array<Light>} lights - An array of lights.
  * @return {LightsNode} The created lights node.
  * @return {LightsNode} The created lights node.
  */
  */
-const lights = ( lights = [] ) => nodeObject( new LightsNode() ).setLights( lights );
+const lights = ( lights = [] ) => new LightsNode().setLights( lights );
 
 
 /**
 /**
  * Base class for all shadow nodes.
  * Base class for all shadow nodes.
@@ -44399,7 +44431,7 @@ class ShadowNode extends ShadowBaseNode {
  * @param {?LightShadow} [shadow] - The light shadow.
  * @param {?LightShadow} [shadow] - The light shadow.
  * @return {ShadowNode} The created shadow node.
  * @return {ShadowNode} The created shadow node.
  */
  */
-const shadow = ( light, shadow ) => nodeObject( new ShadowNode( light, shadow ) );
+const shadow = ( light, shadow ) => new ShadowNode( light, shadow );
 
 
 const _clearColor$1 = /*@__PURE__*/ new Color();
 const _clearColor$1 = /*@__PURE__*/ new Color();
 const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();
 const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();
@@ -44696,7 +44728,7 @@ class PointShadowNode extends ShadowNode {
  * @param {?PointLightShadow} [shadow=null] - An optional point light shadow.
  * @param {?PointLightShadow} [shadow=null] - An optional point light shadow.
  * @return {PointShadowNode} The created point shadow node.
  * @return {PointShadowNode} The created point shadow node.
  */
  */
-const pointShadow = ( light, shadow ) => nodeObject( new PointShadowNode( light, shadow ) );
+const pointShadow = ( light, shadow ) => new PointShadowNode( light, shadow );
 
 
 /**
 /**
  * Base class for analytic light nodes.
  * Base class for analytic light nodes.
@@ -72219,7 +72251,9 @@ class WebGPUTextureUtils {
 				}
 				}
 			);
 			);
 
 
-		} catch ( _ ) {} // try/catch has been added to fix bad video frame data on certain devices, see #32391
+			// try/catch has been added to fix bad video frame data on certain devices, see #32391
+
+		} catch ( _ ) {}
 
 
 	}
 	}
 
 
@@ -75047,9 +75081,7 @@ ${ flowData.code }
 
 
 		}
 		}
 
 
-		let code = bindingSnippets.join( '\n' );
-		code += bufferSnippets.join( '\n' );
-		code += structSnippets.join( '\n' );
+		const code = [ ...bindingSnippets, ...bufferSnippets, ...structSnippets ].join( '\n' );
 
 
 		return code;
 		return code;
 
 
@@ -81225,7 +81257,7 @@ class NodeLoader extends Loader {
 
 
 		}
 		}
 
 
-		return nodeObject( new this.nodes[ type ]() );
+		return new this.nodes[ type ]();
 
 
 	}
 	}
 
 

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号