Просмотр исходного кода

Node: Document more modules. (#30109)

* Node: Document more modules.

* Node: Document more modules.

* Docs: Clean up.
Michael Herzog 1 год назад
Родитель
Сommit
78edc1c96f
56 измененных файлов с 943 добавлено и 73 удалено
  1. 63 0
      src/nodes/accessors/BufferNode.js
  2. 58 1
      src/nodes/accessors/Normal.js
  3. 1 1
      src/nodes/accessors/Position.js
  4. 6 6
      src/nodes/accessors/ReferenceNode.js
  5. 36 0
      src/nodes/accessors/Tangent.js
  6. 1 1
      src/nodes/accessors/TextureSizeNode.js
  7. 126 5
      src/nodes/accessors/UniformArrayNode.js
  8. 4 4
      src/nodes/accessors/UserDataNode.js
  9. 2 2
      src/nodes/accessors/VertexColorNode.js
  10. 4 4
      src/nodes/code/CodeNode.js
  11. 1 1
      src/nodes/code/ExpressionNode.js
  12. 1 1
      src/nodes/core/AssignNode.js
  13. 1 1
      src/nodes/core/AttributeNode.js
  14. 1 1
      src/nodes/core/BypassNode.js
  15. 1 1
      src/nodes/core/CacheNode.js
  16. 5 5
      src/nodes/core/ContextNode.js
  17. 1 1
      src/nodes/core/MRTNode.js
  18. 1 1
      src/nodes/core/OutputStructNode.js
  19. 1 1
      src/nodes/core/ParameterNode.js
  20. 1 1
      src/nodes/core/StackNode.js
  21. 1 1
      src/nodes/core/UniformNode.js
  22. 1 1
      src/nodes/core/VarNode.js
  23. 1 1
      src/nodes/core/VaryingNode.js
  24. 10 0
      src/nodes/display/BumpMapNode.js
  25. 1 1
      src/nodes/display/NormalMapNode.js
  26. 5 5
      src/nodes/display/PassNode.js
  27. 1 1
      src/nodes/display/PosterizeNode.js
  28. 1 1
      src/nodes/display/RenderOutputNode.js
  29. 44 2
      src/nodes/display/ScreenNode.js
  30. 17 0
      src/nodes/display/ToneMappingNode.js
  31. 13 0
      src/nodes/display/ToonOutlinePassNode.js
  32. 84 8
      src/nodes/display/ViewportDepthNode.js
  33. 12 2
      src/nodes/display/ViewportDepthTextureNode.js
  34. 11 1
      src/nodes/display/ViewportSharedTextureNode.js
  35. 22 1
      src/nodes/display/ViewportTextureNode.js
  36. 1 1
      src/nodes/geometry/RangeNode.js
  37. 1 1
      src/nodes/lighting/LightingContextNode.js
  38. 1 1
      src/nodes/lighting/PointShadowNode.js
  39. 1 1
      src/nodes/lighting/ShadowNode.js
  40. 11 0
      src/nodes/math/ConditionalNode.js
  41. 194 0
      src/nodes/math/OperatorNode.js
  42. 1 1
      src/nodes/pmrem/PMREMNode.js
  43. 1 1
      src/nodes/utils/ArrayElementNode.js
  44. 9 0
      src/nodes/utils/CubeMapNode.js
  45. 10 1
      src/nodes/utils/EquirectUVNode.js
  46. 9 0
      src/nodes/utils/FunctionOverloadingNode.js
  47. 23 0
      src/nodes/utils/LoopNode.js
  48. 8 0
      src/nodes/utils/MatcapUVNode.js
  49. 10 1
      src/nodes/utils/MaxMipLevelNode.js
  50. 23 1
      src/nodes/utils/RTTNode.js
  51. 17 1
      src/nodes/utils/ReflectorNode.js
  52. 25 0
      src/nodes/utils/RemapNode.js
  53. 11 0
      src/nodes/utils/RotateNode.js
  54. 11 0
      src/nodes/utils/SpriteSheetUVNode.js
  55. 10 0
      src/nodes/utils/StorageArrayElementNode.js
  56. 27 0
      src/nodes/utils/TriplanarTexturesNode.js

+ 63 - 0
src/nodes/accessors/BufferNode.js

@@ -1,6 +1,22 @@
 import UniformNode from '../core/UniformNode.js';
 import { nodeObject } from '../tsl/TSLBase.js';
 
+/** @module BufferNode **/
+
+/**
+ * A special type of uniform node which represents array-like data
+ * as uniform buffers. The access usually happens via `element()`
+ * which returns an instance of {@link ArrayElementNode}. For example:
+ *
+ * ```js
+ * const bufferNode = buffer( array, 'mat4', count );
+ * const matrixNode = bufferNode.element( index ); // access a matrix from the buffer
+ * ```
+ * In general, it is recommened to use the more managed {@link UniformArrayNode}
+ * since it handles more input types and automatically cares about buffer paddings.
+ *
+ * @augments module:UniformNode~UniformNode
+ */
 class BufferNode extends UniformNode {
 
 	static get type() {
@@ -9,23 +25,61 @@ class BufferNode extends UniformNode {
 
 	}
 
+	/**
+	 * Constructs a new buffer node.
+	 *
+	 * @param {Array<Number>} value - Array-like buffer data.
+	 * @param {String} bufferType - The data type of the buffer.
+	 * @param {Number} [bufferCount=0] - The count of buffer elements.
+	 */
 	constructor( value, bufferType, bufferCount = 0 ) {
 
 		super( value, bufferType );
 
+		/**
+		 * This flag can be used for type testing.
+		 *
+		 * @type {Boolean}
+		 * @readonly
+		 * @default true
+		 */
 		this.isBufferNode = true;
 
+		/**
+		 * The data type of the buffer.
+		 *
+		 * @type {String}
+		 */
 		this.bufferType = bufferType;
+
+		/**
+		 * The uniform node that holds the value of the reference node.
+		 *
+		 * @type {Number}
+		 * @default 0
+		 */
 		this.bufferCount = bufferCount;
 
 	}
 
+	/**
+	 * The data type of the buffer elements.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @return {String} The element type.
+	 */
 	getElementType( builder ) {
 
 		return this.getNodeType( builder );
 
 	}
 
+	/**
+	 * Overwrites the default implementation to return a fixed value `'buffer'`.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @return {String} The input type.
+	 */
 	getInputType( /*builder*/ ) {
 
 		return 'buffer';
@@ -36,4 +90,13 @@ class BufferNode extends UniformNode {
 
 export default BufferNode;
 
+/**
+ * TSL function for creating a buffer node.
+ *
+ * @function
+ * @param {Array} value - Array-like buffer data.
+ * @param {String} type - The data type of a buffer element.
+ * @param {Number} count - The count of buffer elements.
+ * @returns {BufferNode}
+ */
 export const buffer = ( value, type, count ) => nodeObject( new BufferNode( value, type, count ) );

+ 58 - 1
src/nodes/accessors/Normal.js

@@ -5,8 +5,20 @@ import { mat3, vec3, Fn, varying } from '../tsl/TSLBase.js';
 import { positionView } from './Position.js';
 import { faceDirection } from '../display/FrontFacingNode.js';
 
+/** @module Normal **/
+
+/**
+ * TSL object that represents the normal attribute of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const normalGeometry = /*@__PURE__*/ attribute( 'normal', 'vec3' );
 
+/**
+ * TSL object that represents the vertex normal in local space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const normalLocal = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 	if ( builder.geometry.hasAttribute( 'normal' ) === false ) {
@@ -21,8 +33,18 @@ export const normalLocal = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 }, 'vec3' ).once() )().toVar( 'normalLocal' );
 
+/**
+ * TSL object that represents the flat vertex normal in view space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const normalFlat = /*@__PURE__*/ positionView.dFdx().cross( positionView.dFdy() ).normalize().toVar( 'normalFlat' );
 
+/**
+ * TSL object that represents the vertex normal in view space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 	let node;
@@ -41,23 +63,50 @@ export const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 }, 'vec3' ).once() )().toVar( 'normalView' );
 
+/**
+ * TSL object that represents the vertex normal in world space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const normalWorld = /*@__PURE__*/ varying( normalView.transformDirection( cameraViewMatrix ), 'v_normalWorld' ).normalize().toVar( 'normalWorld' );
 
+/**
+ * TSL object that represents the transformed vertex normal in view space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const transformedNormalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 	return builder.context.setupNormal();
 
 }, 'vec3' ).once() )().mul( faceDirection ).toVar( 'transformedNormalView' );
 
-
+/**
+ * TSL object that represents the transformed vertex normal in world space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const transformedNormalWorld = /*@__PURE__*/ transformedNormalView.transformDirection( cameraViewMatrix ).toVar( 'transformedNormalWorld' );
 
+/**
+ * TSL object that represents the transformed clearcoat vertex normal in view space of the current rendered object.
+ *
+ * @type {Node<vec3>}
+ */
 export const transformedClearcoatNormalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 	return builder.context.setupClearcoatNormal();
 
 }, 'vec3' ).once() )().mul( faceDirection ).toVar( 'transformedClearcoatNormalView' );
 
+/**
+ * Transforms the normal with the given matrix.
+ *
+ * @function
+ * @param {Node<vec3>} normal - The normal.
+ * @param {Node<mat3>} [matrix=modelWorldMatrix] - The matrix.
+ * @return {Node<vec3>} The transformed normal.
+ */
 export const transformNormal = /*@__PURE__*/ Fn( ( [ normal, matrix = modelWorldMatrix ] ) => {
 
 	const m = mat3( matrix );
@@ -68,6 +117,14 @@ export const transformNormal = /*@__PURE__*/ Fn( ( [ normal, matrix = modelWorld
 
 } );
 
+/**
+ * Transforms the given normal from local to view space.
+ *
+ * @function
+ * @param {Node<vec3>} normal - The normal.
+ * @param {NodeBuilder} builder - The current node builder.
+ * @return {Node<vec3>} The transformed normal.
+ */
 export const transformNormalToView = /*@__PURE__*/ Fn( ( [ normal ], builder ) => {
 
 	const modelNormalViewMatrix = builder.renderer.nodes.modelNormalViewMatrix;

+ 1 - 1
src/nodes/accessors/Position.js

@@ -19,7 +19,7 @@ export const positionLocal = /*@__PURE__*/ positionGeometry.varying( 'positionLo
 
 /**
  * TSL object that represents the previous vertex position in local space of the current rendered object.
- * Used in context of {@link VelocityNode} for rendering motion vectors.
+ * Used in context of {@link module:VelocityNode~VelocityNode} for rendering motion vectors.
  *
  * @type {AttributeNode<vec3>}
  */

+ 6 - 6
src/nodes/accessors/ReferenceNode.js

@@ -36,7 +36,7 @@ class ReferenceElementNode extends ArrayElementNode {
 		super( referenceNode, indexNode );
 
 		/**
-		 * Similar to {@link ReferenceNode#reference}, an additional
+		 * Similar to {@link module:ReferenceNode~ReferenceNode#reference}, an additional
 		 * property references to the current node.
 		 *
 		 * @type {Node}
@@ -83,7 +83,7 @@ class ReferenceElementNode extends ArrayElementNode {
 /**
  * This type of node establishes a reference to a property of another object.
  * In this way, the value of the node is automatically linked to the value of
- * referenced object. Reference nodes internally represents the linked value
+ * referenced object. Reference nodes internally represent the linked value
  * as a uniform.
  *
  * @augments Node
@@ -147,7 +147,7 @@ class ReferenceNode extends Node {
 		this.properties = property.split( '.' );
 
 		/**
-		 * Points to the current referred object. This property exists next to {@link ReferenceNode#object}
+		 * Points to the current referred object. This property exists next to {@link module:ReferenceNode~ReferenceNode#object}
 		 * since the final reference might be updated from calling code.
 		 *
 		 * @type {Object?}
@@ -318,7 +318,7 @@ class ReferenceNode extends Node {
 
 	/**
 	 * Allows to update the reference based on the given state. The state is only
-	 * evaluated {@link ReferenceNode#object} is not set.
+	 * evaluated {@link module:ReferenceNode~ReferenceNode#object} is not set.
 	 *
 	 * @param {(NodeFrame|NodeBuilder)} state - The current state.
 	 * @return {Object} The updated reference.
@@ -383,7 +383,7 @@ class ReferenceNode extends Node {
 export default ReferenceNode;
 
 /**
- * TSL function for creating a reference node with the given parameters.
+ * TSL function for creating a reference node.
  *
  * @function
  * @param {String} name - The name of the property the node refers to.
@@ -394,7 +394,7 @@ export default ReferenceNode;
 export const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );
 
 /**
- * TSL function for creating a reference node with the given parameters.
+ * TSL function for creating a reference node.
  *
  * @function
  * @param {String} name - The name of the property the node refers to.

+ 36 - 0
src/nodes/accessors/Tangent.js

@@ -3,6 +3,13 @@ import { cameraViewMatrix } from './Camera.js';
 import { modelViewMatrix } from './ModelNode.js';
 import { Fn, vec4 } from '../tsl/TSLBase.js';
 
+/** @module Tangent **/
+
+/**
+ * TSL object that represents the tangent attribute of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const tangentGeometry = /*@__PURE__*/ Fn( ( builder ) => {
 
 	if ( builder.geometry.hasAttribute( 'tangent' ) === false ) {
@@ -15,8 +22,37 @@ export const tangentGeometry = /*@__PURE__*/ Fn( ( builder ) => {
 
 } )();
 
+/**
+ * TSL object that represents the vertex tangent in local space of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const tangentLocal = /*@__PURE__*/ tangentGeometry.xyz.toVar( 'tangentLocal' );
+
+/**
+ * TSL object that represents the vertex tangent in view space of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const tangentView = /*@__PURE__*/ modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.varying( 'v_tangentView' ).normalize().toVar( 'tangentView' );
+
+/**
+ * TSL object that represents the vertex tangent in world space of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMatrix ).varying( 'v_tangentWorld' ).normalize().toVar( 'tangentWorld' );
+
+/**
+ * TSL object that represents the transformed vertex tangent in view space of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const transformedTangentView = /*@__PURE__*/ tangentView.toVar( 'transformedTangentView' );
+
+/**
+ * TSL object that represents the transformed vertex tangent in world space of the current rendered object.
+ *
+ * @type {Node<vec4>}
+ */
 export const transformedTangentWorld = /*@__PURE__*/ transformedTangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedTangentWorld' );

+ 1 - 1
src/nodes/accessors/TextureSizeNode.js

@@ -68,7 +68,7 @@ class TextureSizeNode extends Node {
 export default TextureSizeNode;
 
 /**
- * TSL function for creating a texture size node with the given parameters.
+ * TSL function for creating a texture size node.
  *
  * @function
  * @param {TextureNode} textureNode - A texture node which size should be retrieved.

+ 126 - 5
src/nodes/accessors/UniformArrayNode.js

@@ -4,6 +4,13 @@ import { getValueType } from '../core/NodeUtils.js';
 import ArrayElementNode from '../utils/ArrayElementNode.js';
 import BufferNode from './BufferNode.js';
 
+/** @module UniformArrayNode **/
+
+/**
+ * Represents the element access on uniform array nodes.
+ *
+ * @augments ArrayElementNode
+ */
 class UniformArrayElementNode extends ArrayElementNode {
 
 	static get type() {
@@ -12,10 +19,23 @@ class UniformArrayElementNode extends ArrayElementNode {
 
 	}
 
-	constructor( arrayBuffer, indexNode ) {
-
-		super( arrayBuffer, indexNode );
-
+	/**
+	 * Constructs a new buffer node.
+	 *
+	 * @param {UniformArrayNode} uniformArrayNode - The uniform array node to access.
+	 * @param {IndexNode} indexNode - The index data that define the position of the accessed element in the array.
+	 */
+	constructor( uniformArrayNode, indexNode ) {
+
+		super( uniformArrayNode, indexNode );
+
+		/**
+		 * This flag can be used for type testing.
+		 *
+		 * @type {Boolean}
+		 * @readonly
+		 * @default true
+		 */
 		this.isArrayBufferElementNode = true;
 
 	}
@@ -32,6 +52,23 @@ class UniformArrayElementNode extends ArrayElementNode {
 
 }
 
+/**
+ * Similar to {@link module:BufferNode~BufferNode} this module represents array-like data as
+ * uniform buffers. Unlike {@link module:BufferNode~BufferNode}, it can handle more common
+ * data types in the array (e.g `three.js` primitives) and automatically
+ * manage buffer padding. It should be the first choice when working with
+ * uniforms buffers.
+ * ```js
+ * const tintColors = uniformArray( [
+ * 	new Color( 1, 0, 0 ),
+ * 	new Color( 0, 1, 0 ),
+ * 	new Color( 0, 0, 1 )
+ * ], 'color' );
+ *
+ * const redColor = tintColors.element( 0 );
+ *
+ * @augments module:BufferNode~BufferNode
+ */
 class UniformArrayNode extends BufferNode {
 
 	static get type() {
@@ -40,32 +77,89 @@ class UniformArrayNode extends BufferNode {
 
 	}
 
+	/**
+	 * Constructs a new uniform array node.
+	 *
+	 * @param {Array<Any>} value - Array holding the buffer data.
+	 * @param {String?} [elementType=null] - The data type of a buffer element.
+	 */
 	constructor( value, elementType = null ) {
 
 		super( null );
 
+		/**
+		 * Array holding the buffer data. Unlike {@link module:BufferNode~BufferNode}, the array can
+		 * hold number primitives as well as three.js objects like vectors, matrices
+		 * or colors.
+		 *
+		 * @type {Array<Any>}
+		 */
 		this.array = value;
+
+		/**
+		 * The data type of an array element.
+		 *
+		 * @type {String}
+		 */
 		this.elementType = elementType === null ? getValueType( value[ 0 ] ) : elementType;
+
+		/**
+		 * The padded type. Uniform buffers must conform to a certain buffer layout
+		 * so a separate type is computed to ensure correct buffer size.
+		 *
+		 * @type {String}
+		 */
 		this.paddedType = this.getPaddedType();
 
+		/**
+		 * Overwritten since uniform array nodes are updated per render.
+		 *
+		 * @type {String}
+		 * @default 'render'
+		 */
 		this.updateType = NodeUpdateType.RENDER;
 
+		/**
+		 * This flag can be used for type testing.
+		 *
+		 * @type {Boolean}
+		 * @readonly
+		 * @default true
+		 */
 		this.isArrayBufferNode = true;
 
 	}
 
-	getNodeType() {
+	/**
+	 * This method is overwritten since the node type is inferred from the
+	 * {@link module:UniformArrayNode~UniformArrayNode#paddedType}.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @return {String} The node type.
+	 */
+	getNodeType( /*builder*/ ) {
 
 		return this.paddedType;
 
 	}
 
+	/**
+	 * The data type of the array elements.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @return {String} The element type.
+	 */
 	getElementType() {
 
 		return this.elementType;
 
 	}
 
+	/**
+	 * Returns the padded type based on the element type.
+	 *
+	 * @return {String} The padded type.
+	 */
 	getPaddedType() {
 
 		const elementType = this.elementType;
@@ -94,6 +188,12 @@ class UniformArrayNode extends BufferNode {
 
 	}
 
+	/**
+	 * The update makes sure to correctly transfer the data from the (complex) objects
+	 * in the array to the internal, correctly padded value buffer.
+	 *
+	 * @param {NodeFrame} frame - A reference to the current node frame.
+	 */
 	update( /*frame*/ ) {
 
 		const { array, value } = this;
@@ -194,6 +294,12 @@ class UniformArrayNode extends BufferNode {
 
 	}
 
+	/**
+	 * Implement the value buffer creation based on the array data.
+	 *
+	 * @param {NodeBuilder} builder - A reference to the current node builder.
+	 * @return {null}
+	 */
 	setup( builder ) {
 
 		const length = this.array.length;
@@ -215,6 +321,13 @@ class UniformArrayNode extends BufferNode {
 
 	}
 
+	/**
+	 * Overwrites the default `element()` method to provide element access
+	 * based on {@link module:UniformArrayNode~UniformArrayNode}.
+	 *
+	 * @param {IndexNode} indexNode - The index node.
+	 * @return {UniformArrayElementNode}
+	 */
 	element( indexNode ) {
 
 		return nodeObject( new UniformArrayElementNode( this, nodeObject( indexNode ) ) );
@@ -225,6 +338,14 @@ class UniformArrayNode extends BufferNode {
 
 export default UniformArrayNode;
 
+/**
+ * TSL function for creating an uniform array node.
+ *
+ * @function
+ * @param {Array<Any>} values - Array-like data.
+ * @param {String} nodeType - The data type of the array elements.
+ * @returns {UniformArrayNode}
+ */
 export const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) );
 
 //

+ 4 - 4
src/nodes/accessors/UserDataNode.js

@@ -12,10 +12,10 @@ import { nodeObject } from '../tsl/TSLBase.js';
  * const material = new THREE.SpriteNodeMaterial();
  * material.rotationNode = userData( 'rotation', 'float' );
  * ```
- * Since `UserDataNode` is extended from {@link ReferenceNode}, the node value
+ * Since `UserDataNode` is extended from {@link module:ReferenceNode~ReferenceNode}, the node value
  * will automatically be updated when the `rotation` user data field changes.
  *
- * @augments ReferenceNode
+ * @augments module:ReferenceNode~ReferenceNode
  */
 class UserDataNode extends ReferenceNode {
 
@@ -48,7 +48,7 @@ class UserDataNode extends ReferenceNode {
 	}
 
 	/**
-	 * Overwritten to make sure {@link ReferenceNode#reference} points to the correct
+	 * Overwritten to make sure {@link module:ReferenceNode~ReferenceNode#reference} points to the correct
 	 * `userData` field.
 	 *
 	 * @param {(NodeFrame|NodeBuilder)} state - The current state to evaluate.
@@ -67,7 +67,7 @@ class UserDataNode extends ReferenceNode {
 export default UserDataNode;
 
 /**
- * TSL function for creating a user data node with the given parameters.
+ * TSL function for creating a user data node.
  *
  * @function
  * @param {String} name - The property name that should be referenced by the node.

+ 2 - 2
src/nodes/accessors/VertexColorNode.js

@@ -7,7 +7,7 @@ import { Vector4 } from '../../math/Vector4.js';
 /**
  * An attribute node for representing vertex colors.
  *
- * @augments AttributeNode
+ * @augments module:AttributeNode~AttributeNode
  */
 class VertexColorNode extends AttributeNode {
 
@@ -102,7 +102,7 @@ class VertexColorNode extends AttributeNode {
 export default VertexColorNode;
 
 /**
- * TSL function for creating a reference node with the given parameters.
+ * TSL function for creating a reference node.
  *
  * @function
  * @param {Number} index - The attribute index.

+ 4 - 4
src/nodes/code/CodeNode.js

@@ -141,7 +141,7 @@ class CodeNode extends Node {
 export default CodeNode;
 
 /**
- * TSL function for creating a code node with the given parameters.
+ * TSL function for creating a code node.
  *
  * @function
  * @param {String} [code=''] - The native code.
@@ -152,7 +152,7 @@ export default CodeNode;
 export const code = /*@__PURE__*/ nodeProxy( CodeNode );
 
 /**
- * TSL function for creating a JS code node with the given parameters.
+ * TSL function for creating a JS code node.
  *
  * @function
  * @param {String} src - The native code.
@@ -162,7 +162,7 @@ export const code = /*@__PURE__*/ nodeProxy( CodeNode );
 export const js = ( src, includes ) => code( src, includes, 'js' );
 
 /**
- * TSL function for creating a WGSL code node with the given parameters.
+ * TSL function for creating a WGSL code node.
  *
  * @function
  * @param {String} src - The native code.
@@ -172,7 +172,7 @@ export const js = ( src, includes ) => code( src, includes, 'js' );
 export const wgsl = ( src, includes ) => code( src, includes, 'wgsl' );
 
 /**
- * TSL function for creating a GLSL code node with the given parameters.
+ * TSL function for creating a GLSL code node.
  *
  * @function
  * @param {String} src - The native code.

+ 1 - 1
src/nodes/code/ExpressionNode.js

@@ -59,7 +59,7 @@ class ExpressionNode extends Node {
 export default ExpressionNode;
 
 /**
- * TSL function for creating an expression node with the given parameters.
+ * TSL function for creating an expression node.
  *
  * @function
  * @param {String} [snippet=''] - The native code snippet.

+ 1 - 1
src/nodes/core/AssignNode.js

@@ -165,7 +165,7 @@ class AssignNode extends TempNode {
 export default AssignNode;
 
 /**
- * TSL function for creating an assign node with the given parameters.
+ * TSL function for creating an assign node.
  *
  * @function
  * @param {Node} targetNode - The target node.

+ 1 - 1
src/nodes/core/AttributeNode.js

@@ -158,7 +158,7 @@ class AttributeNode extends Node {
 export default AttributeNode;
 
 /**
- * TSL function for creating an attribute node with the given parameters.
+ * TSL function for creating an attribute node.
  *
  * @function
  * @param {String} name - The name of the attribute.

+ 1 - 1
src/nodes/core/BypassNode.js

@@ -82,7 +82,7 @@ class BypassNode extends Node {
 export default BypassNode;
 
 /**
- * TSL function for creating a bypass node with the given parameters.
+ * TSL function for creating a bypass node.
  *
  * @function
  * @param {Node} outputNode - The output node.

+ 1 - 1
src/nodes/core/CacheNode.js

@@ -80,7 +80,7 @@ class CacheNode extends Node {
 export default CacheNode;
 
 /**
- * TSL function for creating a cache node with the given parameters.
+ * TSL function for creating a cache node.
  *
  * @function
  * @param {Node} node - The node that should be cached.

+ 5 - 5
src/nodes/core/ContextNode.js

@@ -58,9 +58,9 @@ class ContextNode extends Node {
 	}
 
 	/**
-	 * This method is overwritten to ensure it returns the reference to {@link ContextNode#node}.
+	 * This method is overwritten to ensure it returns the reference to {@link module:ContextNode~ContextNode#node}.
 	 *
-	 * @return {Node} A reference to {@link ContextNode#node}.
+	 * @return {Node} A reference to {@link module:ContextNode~ContextNode#node}.
 	 */
 	getScope() {
 
@@ -69,10 +69,10 @@ class ContextNode extends Node {
 	}
 
 	/**
-	 * This method is overwritten to ensure it returns the type to {@link ContextNode#node}.
+	 * This method is overwritten to ensure it returns the type of {@link module:ContextNode~ContextNode#node}.
 	 *
 	 * @param {NodeBuilder} builder - The current node builder.
-	 * @return {String} The type of {@link ContextNode#node}.
+	 * @return {String} The node type.
 	 */
 	getNodeType( builder ) {
 
@@ -119,7 +119,7 @@ class ContextNode extends Node {
 export default ContextNode;
 
 /**
- * TSL function for creating a context node with the given parameters.
+ * TSL function for creating a context node.
  *
  * @function
  * @param {Node} node - The node whose context should be modified.

+ 1 - 1
src/nodes/core/MRTNode.js

@@ -142,7 +142,7 @@ class MRTNode extends OutputStructNode {
 export default MRTNode;
 
 /**
- * TSL function for creating a MRT node with the given parameters.
+ * TSL function for creating a MRT node.
  *
  * @function
  * @param {Object<String, Node>} outputNodes - The MRT outputs.

+ 1 - 1
src/nodes/core/OutputStructNode.js

@@ -85,7 +85,7 @@ class OutputStructNode extends Node {
 export default OutputStructNode;
 
 /**
- * TSL function for creating an output struct node with the given parameters.
+ * TSL function for creating an output struct node.
  *
  * @function
  * @param {...Node} members - A parameter list of nodes.

+ 1 - 1
src/nodes/core/ParameterNode.js

@@ -54,7 +54,7 @@ class ParameterNode extends PropertyNode {
 export default ParameterNode;
 
 /**
- * TSL function for creating a parameter node with the given parameters.
+ * TSL function for creating a parameter node.
  *
  * @function
  * @param {String} type - The type of the node.

+ 1 - 1
src/nodes/core/StackNode.js

@@ -178,7 +178,7 @@ class StackNode extends Node {
 export default StackNode;
 
 /**
- * TSL function for creating a stack node with the given parameters.
+ * TSL function for creating a stack node.
  *
  * @function
  * @param {StackNode?} [parent=null] - The parent stack node.

+ 1 - 1
src/nodes/core/UniformNode.js

@@ -159,7 +159,7 @@ class UniformNode extends InputNode {
 export default UniformNode;
 
 /**
- * TSL function for creating a uniform node with the given parameters.
+ * TSL function for creating a uniform node.
  *
  * @function
  * @param {Any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).

+ 1 - 1
src/nodes/core/VarNode.js

@@ -99,7 +99,7 @@ class VarNode extends Node {
 export default VarNode;
 
 /**
- * TSL function for creating a var node with the given parameters.
+ * TSL function for creating a var node.
  *
  * @function
  * @param {Node} node - The node for which a variable should be created.

+ 1 - 1
src/nodes/core/VaryingNode.js

@@ -167,7 +167,7 @@ class VaryingNode extends Node {
 export default VaryingNode;
 
 /**
- * TSL function for creating a varying node with the given parameters.
+ * TSL function for creating a varying node.
  *
  * @function
  * @param {Node} node - The node for which a varying should be created.

+ 10 - 0
src/nodes/display/BumpMapNode.js

@@ -5,6 +5,8 @@ import { positionView } from '../accessors/Position.js';
 import { faceDirection } from './FrontFacingNode.js';
 import { Fn, nodeProxy, float, vec2 } from '../tsl/TSLBase.js';
 
+/** @module BumpMapNode **/
+
 // Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen
 // https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf
 
@@ -105,4 +107,12 @@ class BumpMapNode extends TempNode {
 
 export default BumpMapNode;
 
+/**
+ * TSL function for creating a bump map node.
+ *
+ * @function
+ * @param {Node} textureNode - Represents the bump map data.
+ * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect.
+ * @returns {BumpMapNode}
+ */
 export const bumpMap = /*@__PURE__*/ nodeProxy( BumpMapNode );

+ 1 - 1
src/nodes/display/NormalMapNode.js

@@ -139,7 +139,7 @@ class NormalMapNode extends TempNode {
 export default NormalMapNode;
 
 /**
- * TSL function for creating a normal map node with the given parameters.
+ * TSL function for creating a normal map node.
  *
  * @function
  * @param {Node} node - Represents the normal map data.

+ 5 - 5
src/nodes/display/PassNode.js

@@ -17,7 +17,7 @@ const _size = /*@__PURE__*/ new Vector2();
 /**
  * Represents the texture of a pass node.
  *
- * @augments TextureNode
+ * @augments module:TextureNode~TextureNode
  */
 class PassTextureNode extends TextureNode {
 
@@ -68,7 +68,7 @@ class PassTextureNode extends TextureNode {
  * An extension of `PassTextureNode` which allows to manage more than one
  * internal texture. Relevant for the `getPreviousTexture()` related API.
  *
- * @augments PassTextureNode
+ * @augments module:PassTextureNode~PassTextureNode
  */
 class PassMultipleTextureNode extends PassTextureNode {
 
@@ -639,7 +639,7 @@ PassNode.DEPTH = 'depth';
 export default PassNode;
 
 /**
- * TSL function for creating a pass node with the given parameters.
+ * TSL function for creating a pass node.
  *
  * @function
  * @param {Scene} scene - A reference to the scene.
@@ -650,7 +650,7 @@ export default PassNode;
 export const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.COLOR, scene, camera, options ) );
 
 /**
- * TSL function for creating a pass texture node with the given parameters.
+ * TSL function for creating a pass texture node.
  *
  * @function
  * @param {PassNode} pass - The pass node.
@@ -660,7 +660,7 @@ export const pass = ( scene, camera, options ) => nodeObject( new PassNode( Pass
 export const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass, texture ) );
 
 /**
- * TSL function for creating a depth pass node with the given parameters.
+ * TSL function for creating a depth pass node.
  *
  * @function
  * @param {Scene} scene - A reference to the scene.

+ 1 - 1
src/nodes/display/PosterizeNode.js

@@ -56,7 +56,7 @@ class PosterizeNode extends TempNode {
 export default PosterizeNode;
 
 /**
- * TSL function for creating a posterize node with the given parameters.
+ * TSL function for creating a posterize node.
  *
  * @function
  * @param {Node} sourceNode - The input color.

+ 1 - 1
src/nodes/display/RenderOutputNode.js

@@ -112,7 +112,7 @@ class RenderOutputNode extends TempNode {
 export default RenderOutputNode;
 
 /**
- * TSL function for creating a posterize node with the given parameters.
+ * TSL function for creating a posterize node.
  *
  * @function
  * @param {Node} color - The color node to process.

+ 44 - 2
src/nodes/display/ScreenNode.js

@@ -6,11 +6,13 @@ import { Fn, nodeImmutable, vec2 } from '../tsl/TSLBase.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { Vector4 } from '../../math/Vector4.js';
 
+/** @module ScreenNode **/
+
 let screenSizeVec, viewportVec;
 
 /**
  * This node provides a collection of screen related metrics.
- * Depending on {@link ScreenNode#scope}, the nodes can represent
+ * Depending on {@link module:ScreenNode~ScreenNode#scope}, the nodes can represent
  * resolution or viewport data as well as fragment or uv coordinates.
  *
  * @augments Node
@@ -38,7 +40,7 @@ class ScreenNode extends Node {
 		 * - `ScreenNode.COORDINATE`: Window-relative coordinates of the current fragment according to WebGPU standards.
 		 * - `ScreenNode.VIEWPORT`: The current viewport defined as a four-dimensional vector.
 		 * - `ScreenNode.SIZE`: The dimensions of the current bound framebuffer.
-		 * - `ScreenNode.UV`: Normalized screen coordinates.
+		 * - `ScreenNode.UV`: Normalized coordinates.
 		 *
 		 * @type {('coordinate'|'viewport'|'size'|'uv')}
 		 */
@@ -188,15 +190,55 @@ export default ScreenNode;
 
 // Screen
 
+/**
+ * TSL object that represents normalized screen coordinates, unitless in `[0, 1]`.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const screenUV = /*@__PURE__*/ nodeImmutable( ScreenNode, ScreenNode.UV );
+
+/**
+ * TSL object that represents the screen resolution in physical pixel units.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const screenSize = /*@__PURE__*/ nodeImmutable( ScreenNode, ScreenNode.SIZE );
+
+/**
+ * TSL object that represents the current `x`/`y` pixel position on the screen in physical pixel units.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const screenCoordinate = /*@__PURE__*/ nodeImmutable( ScreenNode, ScreenNode.COORDINATE );
 
 // Viewport
 
+/**
+ * TSL object that represents the viewport rectangle as `x`, `y`, `width` and `height` in physical pixel units.
+ *
+ * @type {ScreenNode<vec4>}
+ */
 export const viewport = /*@__PURE__*/ nodeImmutable( ScreenNode, ScreenNode.VIEWPORT );
+
+/**
+ * TSL object that represents the viewport resolution in physical pixel units.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const viewportSize = viewport.zw;
+
+/**
+ * TSL object that represents the current `x`/`y` pixel position on the viewport in physical pixel units.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const viewportCoordinate = /*@__PURE__*/ screenCoordinate.sub( viewport.xy );
+
+/**
+ * TSL object that represents normalized viewport coordinates, unitless in `[0, 1]`.
+ *
+ * @type {ScreenNode<vec2>}
+ */
 export const viewportUV = /*@__PURE__*/ viewportCoordinate.div( viewportSize );
 
 // Deprecated

+ 17 - 0
src/nodes/display/ToneMappingNode.js

@@ -5,6 +5,8 @@ import { rendererReference } from '../accessors/RendererReferenceNode.js';
 import { NoToneMapping } from '../../constants.js';
 import { hash } from '../core/NodeUtils.js';
 
+/** @module ToneMappingNode **/
+
 /**
  * This node represents a tone mapping operation.
  *
@@ -97,7 +99,22 @@ class ToneMappingNode extends TempNode {
 
 export default ToneMappingNode;
 
+/**
+ * TSL function for creating a tone mapping node.
+ *
+ * @function
+ * @param {Number} mapping - The tone mapping type.
+ * @param {Node<float> | Number} exposure - The tone mapping exposure.
+ * @param {Node<vec3> | Color} color - The color node to process.
+ * @returns {ToneMappingNode<vec3>}
+ */
 export const toneMapping = ( mapping, exposure, color ) => nodeObject( new ToneMappingNode( mapping, nodeObject( exposure ), nodeObject( color ) ) );
+
+/**
+ * TSL object that represents the global tone mapping exposure of the renderer.
+ *
+ * @type {RendererReferenceNode<vec3>}
+ */
 export const toneMappingExposure = /*@__PURE__*/ rendererReference( 'toneMappingExposure', 'float' );
 
 addMethodChaining( 'toneMapping', ( color, mapping, exposure ) => toneMapping( mapping, exposure, color ) );

+ 13 - 0
src/nodes/display/ToonOutlinePassNode.js

@@ -8,6 +8,8 @@ import { normalLocal } from '../../nodes/accessors/Normal.js';
 import { BackSide } from '../../constants.js';
 import PassNode from './PassNode.js';
 
+/** @module ToonOutlinePassNode **/
+
 /**
  * Represents a render pass for producing a toon outline effect on compatible objects.
  * Only 3D objects with materials of type `MeshToonMaterial` and `MeshToonNodeMaterial`
@@ -168,4 +170,15 @@ class ToonOutlinePassNode extends PassNode {
 
 export default ToonOutlinePassNode;
 
+/**
+ * TSL function for creating a toon outline pass node.
+ *
+ * @function
+ * @param {Scene} scene - A reference to the scene.
+ * @param {Camera} camera - A reference to the camera.
+ * @param {Color} color - Defines the outline's color.
+ * @param {Number} [thickness=0.003] - Defines the outline's thickness.
+ * @param {Number} [alpha=1] - Defines the outline's alpha.
+ * @returns {ToonOutlinePassNode}
+ */
 export const toonOutlinePass = ( scene, camera, color = new Color( 0, 0, 0 ), thickness = 0.003, alpha = 1 ) => nodeObject( new ToonOutlinePassNode( scene, camera, nodeObject( color ), nodeObject( thickness ), nodeObject( alpha ) ) );

+ 84 - 8
src/nodes/display/ViewportDepthNode.js

@@ -4,6 +4,8 @@ import { cameraNear, cameraFar } from '../accessors/Camera.js';
 import { positionView } from '../accessors/Position.js';
 import { viewportDepthTexture } from './ViewportDepthTextureNode.js';
 
+/** @module ViewportDepthNode **/
+
 /**
  * This node offers a collection of features in context of the depth logic in the fragment shader.
  * Depending on {@link ViewportDepthNode#scope}, it can be used to define a depth value for the current
@@ -140,21 +142,61 @@ export default ViewportDepthNode;
 
 // NOTE: viewZ, the z-coordinate in camera space, is negative for points in front of the camera
 
-// -near maps to 0; -far maps to 1
+/**
+ * TSL function for converting a viewZ value to an orthographic depth value.
+ *
+ * @function
+ * @param {Node<float>} viewZ - The viewZ node.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const viewZToOrthographicDepth = ( viewZ, near, far ) => viewZ.add( near ).div( near.sub( far ) );
 
-// maps orthographic depth in [ 0, 1 ] to viewZ
+/**
+ * TSL function for converting an orthographic depth value to a viewZ value.
+ *
+ * @function
+ * @param {Node<float>} depth - The orthographic depth.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const orthographicDepthToViewZ = ( depth, near, far ) => near.sub( far ).mul( depth ).sub( near );
 
-// NOTE: https://twitter.com/gonnavis/status/1377183786949959682
-
-// -near maps to 0; -far maps to 1
+/**
+ * TSL function for converting a viewZ value to a perspective depth value.
+ *
+ * Note: {link https://twitter.com/gonnavis/status/1377183786949959682}.
+ *
+ * @function
+ * @param {Node<float>} viewZ - The viewZ node.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const viewZToPerspectiveDepth = ( viewZ, near, far ) => near.add( viewZ ).mul( far ).div( far.sub( near ).mul( viewZ ) );
 
-// maps perspective depth in [ 0, 1 ] to viewZ
+/**
+ * TSL function for converting a perspective depth value to a viewZ value.
+ *
+ * @function
+ * @param {Node<float>} depth - The perspective depth.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const perspectiveDepthToViewZ = ( depth, near, far ) => near.mul( far ).div( far.sub( near ).mul( depth ).sub( far ) );
 
-// -near maps to 0; -far maps to 1
+/**
+ * TSL function for converting a viewZ value to a logarithmic depth value.
+ *
+ * @function
+ * @param {Node<float>} viewZ - The viewZ node.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const viewZToLogarithmicDepth = ( viewZ, near, far ) => {
 
 	// NOTE: viewZ must be negative--see explanation at the end of this comment block.
@@ -190,7 +232,15 @@ export const viewZToLogarithmicDepth = ( viewZ, near, far ) => {
 
 };
 
-// maps logarithmic depth in [ 0, 1 ] to viewZ
+/**
+ * TSL function for converting a logarithmic depth value to a viewZ value.
+ *
+ * @function
+ * @param {Node<float>} depth - The logarithmic depth.
+ * @param {Node<float>} near - The camera's near value.
+ * @param {Node<float>} far - The camera's far value.
+ * @returns {Node<float>}
+ */
 export const logarithmicDepthToViewZ = ( depth, near, far ) => {
 
 	// NOTE: we add a 'negate()' call to the return value here to maintain consistency with
@@ -201,10 +251,36 @@ export const logarithmicDepthToViewZ = ( depth, near, far ) => {
 
 };
 
+/**
+ * TSL function for defining a value for the current fragment's depth.
+ *
+ * @function
+ * @param {Node<float>} value - The depth value to set.
+ * @returns {ViewportDepthNode<float>}
+ */
 const depthBase = /*@__PURE__*/ nodeProxy( ViewportDepthNode, ViewportDepthNode.DEPTH_BASE );
 
+/**
+ * TSL object that represents the depth value for the current fragment.
+ *
+ * @type {ViewportDepthNode}
+ */
 export const depth = /*@__PURE__*/ nodeImmutable( ViewportDepthNode, ViewportDepthNode.DEPTH );
+
+/**
+ * TSL function for converting a perspective depth value to linear depth.
+ *
+ * @function
+ * @param {Node<float>} value - The perspective depth.
+ * @returns {ViewportDepthNode<float>}
+ */
 export const linearDepth = /*@__PURE__*/ nodeProxy( ViewportDepthNode, ViewportDepthNode.LINEAR_DEPTH );
+
+/**
+ * TSL object that represents the linear (orthographic) depth value of the current fragment
+ *
+ * @type {ViewportDepthNode}
+ */
 export const viewportLinearDepth = /*@__PURE__*/ linearDepth( viewportDepthTexture() );
 
 depth.assign = ( value ) => depthBase( value );

+ 12 - 2
src/nodes/display/ViewportDepthTextureNode.js

@@ -4,6 +4,8 @@ import { screenUV } from './ScreenNode.js';
 
 import { DepthTexture } from '../../textures/DepthTexture.js';
 
+/** @module ViewportDepthTextureNode **/
+
 let sharedDepthbuffer = null;
 
 /**
@@ -11,7 +13,7 @@ let sharedDepthbuffer = null;
  * can be used in combination with viewport texture to achieve effects
  * that require depth evaluation.
  *
- * @augments ViewportTextureNode
+ * @augments module:ViewportTextureNode~ViewportTextureNode
  */
 class ViewportDepthTextureNode extends ViewportTextureNode {
 
@@ -22,7 +24,7 @@ class ViewportDepthTextureNode extends ViewportTextureNode {
 	}
 
 	/**
-	 * Constructs a new viewport shared texture node.
+	 * Constructs a new viewport depth texture node.
 	 *
 	 * @param {Node} [uvNode=screenUV] - The uv node.
 	 * @param {Node?} [levelNode=null] - The level node.
@@ -43,4 +45,12 @@ class ViewportDepthTextureNode extends ViewportTextureNode {
 
 export default ViewportDepthTextureNode;
 
+/**
+ * TSL function for a viewport depth texture node.
+ *
+ * @function
+ * @param {Node} [uvNode=screenUV] - The uv node.
+ * @param {Node?} [levelNode=null] - The level node.
+ * @returns {ViewportDepthTextureNode}
+ */
 export const viewportDepthTexture = /*@__PURE__*/ nodeProxy( ViewportDepthTextureNode );

+ 11 - 1
src/nodes/display/ViewportSharedTextureNode.js

@@ -4,6 +4,8 @@ import { screenUV } from './ScreenNode.js';
 
 import { FramebufferTexture } from '../../textures/FramebufferTexture.js';
 
+/** @module ViewportSharedTextureNode **/
+
 let _sharedFramebuffer = null;
 
 /**
@@ -11,7 +13,7 @@ let _sharedFramebuffer = null;
  * shares a texture across all instances of `ViewportSharedTextureNode`. It should
  * be the first choice when using data of the default/screen framebuffer for performance reasons.
  *
- * @augments ViewportTextureNode
+ * @augments module:ViewportTextureNode~ViewportTextureNode
  */
 class ViewportSharedTextureNode extends ViewportTextureNode {
 
@@ -49,4 +51,12 @@ class ViewportSharedTextureNode extends ViewportTextureNode {
 
 export default ViewportSharedTextureNode;
 
+/**
+ * TSL function for creating a shared viewport texture node.
+ *
+ * @function
+ * @param {Node} [uvNode=screenUV] - The uv node.
+ * @param {Node?} [levelNode=null] - The level node.
+ * @returns {ViewportSharedTextureNode}
+ */
 export const viewportSharedTexture = /*@__PURE__*/ nodeProxy( ViewportSharedTextureNode );

+ 22 - 1
src/nodes/display/ViewportTextureNode.js

@@ -7,6 +7,8 @@ import { Vector2 } from '../../math/Vector2.js';
 import { FramebufferTexture } from '../../textures/FramebufferTexture.js';
 import { LinearMipmapLinearFilter } from '../../constants.js';
 
+/** @module ViewportTextureNode **/
+
 const _size = /*@__PURE__*/ new Vector2();
 
 /**
@@ -16,7 +18,7 @@ const _size = /*@__PURE__*/ new Vector2();
  * (which is good for performance). `ViewportTextureNode` can be used as an input for a
  * variety of effects like refractive or transmissive materials.
  *
- * @augments TextureNode
+ * @augments module:TextureNode~TextureNode
  */
 class ViewportTextureNode extends TextureNode {
 
@@ -113,5 +115,24 @@ class ViewportTextureNode extends TextureNode {
 
 export default ViewportTextureNode;
 
+/**
+ * TSL function for creating a viewport texture node.
+ *
+ * @function
+ * @param {Node} [uvNode=screenUV] - The uv node.
+ * @param {Node?} [levelNode=null] - The level node.
+ * @param {Texture?} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically.
+ * @returns {ViewportTextureNode}
+ */
 export const viewportTexture = /*@__PURE__*/ nodeProxy( ViewportTextureNode );
+
+/**
+ * TSL function for creating a viewport texture node with enabled mipmap generation.
+ *
+ * @function
+ * @param {Node} [uvNode=screenUV] - The uv node.
+ * @param {Node?} [levelNode=null] - The level node.
+ * @param {Texture?} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically.
+ * @returns {ViewportTextureNode}
+ */
 export const viewportMipTexture = /*@__PURE__*/ nodeProxy( ViewportTextureNode, null, null, { generateMipmaps: true } );

+ 1 - 1
src/nodes/geometry/RangeNode.js

@@ -163,7 +163,7 @@ class RangeNode extends Node {
 export default RangeNode;
 
 /**
- * TSL function for creating a range node with the given parameters.
+ * TSL function for creating a range node.
  *
  * @function
  * @param {Node<any>} [minNode=float()] - A node defining the lower bound of the range.

+ 1 - 1
src/nodes/lighting/LightingContextNode.js

@@ -2,7 +2,7 @@ import ContextNode from '../core/ContextNode.js';
 import { nodeProxy, float, vec3 } from '../tsl/TSLBase.js';
 
 /**
- * `LightingContextNode` represents an extension of the {@link ContextNode} module
+ * `LightingContextNode` represents an extension of the {@link module:ContextNode~ContextNode} module
  * by adding lighting specific context data. It represents the runtime context of
  * {@link LightsNode}.
  *

+ 1 - 1
src/nodes/lighting/PointShadowNode.js

@@ -163,7 +163,7 @@ const _shadowMapSize = /*@__PURE__*/ new Vector2();
 /**
  * Represents the shadow implementation for point light nodes.
  *
- * @augments ShadowNode
+ * @augments module:ShadowNode~ShadowNode
  */
 class PointShadowNode extends ShadowNode {
 

+ 1 - 1
src/nodes/lighting/ShadowNode.js

@@ -310,7 +310,7 @@ const _quadMesh = /*@__PURE__*/ new QuadMesh();
 /**
  * Represents the default shadow implementation for lighting nodes.
  *
- * @augments ShadowBaseNode
+ * @augments module:ShadowBaseNode~ShadowBaseNode
  */
 class ShadowNode extends ShadowBaseNode {
 

+ 11 - 0
src/nodes/math/ConditionalNode.js

@@ -2,6 +2,8 @@ import Node from '../core/Node.js';
 import { property } from '../core/PropertyNode.js';
 import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
 
+/** @module ConditionalNode **/
+
 /**
  * Represents a logical `if/else` statement. Can be used as an alternative
  * to the `If()`/`Else()` syntax.
@@ -183,6 +185,15 @@ class ConditionalNode extends Node {
 
 export default ConditionalNode;
 
+/**
+ * TSL function for creating a conditional node.
+ *
+ * @function
+ * @param {Node} condNode - The node that defines the condition.
+ * @param {Node} ifNode - The node that is evaluate when the condition ends up `true`.
+ * @param {Node?} [elseNode=null] - The node that is evaluate when the condition ends up `false`.
+ * @returns {ConditionalNode}
+ */
 export const select = /*@__PURE__*/ nodeProxy( ConditionalNode );
 
 addMethodChaining( 'select', select );

+ 194 - 0
src/nodes/math/OperatorNode.js

@@ -1,6 +1,8 @@
 import TempNode from '../core/TempNode.js';
 import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
 
+/** @module OperatorNode **/
+
 /**
  * This node represents basic mathematical and logical operations like addition,
  * subtraction or comparisons (e.g. `equal()`).
@@ -303,26 +305,218 @@ class OperatorNode extends TempNode {
 
 export default OperatorNode;
 
+/**
+ * Returns the addition of two or more value.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @param {...Node} params - Additional input parameters.
+ * @returns {OperatorNode}
+ */
 export const add = /*@__PURE__*/ nodeProxy( OperatorNode, '+' );
+
+/**
+ * Returns the subraction of two or more value.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @param {...Node} params - Additional input parameters.
+ * @returns {OperatorNode}
+ */
 export const sub = /*@__PURE__*/ nodeProxy( OperatorNode, '-' );
+
+/**
+ * Returns the multiplication of two or more value.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @param {...Node} params - Additional input parameters.
+ * @returns {OperatorNode}
+ */
 export const mul = /*@__PURE__*/ nodeProxy( OperatorNode, '*' );
+
+/**
+ * Returns the division of two or more value.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @param {...Node} params - Additional input parameters.
+ * @returns {OperatorNode}
+ */
 export const div = /*@__PURE__*/ nodeProxy( OperatorNode, '/' );
+
+/**
+ * Computes the remainder of dividing the first node by the second, for integer values.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const modInt = /*@__PURE__*/ nodeProxy( OperatorNode, '%' );
+
+/**
+ * Checks if two nodes are equal.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const equal = /*@__PURE__*/ nodeProxy( OperatorNode, '==' );
+
+/**
+ * Checks if two nodes are not equal.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const notEqual = /*@__PURE__*/ nodeProxy( OperatorNode, '!=' );
+
+/**
+ * Checks if the first node is less than the second.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const lessThan = /*@__PURE__*/ nodeProxy( OperatorNode, '<' );
+
+/**
+ * Checks if the first node is greater than the second.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const greaterThan = /*@__PURE__*/ nodeProxy( OperatorNode, '>' );
+
+/**
+ * Checks if the first node is less than or equal to the second.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const lessThanEqual = /*@__PURE__*/ nodeProxy( OperatorNode, '<=' );
+
+/**
+ * Checks if the first node is greater than or equal to the second.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const greaterThanEqual = /*@__PURE__*/ nodeProxy( OperatorNode, '>=' );
+
+/**
+ * Performs logical AND on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const and = /*@__PURE__*/ nodeProxy( OperatorNode, '&&' );
+
+/**
+ * Performs logical OR on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const or = /*@__PURE__*/ nodeProxy( OperatorNode, '||' );
+
+/**
+ * Performs logical NOT on a node.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const not = /*@__PURE__*/ nodeProxy( OperatorNode, '!' );
+
+/**
+ * Performs logical XOR on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const xor = /*@__PURE__*/ nodeProxy( OperatorNode, '^^' );
+
+/**
+ * Performs bitwise AND on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const bitAnd = /*@__PURE__*/ nodeProxy( OperatorNode, '&' );
+
+/**
+ * Performs bitwise NOT on a node.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const bitNot = /*@__PURE__*/ nodeProxy( OperatorNode, '~' );
+
+/**
+ * Performs bitwise OR on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const bitOr = /*@__PURE__*/ nodeProxy( OperatorNode, '|' );
+
+/**
+ * Performs bitwise XOR on two nodes.
+ *
+ * @function
+ * @param {Node} aNode - The first input.
+ * @param {Node} bNode - The second input.
+ * @returns {OperatorNode}
+ */
 export const bitXor = /*@__PURE__*/ nodeProxy( OperatorNode, '^' );
+
+/**
+ * Shifts a node to the left.
+ *
+ * @function
+ * @param {Node} aNode - The node to shift.
+ * @param {Node} bNode - The value to shift.
+ * @returns {OperatorNode}
+ */
 export const shiftLeft = /*@__PURE__*/ nodeProxy( OperatorNode, '<<' );
+
+/**
+ * Shifts a node to the right.
+ *
+ * @function
+ * @param {Node} aNode - The node to shift.
+ * @param {Node} bNode - The value to shift.
+ * @returns {OperatorNode}
+ */
 export const shiftRight = /*@__PURE__*/ nodeProxy( OperatorNode, '>>' );
 
 addMethodChaining( 'add', add );

+ 1 - 1
src/nodes/pmrem/PMREMNode.js

@@ -362,7 +362,7 @@ function isEquirectangularMapReady( image ) {
 }
 
 /**
- * TSL function for creating a PMREM node with the given parameters.
+ * TSL function for creating a PMREM node.
  *
  * @function
  * @param {Texture} value - The input texture.

+ 1 - 1
src/nodes/utils/ArrayElementNode.js

@@ -15,7 +15,7 @@ class ArrayElementNode extends Node { // @TODO: If extending from TempNode it br
 	}
 
 	/**
-	 * Constructs array element node.
+	 * Constructs an array element node.
 	 *
 	 * @param {Node} node - The array-like node.
 	 * @param {Node} indexNode - The index node that defines the element access.

+ 9 - 0
src/nodes/utils/CubeMapNode.js

@@ -6,6 +6,8 @@ import { cubeTexture } from '../accessors/CubeTextureNode.js';
 import CubeRenderTarget from '../../renderers/common/CubeRenderTarget.js';
 import { CubeReflectionMapping, CubeRefractionMapping, EquirectangularReflectionMapping, EquirectangularRefractionMapping } from '../../constants.js';
 
+/** @module CubeMapNode **/
+
 const _cache = new WeakMap();
 
 /**
@@ -226,4 +228,11 @@ function mapTextureMapping( texture, mapping ) {
 
 }
 
+/**
+ * TSL function for creating a cube map node.
+ *
+ * @function
+ * @param {Node} envNode - The node representing the environment map.
+ * @returns {CubeMapNode}
+ */
 export const cubeMapNode = /*@__PURE__*/ nodeProxy( CubeMapNode );

+ 10 - 1
src/nodes/utils/EquirectUVNode.js

@@ -2,6 +2,8 @@ import TempNode from '../core/TempNode.js';
 import { positionWorldDirection } from '../accessors/Position.js';
 import { nodeProxy, vec2 } from '../tsl/TSLBase.js';
 
+/** @module EquirectUVNode **/
+
 /**
  * Can be used to compute texture coordinates for projecting an
  * equirectangular texture onto a mesh for using it as the scene's
@@ -24,7 +26,7 @@ class EquirectUVNode extends TempNode {
 	/**
 	 * Constructs a new equirect uv node.
 	 *
-	 * @param {Node<vec3>} [dirNode=positionWorldDirection] - A direction vector for sampling why is by default `positionWorldDirection`.
+	 * @param {Node<vec3>} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`.
 	 */
 	constructor( dirNode = positionWorldDirection ) {
 
@@ -54,4 +56,11 @@ class EquirectUVNode extends TempNode {
 
 export default EquirectUVNode;
 
+/**
+ * TSL function for creating an equirect uv node.
+ *
+ * @function
+ * @param {Node<vec3>} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`.
+ * @returns {EquirectUVNode}
+ */
 export const equirectUV = /*@__PURE__*/ nodeProxy( EquirectUVNode );

+ 9 - 0
src/nodes/utils/FunctionOverloadingNode.js

@@ -1,6 +1,8 @@
 import Node from '../core/Node.js';
 import { nodeProxy } from '../tsl/TSLBase.js';
 
+/** @module FunctionOverloadingNode **/
+
 /**
  * This class allows to define multiple overloaded versions
  * of the same function. Depending on the parameters of the function
@@ -141,4 +143,11 @@ export default FunctionOverloadingNode;
 
 const overloadingBaseFn = /*@__PURE__*/ nodeProxy( FunctionOverloadingNode );
 
+/**
+ * TSL function for creating a function overloading node.
+ *
+ * @function
+ * @param {Array<Function>} functionNodes - Array of `Fn` function definitions.
+ * @returns {FunctionOverloadingNode}
+ */
 export const overloadingFn = ( functionNodes ) => ( ...params ) => overloadingBaseFn( functionNodes, ...params );

+ 23 - 0
src/nodes/utils/LoopNode.js

@@ -2,6 +2,8 @@ import Node from '../core/Node.js';
 import { expression } from '../code/ExpressionNode.js';
 import { nodeObject, nodeArray } from '../tsl/TSLBase.js';
 
+/** @module LoopNode **/
+
 /**
  * This module offers a variety of ways to implement loops in TSL. In it's basic form it's:
  * ```js
@@ -247,8 +249,29 @@ class LoopNode extends Node {
 
 export default LoopNode;
 
+/**
+ * TSL function for creating a loop node.
+ *
+ * @function
+ * @param {...Any} params - A list of parameters.
+ * @returns {LoopNode}
+ */
 export const Loop = ( ...params ) => nodeObject( new LoopNode( nodeArray( params, 'int' ) ) ).append();
+
+/**
+ * TSL function for creating a `Continue()` expression.
+ *
+ * @function
+ * @returns {ExpressionNode}
+ */
 export const Continue = () => expression( 'continue' ).append();
+
+/**
+ * TSL function for creating a `Break()` expression.
+ *
+ * @function
+ * @returns {ExpressionNode}
+ */
 export const Break = () => expression( 'break' ).append();
 
 //

+ 8 - 0
src/nodes/utils/MatcapUVNode.js

@@ -3,6 +3,8 @@ import { transformedNormalView } from '../accessors/Normal.js';
 import { positionViewDirection } from '../accessors/Position.js';
 import { nodeImmutable, vec2, vec3 } from '../tsl/TSLBase.js';
 
+/** @module MatcapUVNode **/
+
 /**
  * Can be used to compute texture coordinates for projecting a
  * matcap onto a mesh. Used by {@link MeshMatcapNodeMaterial}.
@@ -39,4 +41,10 @@ class MatcapUVNode extends TempNode {
 
 export default MatcapUVNode;
 
+/**
+ * TSL function for creating a matcap uv node.
+ *
+ * @function
+ * @returns {MatcapUVNode}
+ */
 export const matcapUV = /*@__PURE__*/ nodeImmutable( MatcapUVNode );

+ 10 - 1
src/nodes/utils/MaxMipLevelNode.js

@@ -2,6 +2,8 @@ import UniformNode from '../core/UniformNode.js';
 import { NodeUpdateType } from '../core/constants.js';
 import { nodeProxy } from '../tsl/TSLBase.js';
 
+/** @module MatcapUVNode **/
+
 /**
  * A special type of uniform node that computes the
  * maximum mipmap level for a given texture node.
@@ -10,7 +12,7 @@ import { nodeProxy } from '../tsl/TSLBase.js';
  * const level = maxMipLevel( textureNode );
  * ```
  *
- * @augments UniformNode
+ * @augments module:UniformNode~UniformNode
  */
 class MaxMipLevelNode extends UniformNode {
 
@@ -92,4 +94,11 @@ class MaxMipLevelNode extends UniformNode {
 
 export default MaxMipLevelNode;
 
+/**
+ * TSL function for creating a max mip level node.
+ *
+ * @function
+ * @param {TextureNode} textureNode - The texture node to compute the max mip level for.
+ * @returns {MaxMipLevelNode}
+ */
 export const maxMipLevel = /*@__PURE__*/ nodeProxy( MaxMipLevelNode );

+ 23 - 1
src/nodes/utils/RTTNode.js

@@ -9,6 +9,8 @@ import { RenderTarget } from '../../core/RenderTarget.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { HalfFloatType } from '../../constants.js';
 
+/** @module RTTNode **/
+
 const _size = /*@__PURE__*/ new Vector2();
 
 /**
@@ -17,7 +19,7 @@ const _size = /*@__PURE__*/ new Vector2();
  * texture input for their effects. With the helper function `convertToTexture()` which is based
  * on this module, the node system can automatically ensure texture input if required.
  *
- * @augments TextureNode
+ * @augments module:TextureNode~TextureNode
  */
 class RTTNode extends TextureNode {
 
@@ -228,8 +230,28 @@ class RTTNode extends TextureNode {
 
 export default RTTNode;
 
+/**
+ * TSL function for creating a RTT node.
+ *
+ * @function
+ * @param {Node} node - The node to render a texture with.
+ * @param {Number?} [width=null] - The width of the internal render target. If not width is applied, the render target is automatically resized.
+ * @param {Number?} [height=null] - The height of the internal render target.
+ * @param {Object} [options={type:HalfFloatType}] - The options for the internal render target.
+ * @returns {RTTNode}
+ */
 export const rtt = ( node, ...params ) => nodeObject( new RTTNode( nodeObject( node ), ...params ) );
 
+/**
+ * TSL function for converting nodes to textures nodes.
+ *
+ * @function
+ * @param {Node} node - The node to render a texture with.
+ * @param {Number?} [width=null] - The width of the internal render target. If not width is applied, the render target is automatically resized.
+ * @param {Number?} [height=null] - The height of the internal render target.
+ * @param {Object} [options={type:HalfFloatType}] - The options for the internal render target.
+ * @returns {RTTNode}
+ */
 export const convertToTexture = ( node, ...params ) => {
 
 	if ( node.isTextureNode ) return node;

+ 17 - 1
src/nodes/utils/ReflectorNode.js

@@ -14,6 +14,8 @@ import { Matrix4 } from '../../math/Matrix4.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { DepthTexture } from '../../textures/DepthTexture.js';
 
+/** @module ReflectorNode **/
+
 const _reflectorPlane = new Plane();
 const _normal = new Vector3();
 const _reflectorWorldPosition = new Vector3();
@@ -46,7 +48,7 @@ let _inReflector = false;
  * plane.add( groundReflector.target );
  * ```
  *
- * @augments TextureNode
+ * @augments module:TextureNode~TextureNode
  */
 class ReflectorNode extends TextureNode {
 
@@ -475,6 +477,20 @@ class ReflectorBaseNode extends Node {
 
 }
 
+/**
+ * TSL function for creating a reflector node.
+ *
+ * @function
+ * @param {Object} [parameters={}] - An object holding configuration parameters.
+ * @param {Object3D} [parameters.target=new Object3D()] - The 3D object the reflector is linked to.
+ * @param {Number} [parameters.resolution=1] - The resolution scale.
+ * @param {Boolean} [parameters.generateMipmaps=false] - Whether mipmaps should be generated or not.
+ * @param {Boolean} [parameters.bounces=true] - Whether reflectors can render other reflector nodes or not.
+ * @param {Boolean} [parameters.depth=false] - Whether depth data should be generated or not.
+ * @param {TextureNode} [parameters.defaultTexture] - The default texture node.
+ * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node.
+ * @returns {ReflectorNode}
+ */
 export const reflector = ( parameters ) => nodeObject( new ReflectorNode( parameters ) );
 
 export default ReflectorNode;

+ 25 - 0
src/nodes/utils/RemapNode.js

@@ -1,6 +1,8 @@
 import Node from '../core/Node.js';
 import { float, addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
 
+/** @module RemapNode **/
+
 /**
  * This node allows to remap a node value from one range into another. E.g a value of
  * `0.4` in the range `[ 0.3, 0.5 ]` should be remapped into the normalized range `[ 0, 1 ]`.
@@ -93,7 +95,30 @@ class RemapNode extends Node {
 
 export default RemapNode;
 
+/**
+ * TSL function for creating a remap node.
+ *
+ * @function
+ * @param {Node} node - The node that should be remapped.
+ * @param {Node} inLowNode - The source or current lower bound of the range.
+ * @param {Node} inHighNode - The source or current upper bound of the range.
+ * @param {Node} [outLowNode=float(0)] - The target lower bound of the range.
+ * @param {Node} [outHighNode=float(1)] - The target upper bound of the range.
+ * @returns {RemapNode}
+ */
 export const remap = /*@__PURE__*/ nodeProxy( RemapNode, null, null, { doClamp: false } );
+
+/**
+ * TSL function for creating a remap node, but with enabled clamping.
+ *
+ * @function
+ * @param {Node} node - The node that should be remapped.
+ * @param {Node} inLowNode - The source or current lower bound of the range.
+ * @param {Node} inHighNode - The source or current upper bound of the range.
+ * @param {Node} [outLowNode=float(0)] - The target lower bound of the range.
+ * @param {Node} [outHighNode=float(1)] - The target upper bound of the range.
+ * @returns {RemapNode}
+ */
 export const remapClamp = /*@__PURE__*/ nodeProxy( RemapNode );
 
 addMethodChaining( 'remap', remap );

+ 11 - 0
src/nodes/utils/RotateNode.js

@@ -2,6 +2,8 @@ import TempNode from '../core/TempNode.js';
 import { nodeProxy, vec4, mat2, mat4 } from '../tsl/TSLBase.js';
 import { cos, sin } from '../math/MathNode.js';
 
+/** @module RotateNode **/
+
 /**
  * Applies a rotation to the given position node.
  *
@@ -90,4 +92,13 @@ class RotateNode extends TempNode {
 
 export default RotateNode;
 
+/**
+ * TSL function for creating a rotate node.
+ *
+ * @function
+ * @param {Node} positionNode - The position node.
+ * @param {Node} rotationNode - Represents the rotation that is applied to the position node. Depending
+ * on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value.
+ * @returns {RotateNode}
+ */
 export const rotate = /*@__PURE__*/ nodeProxy( RotateNode );

+ 11 - 0
src/nodes/utils/SpriteSheetUVNode.js

@@ -2,6 +2,8 @@ import Node from '../core/Node.js';
 import { uv } from '../accessors/UV.js';
 import { nodeProxy, float, vec2 } from '../tsl/TSLBase.js';
 
+/** @module SpriteSheetUVNode **/
+
 /**
  * Can be used to compute texture coordinates for animated sprite sheets.
  *
@@ -77,4 +79,13 @@ class SpriteSheetUVNode extends Node {
 
 export default SpriteSheetUVNode;
 
+/**
+ * TSL function for creating a sprite sheet uv node.
+ *
+ * @function
+ * @param {Node<vec2>} countNode - The node that defines the number of sprites in the x and y direction (e.g 6x6).
+ * @param {Node<vec2>} [uvNode=uv()] - The uv node.
+ * @param {Node<float>} [frameNode=float()] - The node that defines the current frame/sprite.
+ * @returns {SpriteSheetUVNode}
+ */
 export const spritesheetUV = /*@__PURE__*/ nodeProxy( SpriteSheetUVNode );

+ 10 - 0
src/nodes/utils/StorageArrayElementNode.js

@@ -1,6 +1,8 @@
 import { nodeProxy } from '../tsl/TSLBase.js';
 import ArrayElementNode from './ArrayElementNode.js';
 
+/** @module StorageArrayElementNode **/
+
 /**
  * This class enables element access on instances of {@link StorageBufferNode}.
  * In most cases, it is indirectly used when accessing elements with the
@@ -117,4 +119,12 @@ class StorageArrayElementNode extends ArrayElementNode {
 
 export default StorageArrayElementNode;
 
+/**
+ * TSL function for creating a storage element node.
+ *
+ * @function
+ * @param {StorageBufferNode} storageBufferNode - The storage buffer node.
+ * @param {Node} indexNode - The index node that defines the element access.
+ * @returns {StorageArrayElementNode}
+ */
 export const storageElement = /*@__PURE__*/ nodeProxy( StorageArrayElementNode );

+ 27 - 0
src/nodes/utils/TriplanarTexturesNode.js

@@ -5,6 +5,8 @@ import { positionLocal } from '../accessors/Position.js';
 import { texture } from '../accessors/TextureNode.js';
 import { nodeProxy, float, vec3 } from '../tsl/TSLBase.js';
 
+/** @module TriplanarTexturesNode **/
+
 /**
  * Can be used for triplanar texture mapping.
  *
@@ -117,5 +119,30 @@ class TriplanarTexturesNode extends Node {
 
 export default TriplanarTexturesNode;
 
+/**
+ * TSL function for creating a triplanar textures node.
+ *
+ * @function
+ * @param {Node} textureXNode - First texture node.
+ * @param {Node?} [textureYNode=null] - Second texture node. When not set, the shader will sample from `textureXNode` instead.
+ * @param {Node?} [textureZNode=null] - Third texture node. When not set, the shader will sample from `textureXNode` instead.
+ * @param {Node<float>?} [scaleNode=float(1)] - The scale node.
+ * @param {Node<vec3>?} [positionNode=positionLocal] - Vertex positions in local space.
+ * @param {Node<vec3>?} [normalNode=normalLocal] - Normals in local space.
+ * @returns {TriplanarTexturesNode}
+ */
 export const triplanarTextures = /*@__PURE__*/ nodeProxy( TriplanarTexturesNode );
+
+/**
+ * TSL function for creating a triplanar textures node.
+ *
+ * @function
+ * @param {Node} textureXNode - First texture node.
+ * @param {Node?} [textureYNode=null] - Second texture node. When not set, the shader will sample from `textureXNode` instead.
+ * @param {Node?} [textureZNode=null] - Third texture node. When not set, the shader will sample from `textureXNode` instead.
+ * @param {Node<float>?} [scaleNode=float(1)] - The scale node.
+ * @param {Node<vec3>?} [positionNode=positionLocal] - Vertex positions in local space.
+ * @param {Node<vec3>?} [normalNode=normalLocal] - Normals in local space.
+ * @returns {TriplanarTexturesNode}
+ */
 export const triplanarTexture = ( ...params ) => triplanarTextures( ...params );

粤ICP备19079148号