diff --git a/examples/jsm/controls/ArcballControls.js b/examples/jsm/controls/ArcballControls.js index b48924b336a914..aeed9822af4259 100644 --- a/examples/jsm/controls/ArcballControls.js +++ b/examples/jsm/controls/ArcballControls.js @@ -79,8 +79,8 @@ class ArcballControls extends Controls { /** * * @param {Camera} camera Virtual camera used in the scene - * @param {HTMLElement?} [domElement=null] Renderer's dom element - * @param {Scene?} [scene=null] The scene to be rendered + * @param {?HTMLElement} [domElement=null] Renderer's dom element + * @param {?Scene} [scene=null] The scene to be rendered */ constructor( camera, domElement = null, scene = null ) { @@ -1250,7 +1250,7 @@ class ArcballControls extends Controls { * Get the operation associated to mouse and key combination and returns the corresponding FSA state * @param {0|1|2} mouse Mouse button index (0, 1, 2) * @param {'CTRL'|'SHIFT'|null} key Keyboard modifier - * @returns {STATE?} The FSA state obtained from the operation associated to mouse/keyboard combination + * @returns {?STATE} The FSA state obtained from the operation associated to mouse/keyboard combination */ getOpStateFromAction( mouse, key ) { @@ -2328,7 +2328,7 @@ class ArcballControls extends Controls { * * @param {Vector2} cursor Cursor coordinates in NDC * @param {Camera} camera Virtual camera - * @returns {Vector3?} The point of intersection with the model, if exist, null otherwise + * @returns {?Vector3} The point of intersection with the model, if exist, null otherwise */ unprojectOnObj( cursor, camera ) { diff --git a/examples/jsm/exporters/GLTFExporter.js b/examples/jsm/exporters/GLTFExporter.js index dcd256d61c9a27..7f548dcfc35bae 100644 --- a/examples/jsm/exporters/GLTFExporter.js +++ b/examples/jsm/exporters/GLTFExporter.js @@ -987,11 +987,11 @@ class GLTFWriter { /** * Process and generate a BufferView - * @param {BufferAttribute} attribute - * @param {number} componentType - * @param {number} start - * @param {number} count - * @param {number?} target Target usage of the BufferView + * @param {BufferAttribute} attribute + * @param {number} componentType + * @param {number} start + * @param {number} count + * @param {?number} target Target usage of the BufferView * @return {Object} */ processBufferView( attribute, componentType, start, count, target ) { @@ -1179,11 +1179,11 @@ class GLTFWriter { /** * Process attribute to generate an accessor - * @param {BufferAttribute} attribute Attribute to process - * @param {THREE.BufferGeometry?} geometry Geometry used for truncated draw range - * @param {number} [start=0] - * @param {number} [count=Infinity] - * @return {number?} Index of the processed accessor on the "accessors" array + * @param {BufferAttribute} attribute Attribute to process + * @param {?BufferGeometry} geometry Geometry used for truncated draw range + * @param {number} [start=0] + * @param {number} [count=Infinity] + * @return {?number} Index of the processed accessor on the "accessors" array */ processAccessor( attribute, geometry, start, count ) { diff --git a/examples/jsm/loaders/KTX2Loader.js b/examples/jsm/loaders/KTX2Loader.js index 547bea42ff32f4..67dc28fafb6551 100644 --- a/examples/jsm/loaders/KTX2Loader.js +++ b/examples/jsm/loaders/KTX2Loader.js @@ -324,7 +324,7 @@ class KTX2Loader extends Loader { /** * @param {ArrayBuffer} buffer - * @param {object?} config + * @param {?Object} config * @return {Promise} */ async _createTexture( buffer, config = {} ) { diff --git a/examples/jsm/math/OBB.js b/examples/jsm/math/OBB.js index 23dc544bae1b11..cdec911962303c 100644 --- a/examples/jsm/math/OBB.js +++ b/examples/jsm/math/OBB.js @@ -322,7 +322,7 @@ class OBB { * * @param {Ray} ray * @param {Vector3} result - * @return {Vector3?} + * @return {?Vector3} */ intersectRay( ray, result ) { diff --git a/examples/jsm/tsl/display/BloomNode.js b/examples/jsm/tsl/display/BloomNode.js index 72c4b898b2683c..40effdde035295 100644 --- a/examples/jsm/tsl/display/BloomNode.js +++ b/examples/jsm/tsl/display/BloomNode.js @@ -154,7 +154,7 @@ class BloomNode extends TempNode { * The material for the composite pass. * * @private - * @type {NodeMaterial?} + * @type {?NodeMaterial} */ this._compositeMaterial = null; @@ -162,7 +162,7 @@ class BloomNode extends TempNode { * The material for the luminance pass. * * @private - * @type {NodeMaterial?} + * @type {?NodeMaterial} */ this._highPassFilterMaterial = null; diff --git a/examples/jsm/tsl/display/DenoiseNode.js b/examples/jsm/tsl/display/DenoiseNode.js index c98e0637a41be8..e5afb89656ff17 100644 --- a/examples/jsm/tsl/display/DenoiseNode.js +++ b/examples/jsm/tsl/display/DenoiseNode.js @@ -25,7 +25,7 @@ class DenoiseNode extends TempNode { * * @param {TextureNode} textureNode - The texture node that represents the input of the effect (e.g. AO). * @param {Node} depthNode - A node that represents the scene's depth. - * @param {Node?} normalNode - A node that represents the scene's normals. + * @param {?Node} normalNode - A node that represents the scene's normals. * @param {Camera} camera - The camera the scene is rendered with. */ constructor( textureNode, depthNode, normalNode, camera ) { @@ -51,7 +51,7 @@ class DenoiseNode extends TempNode { * constructor (because MRT is not available), normals can be automatically * reconstructed from depth values in the shader. * - * @type {Node?} + * @type {?Node} */ this.normalNode = normalNode; @@ -325,7 +325,7 @@ function generateDefaultNoise( size = 64 ) { * @function * @param {Node} node - The node that represents the input of the effect (e.g. AO). * @param {Node} depthNode - A node that represents the scene's depth. - * @param {Node?} normalNode - A node that represents the scene's normals. + * @param {?Node} normalNode - A node that represents the scene's normals. * @param {Camera} camera - The camera the scene is rendered with. * @returns {DenoiseNode} */ diff --git a/examples/jsm/tsl/display/FilmNode.js b/examples/jsm/tsl/display/FilmNode.js index 95acd4b6c98cca..c83277f5964e66 100644 --- a/examples/jsm/tsl/display/FilmNode.js +++ b/examples/jsm/tsl/display/FilmNode.js @@ -18,8 +18,8 @@ class FilmNode extends TempNode { * Constructs a new film node. * * @param {Node} inputNode - The node that represents the input of the effect. - * @param {Node?} [intensityNode=null] - A node that represents the effect's intensity. - * @param {Node?} [uvNode=null] - A node that allows to pass custom (e.g. animated) uv data. + * @param {?Node} [intensityNode=null] - A node that represents the effect's intensity. + * @param {?Node} [uvNode=null] - A node that allows to pass custom (e.g. animated) uv data. */ constructor( inputNode, intensityNode = null, uvNode = null ) { @@ -35,14 +35,16 @@ class FilmNode extends TempNode { /** * A node that represents the effect's intensity. * - * @type {Node} + * @type {?Node} + * @default null */ this.intensityNode = intensityNode; /** * A node that allows to pass custom (e.g. animated) uv data. * - * @type {Node} + * @type {?Node} + * @default null */ this.uvNode = uvNode; @@ -91,8 +93,8 @@ export default FilmNode; * @tsl * @function * @param {Node} inputNode - The node that represents the input of the effect. - * @param {Node?} [intensityNode=null] - A node that represents the effect's intensity. - * @param {Node?} [uvNode=null] - A node that allows to pass custom (e.g. animated) uv data. + * @param {?Node} [intensityNode=null] - A node that represents the effect's intensity. + * @param {?Node} [uvNode=null] - A node that allows to pass custom (e.g. animated) uv data. * @returns {FilmNode} */ export const film = /*@__PURE__*/ nodeProxy( FilmNode ); diff --git a/examples/jsm/tsl/display/GTAONode.js b/examples/jsm/tsl/display/GTAONode.js index a77c1e4706d3c3..15c3a18b1107df 100644 --- a/examples/jsm/tsl/display/GTAONode.js +++ b/examples/jsm/tsl/display/GTAONode.js @@ -42,7 +42,7 @@ class GTAONode extends TempNode { * Constructs a new GTAO node. * * @param {Node} depthNode - A node that represents the scene's depth. - * @param {Node?} normalNode - A node that represents the scene's normals. + * @param {?Node} normalNode - A node that represents the scene's normals. * @param {Camera} camera - The camera the scene is rendered with. */ constructor( depthNode, normalNode, camera ) { @@ -61,7 +61,7 @@ class GTAONode extends TempNode { * constructor (because MRT is not available), normals can be automatically * reconstructed from depth values in the shader. * - * @type {Node?} + * @type {?Node} */ this.normalNode = normalNode; @@ -514,7 +514,7 @@ function generateMagicSquare( size ) { * @tsl * @function * @param {Node} depthNode - A node that represents the scene's depth. - * @param {Node?} normalNode - A node that represents the scene's normals. + * @param {?Node} normalNode - A node that represents the scene's normals. * @param {Camera} camera - The camera the scene is rendered with. * @returns {GTAONode} */ diff --git a/examples/jsm/tsl/display/SSAAPassNode.js b/examples/jsm/tsl/display/SSAAPassNode.js index bd71a639efb7a6..335f6b867d2bdd 100644 --- a/examples/jsm/tsl/display/SSAAPassNode.js +++ b/examples/jsm/tsl/display/SSAAPassNode.js @@ -88,7 +88,8 @@ class SSAAPassNode extends PassNode { * Reference to the internal render target that holds the current sample. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} + * @default null */ this._sampleRenderTarget = null; diff --git a/examples/jsm/tsl/display/TRAAPassNode.js b/examples/jsm/tsl/display/TRAAPassNode.js index 4333bc654c27ed..99d8c71f450c22 100644 --- a/examples/jsm/tsl/display/TRAAPassNode.js +++ b/examples/jsm/tsl/display/TRAAPassNode.js @@ -90,7 +90,8 @@ class TRAAPassNode extends PassNode { * The render target that holds the current sample. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} + * @default null */ this._sampleRenderTarget = null; @@ -98,7 +99,8 @@ class TRAAPassNode extends PassNode { * The render target that represents the history of frame data. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} + * @default null */ this._historyRenderTarget = null; diff --git a/src/loaders/nodes/NodeLoader.js b/src/loaders/nodes/NodeLoader.js index c2603b95382ff2..474bf2bcec6c6b 100644 --- a/src/loaders/nodes/NodeLoader.js +++ b/src/loaders/nodes/NodeLoader.js @@ -13,7 +13,7 @@ class NodeLoader extends Loader { /** * Constructs a new node loader. * - * @param {LoadingManager?} manager - A reference to a loading manager. + * @param {?LoadingManager} manager - A reference to a loading manager. */ constructor( manager ) { diff --git a/src/loaders/nodes/NodeMaterialLoader.js b/src/loaders/nodes/NodeMaterialLoader.js index fe1a577795db1f..d9457526f25821 100644 --- a/src/loaders/nodes/NodeMaterialLoader.js +++ b/src/loaders/nodes/NodeMaterialLoader.js @@ -10,7 +10,7 @@ class NodeMaterialLoader extends MaterialLoader { /** * Constructs a new node material loader. * - * @param {LoadingManager?} manager - A reference to a loading manager. + * @param {?LoadingManager} manager - A reference to a loading manager. */ constructor( manager ) { diff --git a/src/loaders/nodes/NodeObjectLoader.js b/src/loaders/nodes/NodeObjectLoader.js index 5565129a9ab44a..4db893963ee351 100644 --- a/src/loaders/nodes/NodeObjectLoader.js +++ b/src/loaders/nodes/NodeObjectLoader.js @@ -14,7 +14,7 @@ class NodeObjectLoader extends ObjectLoader { /** * Constructs a new node object loader. * - * @param {LoadingManager?} manager - A reference to a loading manager. + * @param {?LoadingManager} manager - A reference to a loading manager. */ constructor( manager ) { @@ -38,7 +38,7 @@ class NodeObjectLoader extends ObjectLoader { * A reference to hold the `nodes` JSON property. * * @private - * @type {Object?} + * @type {?Object} */ this._nodesJSON = null; diff --git a/src/materials/nodes/Line2NodeMaterial.js b/src/materials/nodes/Line2NodeMaterial.js index 1676dd457a9454..9d474bf4c8572c 100644 --- a/src/materials/nodes/Line2NodeMaterial.js +++ b/src/materials/nodes/Line2NodeMaterial.js @@ -33,7 +33,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Constructs a new node material for wide line rendering. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters = {} ) { @@ -77,7 +77,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Defines the lines color. * - * @type {Node?} + * @type {?Node} * @default null */ this.lineColorNode = null; @@ -85,7 +85,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Defines the offset. * - * @type {Node?} + * @type {?Node} * @default null */ this.offsetNode = null; @@ -93,7 +93,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Defines the dash scale. * - * @type {Node?} + * @type {?Node} * @default null */ this.dashScaleNode = null; @@ -101,7 +101,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Defines the dash size. * - * @type {Node?} + * @type {?Node} * @default null */ this.dashSizeNode = null; @@ -109,7 +109,7 @@ class Line2NodeMaterial extends NodeMaterial { /** * Defines the gap size. * - * @type {Node?} + * @type {?Node} * @default null */ this.gapSizeNode = null; diff --git a/src/materials/nodes/LineBasicNodeMaterial.js b/src/materials/nodes/LineBasicNodeMaterial.js index bcdd42eea02fe5..b814f3c17a24d5 100644 --- a/src/materials/nodes/LineBasicNodeMaterial.js +++ b/src/materials/nodes/LineBasicNodeMaterial.js @@ -20,7 +20,7 @@ class LineBasicNodeMaterial extends NodeMaterial { /** * Constructs a new line basic node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { diff --git a/src/materials/nodes/LineDashedNodeMaterial.js b/src/materials/nodes/LineDashedNodeMaterial.js index 366107d2ac4392..a2ede6713350d5 100644 --- a/src/materials/nodes/LineDashedNodeMaterial.js +++ b/src/materials/nodes/LineDashedNodeMaterial.js @@ -24,7 +24,7 @@ class LineDashedNodeMaterial extends NodeMaterial { /** * Constructs a new line dashed node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -57,7 +57,7 @@ class LineDashedNodeMaterial extends NodeMaterial { * If you don't want to overwrite the offset but modify the existing * value instead, use {@link materialLineDashOffset}. * - * @type {Node?} + * @type {?Node} * @default null */ this.offsetNode = null; @@ -70,7 +70,7 @@ class LineDashedNodeMaterial extends NodeMaterial { * If you don't want to overwrite the scale but modify the existing * value instead, use {@link materialLineScale}. * - * @type {Node?} + * @type {?Node} * @default null */ this.dashScaleNode = null; @@ -83,7 +83,7 @@ class LineDashedNodeMaterial extends NodeMaterial { * If you don't want to overwrite the dash size but modify the existing * value instead, use {@link materialLineDashSize}. * - * @type {Node?} + * @type {?Node} * @default null */ this.dashSizeNode = null; @@ -96,7 +96,7 @@ class LineDashedNodeMaterial extends NodeMaterial { * If you don't want to overwrite the gap size but modify the existing * value instead, use {@link materialLineGapSize}. * - * @type {Node?} + * @type {?Node} * @default null */ this.gapSizeNode = null; diff --git a/src/materials/nodes/MeshBasicNodeMaterial.js b/src/materials/nodes/MeshBasicNodeMaterial.js index 155752258eb7a2..b80be9680c9800 100644 --- a/src/materials/nodes/MeshBasicNodeMaterial.js +++ b/src/materials/nodes/MeshBasicNodeMaterial.js @@ -26,7 +26,7 @@ class MeshBasicNodeMaterial extends NodeMaterial { /** * Constructs a new mesh basic node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -74,7 +74,7 @@ class MeshBasicNodeMaterial extends NodeMaterial { * to implement the default environment mapping. * * @param {NodeBuilder} builder - The current node builder. - * @return {BasicEnvironmentNode?} The environment node. + * @return {?BasicEnvironmentNode} The environment node. */ setupEnvironment( builder ) { @@ -89,7 +89,7 @@ class MeshBasicNodeMaterial extends NodeMaterial { * with a special scaling factor for basic materials. * * @param {NodeBuilder} builder - The current node builder. - * @return {BasicLightMapNode?} The light map node. + * @return {?BasicLightMapNode} The light map node. */ setupLightMap( builder ) { diff --git a/src/materials/nodes/MeshLambertNodeMaterial.js b/src/materials/nodes/MeshLambertNodeMaterial.js index 30da646fb4402f..4f8b27f501c7df 100644 --- a/src/materials/nodes/MeshLambertNodeMaterial.js +++ b/src/materials/nodes/MeshLambertNodeMaterial.js @@ -22,7 +22,7 @@ class MeshLambertNodeMaterial extends NodeMaterial { /** * Constructs a new mesh lambert node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -56,7 +56,7 @@ class MeshLambertNodeMaterial extends NodeMaterial { * to implement the default environment mapping. * * @param {NodeBuilder} builder - The current node builder. - * @return {BasicEnvironmentNode?} The environment node. + * @return {?BasicEnvironmentNode} The environment node. */ setupEnvironment( builder ) { diff --git a/src/materials/nodes/MeshMatcapNodeMaterial.js b/src/materials/nodes/MeshMatcapNodeMaterial.js index 61efebe09303d9..aacd2c4a60841f 100644 --- a/src/materials/nodes/MeshMatcapNodeMaterial.js +++ b/src/materials/nodes/MeshMatcapNodeMaterial.js @@ -25,7 +25,7 @@ class MeshMatcapNodeMaterial extends NodeMaterial { /** * Constructs a new mesh normal node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { diff --git a/src/materials/nodes/MeshNormalNodeMaterial.js b/src/materials/nodes/MeshNormalNodeMaterial.js index bdfdf94f246226..625240803783db 100644 --- a/src/materials/nodes/MeshNormalNodeMaterial.js +++ b/src/materials/nodes/MeshNormalNodeMaterial.js @@ -25,7 +25,7 @@ class MeshNormalNodeMaterial extends NodeMaterial { /** * Constructs a new mesh normal node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { diff --git a/src/materials/nodes/MeshPhongNodeMaterial.js b/src/materials/nodes/MeshPhongNodeMaterial.js index e3704e1db0820f..08df02458305b8 100644 --- a/src/materials/nodes/MeshPhongNodeMaterial.js +++ b/src/materials/nodes/MeshPhongNodeMaterial.js @@ -25,7 +25,7 @@ class MeshPhongNodeMaterial extends NodeMaterial { /** * Constructs a new mesh lambert node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -56,7 +56,7 @@ class MeshPhongNodeMaterial extends NodeMaterial { * If you don't want to overwrite the shininess but modify the existing * value instead, use {@link materialShininess}. * - * @type {Node?} + * @type {?Node} * @default null */ this.shininessNode = null; @@ -69,7 +69,7 @@ class MeshPhongNodeMaterial extends NodeMaterial { * If you don't want to overwrite the specular color but modify the existing * value instead, use {@link materialSpecular}. * - * @type {Node?} + * @type {?Node} * @default null */ this.specularNode = null; @@ -85,7 +85,7 @@ class MeshPhongNodeMaterial extends NodeMaterial { * to implement the default environment mapping. * * @param {NodeBuilder} builder - The current node builder. - * @return {BasicEnvironmentNode?} The environment node. + * @return {?BasicEnvironmentNode} The environment node. */ setupEnvironment( builder ) { diff --git a/src/materials/nodes/MeshPhysicalNodeMaterial.js b/src/materials/nodes/MeshPhysicalNodeMaterial.js index e2f38fa9772f94..d7789f85ccc85b 100644 --- a/src/materials/nodes/MeshPhysicalNodeMaterial.js +++ b/src/materials/nodes/MeshPhysicalNodeMaterial.js @@ -27,7 +27,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { /** * Constructs a new mesh physical node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -50,7 +50,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the clearcoat but modify the existing * value instead, use {@link materialClearcoat}. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatNode = null; @@ -63,7 +63,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the clearcoat roughness but modify the existing * value instead, use {@link materialClearcoatRoughness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatRoughnessNode = null; @@ -76,7 +76,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the clearcoat normal but modify the existing * value instead, use {@link materialClearcoatNormal}. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatNormalNode = null; @@ -89,7 +89,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the sheen but modify the existing * value instead, use {@link materialSheen}. * - * @type {Node?} + * @type {?Node} * @default null */ this.sheenNode = null; @@ -102,7 +102,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the sheen roughness but modify the existing * value instead, use {@link materialSheenRoughness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.sheenRoughnessNode = null; @@ -115,7 +115,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the iridescence but modify the existing * value instead, use {@link materialIridescence}. * - * @type {Node?} + * @type {?Node} * @default null */ this.iridescenceNode = null; @@ -128,7 +128,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the iridescence IOR but modify the existing * value instead, use {@link materialIridescenceIOR}. * - * @type {Node?} + * @type {?Node} * @default null */ this.iridescenceIORNode = null; @@ -141,7 +141,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the iridescence thickness but modify the existing * value instead, use {@link materialIridescenceThickness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.iridescenceThicknessNode = null; @@ -154,7 +154,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the specular intensity but modify the existing * value instead, use {@link materialSpecularIntensity}. * - * @type {Node?} + * @type {?Node} * @default null */ this.specularIntensityNode = null; @@ -167,7 +167,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the specular color but modify the existing * value instead, use {@link materialSpecularColor}. * - * @type {Node?} + * @type {?Node} * @default null */ this.specularColorNode = null; @@ -180,7 +180,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the ior but modify the existing * value instead, use {@link materialIOR}. * - * @type {Node?} + * @type {?Node} * @default null */ this.iorNode = null; @@ -193,7 +193,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the transmission but modify the existing * value instead, use {@link materialTransmission}. * - * @type {Node?} + * @type {?Node} * @default null */ this.transmissionNode = null; @@ -206,7 +206,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the thickness but modify the existing * value instead, use {@link materialThickness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.thicknessNode = null; @@ -219,7 +219,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the attenuation distance but modify the existing * value instead, use {@link materialAttenuationDistance}. * - * @type {Node?} + * @type {?Node} * @default null */ this.attenuationDistanceNode = null; @@ -232,7 +232,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the attenuation color but modify the existing * value instead, use {@link materialAttenuationColor}. * - * @type {Node?} + * @type {?Node} * @default null */ this.attenuationColorNode = null; @@ -245,7 +245,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the dispersion but modify the existing * value instead, use {@link materialDispersion}. * - * @type {Node?} + * @type {?Node} * @default null */ this.dispersionNode = null; @@ -258,7 +258,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * If you don't want to overwrite the anisotropy but modify the existing * value instead, use {@link materialAnisotropy}. * - * @type {Node?} + * @type {?Node} * @default null */ this.anisotropyNode = null; diff --git a/src/materials/nodes/MeshSSSNodeMaterial.js b/src/materials/nodes/MeshSSSNodeMaterial.js index cf6900e9406287..e94284923a22d9 100644 --- a/src/materials/nodes/MeshSSSNodeMaterial.js +++ b/src/materials/nodes/MeshSSSNodeMaterial.js @@ -84,7 +84,7 @@ class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { /** * Constructs a new mesh SSS node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -93,7 +93,7 @@ class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { /** * Represents the thickness color. * - * @type {Node?} + * @type {?Node} * @default null */ this.thicknessColorNode = null; @@ -101,35 +101,35 @@ class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { /** * Represents the distortion factor. * - * @type {Node?} + * @type {?Node} */ this.thicknessDistortionNode = float( 0.1 ); /** * Represents the thickness ambient factor. * - * @type {Node?} + * @type {?Node} */ this.thicknessAmbientNode = float( 0.0 ); /** * Represents the thickness attenuation. * - * @type {Node?} + * @type {?Node} */ this.thicknessAttenuationNode = float( .1 ); /** * Represents the thickness power. * - * @type {Node?} + * @type {?Node} */ this.thicknessPowerNode = float( 2.0 ); /** * Represents the thickness scale. * - * @type {Node?} + * @type {?Node} */ this.thicknessScaleNode = float( 10.0 ); diff --git a/src/materials/nodes/MeshStandardNodeMaterial.js b/src/materials/nodes/MeshStandardNodeMaterial.js index 80f0b6e59f6ef6..75b3eb3da9b0ce 100644 --- a/src/materials/nodes/MeshStandardNodeMaterial.js +++ b/src/materials/nodes/MeshStandardNodeMaterial.js @@ -27,7 +27,7 @@ class MeshStandardNodeMaterial extends NodeMaterial { /** * Constructs a new mesh standard node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -58,7 +58,7 @@ class MeshStandardNodeMaterial extends NodeMaterial { * If you don't want to overwrite the emissive color but modify the existing * value instead, use {@link materialEmissive}. * - * @type {Node?} + * @type {?Node} * @default null */ this.emissiveNode = null; @@ -71,7 +71,7 @@ class MeshStandardNodeMaterial extends NodeMaterial { * If you don't want to overwrite the metalness but modify the existing * value instead, use {@link materialMetalness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.metalnessNode = null; @@ -84,7 +84,7 @@ class MeshStandardNodeMaterial extends NodeMaterial { * If you don't want to overwrite the roughness but modify the existing * value instead, use {@link materialRoughness}. * - * @type {Node?} + * @type {?Node} * @default null */ this.roughnessNode = null; @@ -101,7 +101,7 @@ class MeshStandardNodeMaterial extends NodeMaterial { * method honors `Scene.environment`. * * @param {NodeBuilder} builder - The current node builder. - * @return {EnvironmentNode?} The environment node. + * @return {?EnvironmentNode} The environment node. */ setupEnvironment( builder ) { diff --git a/src/materials/nodes/MeshToonNodeMaterial.js b/src/materials/nodes/MeshToonNodeMaterial.js index b463f5910beb33..a20a8015298ce8 100644 --- a/src/materials/nodes/MeshToonNodeMaterial.js +++ b/src/materials/nodes/MeshToonNodeMaterial.js @@ -21,7 +21,7 @@ class MeshToonNodeMaterial extends NodeMaterial { /** * Constructs a new mesh toon node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { diff --git a/src/materials/nodes/NodeMaterial.js b/src/materials/nodes/NodeMaterial.js index 648cac84cb1482..2eee11a033e90e 100644 --- a/src/materials/nodes/NodeMaterial.js +++ b/src/materials/nodes/NodeMaterial.js @@ -106,7 +106,7 @@ class NodeMaterial extends Material { * material.lightsNode = customLightsNode; * ``` * - * @type {LightsNode?} + * @type {?LightsNode} * @default null */ this.lightsNode = null; @@ -121,7 +121,7 @@ class NodeMaterial extends Material { * material.envNode = pmremTexture( renderTarget.texture ); * ``` * - * @type {Node?} + * @type {?Node} * @default null */ this.envNode = null; @@ -135,7 +135,7 @@ class NodeMaterial extends Material { * If you don't want to overwrite the diffuse color but modify the existing * values instead, use {@link materialAO}. * - * @type {Node?} + * @type {?Node} * @default null */ this.aoNode = null; @@ -156,7 +156,7 @@ class NodeMaterial extends Material { * material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint * ``` * - * @type {Node?} + * @type {?Node} * @default null */ this.colorNode = null; @@ -169,7 +169,7 @@ class NodeMaterial extends Material { * If you don't want to overwrite the normals but modify the existing values instead, * use {@link materialNormal}. * - * @type {Node?} + * @type {?Node} * @default null */ this.normalNode = null; @@ -182,7 +182,7 @@ class NodeMaterial extends Material { * If you don't want to overwrite the normals but modify the existing * value instead, use {@link materialOpacity}. * - * @type {Node?} + * @type {?Node} * @default null */ this.opacityNode = null; @@ -203,7 +203,7 @@ class NodeMaterial extends Material { * * Backdrop computations are part of the lighting so only lit materials can use this property. * - * @type {Node?} + * @type {?Node} * @default null */ this.backdropNode = null; @@ -211,7 +211,7 @@ class NodeMaterial extends Material { /** * This node allows to modulate the influence of `backdropNode` to the outgoing light. * - * @type {Node?} + * @type {?Node} * @default null */ this.backdropAlphaNode = null; @@ -224,7 +224,7 @@ class NodeMaterial extends Material { * If you don't want to overwrite the alpha test but modify the existing * value instead, use {@link materialAlphaTest}. * - * @type {Node?} + * @type {?Node} * @default null */ this.alphaTestNode = null; @@ -241,7 +241,7 @@ class NodeMaterial extends Material { * material.positionNode = positionLocal.add( displace ); * ``` * - * @type {Node?} + * @type {?Node} * @default null */ this.positionNode = null; @@ -265,7 +265,7 @@ class NodeMaterial extends Material { /** * Allows to overwrite depth values in the fragment shader. * - * @type {Node?} + * @type {?Node} * @default null */ this.depthNode = null; @@ -275,7 +275,7 @@ class NodeMaterial extends Material { * is by default {@link positionWorld}, the vertex position * in world space. * - * @type {Node?} + * @type {?Node} * @default null */ this.shadowPositionNode = null; @@ -292,7 +292,7 @@ class NodeMaterial extends Material { * return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color * } ); * - * @type {Node?} + * @type {?Node} * @default null */ this.receivedShadowNode = null; @@ -316,7 +316,7 @@ class NodeMaterial extends Material { * } )(); * ``` * - * @type {Node?} + * @type {?Node} * @default null */ this.castShadowNode = null; @@ -326,7 +326,7 @@ class NodeMaterial extends Material { * * TODO: Explain the differences to `fragmentNode`. * - * @type {Node?} + * @type {?Node} * @default null */ this.outputNode = null; @@ -337,7 +337,7 @@ class NodeMaterial extends Material { * can be useful for implementing selective FX features that should only affect * specific objects. * - * @type {MRTNode?} + * @type {?MRTNode} * @default null */ this.mrtNode = null; @@ -347,7 +347,7 @@ class NodeMaterial extends Material { * the fragment shader. Assigning a node will replace the built-in material * logic used in the fragment stage. * - * @type {Node?} + * @type {?Node} * @default null */ this.fragmentNode = null; @@ -357,7 +357,7 @@ class NodeMaterial extends Material { * the vertex shader. Assigning a node will replace the built-in material logic * used in the vertex stage. * - * @type {Node?} + * @type {?Node} * @default null */ this.vertexNode = null; @@ -1062,7 +1062,7 @@ class NodeMaterial extends Material { /** * Serializes this material to JSON. * - * @param {(Object|string)?} meta - The meta information for serialization. + * @param {?(Object|string)} meta - The meta information for serialization. * @return {Object} The serialized node. */ toJSON( meta ) { diff --git a/src/materials/nodes/PointsNodeMaterial.js b/src/materials/nodes/PointsNodeMaterial.js index df586dd37e123c..e51f5547d23145 100644 --- a/src/materials/nodes/PointsNodeMaterial.js +++ b/src/materials/nodes/PointsNodeMaterial.js @@ -26,7 +26,7 @@ class PointsNodeMaterial extends SpriteNodeMaterial { /** * Constructs a new points node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -35,7 +35,7 @@ class PointsNodeMaterial extends SpriteNodeMaterial { /** * This node property provides an additional way to set the point size. * - * @type {Node?} + * @type {?Node} * @default null */ this.sizeNode = null; diff --git a/src/materials/nodes/ShadowNodeMaterial.js b/src/materials/nodes/ShadowNodeMaterial.js index e442e50bc76fe4..468fe6f935f816 100644 --- a/src/materials/nodes/ShadowNodeMaterial.js +++ b/src/materials/nodes/ShadowNodeMaterial.js @@ -21,7 +21,7 @@ class ShadowNodeMaterial extends NodeMaterial { /** * Constructs a new shadow node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { diff --git a/src/materials/nodes/SpriteNodeMaterial.js b/src/materials/nodes/SpriteNodeMaterial.js index 9f2f9da49a38cb..27a91a2b7d3dd6 100644 --- a/src/materials/nodes/SpriteNodeMaterial.js +++ b/src/materials/nodes/SpriteNodeMaterial.js @@ -27,7 +27,7 @@ class SpriteNodeMaterial extends NodeMaterial { /** * Constructs a new sprite node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -58,7 +58,7 @@ class SpriteNodeMaterial extends NodeMaterial { * particleMaterial.positionNode = positionBuffer.toAttribute(); * ``` * - * @type {Node?} + * @type {?Node} * @default null */ this.positionNode = null; @@ -71,7 +71,7 @@ class SpriteNodeMaterial extends NodeMaterial { * If you don't want to overwrite the rotation but modify the existing * value instead, use {@link materialRotation}. * - * @type {Node?} + * @type {?Node} * @default null */ this.rotationNode = null; @@ -81,7 +81,7 @@ class SpriteNodeMaterial extends NodeMaterial { * `Object3D.scale`. The scale transformation based in `Object3D.scale` * is multiplied with the scale value of this node in the vertex shader. * - * @type {Node?} + * @type {?Node} * @default null */ this.scaleNode = null; diff --git a/src/materials/nodes/VolumeNodeMaterial.js b/src/materials/nodes/VolumeNodeMaterial.js index 018f45a18d0c31..ebf47581475766 100644 --- a/src/materials/nodes/VolumeNodeMaterial.js +++ b/src/materials/nodes/VolumeNodeMaterial.js @@ -27,7 +27,7 @@ class VolumeNodeMaterial extends NodeMaterial { /** * Constructs a new volume node material. * - * @param {Object?} parameters - The configuration parameter. + * @param {?Object} parameters - The configuration parameter. */ constructor( parameters ) { @@ -53,7 +53,7 @@ class VolumeNodeMaterial extends NodeMaterial { /** * A 3D data texture holding the volumetric data. * - * @type {Data3DTexture?} + * @type {?Data3DTexture} * @default null */ this.map = null; @@ -89,7 +89,7 @@ class VolumeNodeMaterial extends NodeMaterial { * where the rays enters the volume. The last parameter is a color * that allows the callback to determine the final color. * - * @type {testNodeCallback?} + * @type {?testNodeCallback} * @default null */ this.testNode = null; diff --git a/src/nodes/accessors/BatchNode.js b/src/nodes/accessors/BatchNode.js index ea17762ba62487..5c1bd92889b70e 100644 --- a/src/nodes/accessors/BatchNode.js +++ b/src/nodes/accessors/BatchNode.js @@ -42,7 +42,7 @@ class BatchNode extends Node { /** * The batching index node. * - * @type {IndexNode?} + * @type {?IndexNode} * @default null */ this.batchingIdNode = null; diff --git a/src/nodes/accessors/BufferAttributeNode.js b/src/nodes/accessors/BufferAttributeNode.js index 62f568605f9587..0803d9d53e604d 100644 --- a/src/nodes/accessors/BufferAttributeNode.js +++ b/src/nodes/accessors/BufferAttributeNode.js @@ -40,7 +40,7 @@ class BufferAttributeNode extends InputNode { * Constructs a new buffer attribute node. * * @param {BufferAttribute|InterleavedBuffer|TypedArray} value - The attribute data. - * @param {string?} [bufferType=null] - The buffer type (e.g. `'vec3'`). + * @param {?string} [bufferType=null] - The buffer type (e.g. `'vec3'`). * @param {number} [bufferStride=0] - The buffer stride. * @param {number} [bufferOffset=0] - The buffer offset. */ @@ -101,7 +101,7 @@ class BufferAttributeNode extends InputNode { /** * A reference to the buffer attribute. * - * @type {BufferAttribute?} + * @type {?BufferAttribute} * @default null */ this.attribute = null; @@ -290,7 +290,7 @@ export default BufferAttributeNode; * @tsl * @function * @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data. - * @param {string?} [type=null] - The buffer type (e.g. `'vec3'`). + * @param {?string} [type=null] - The buffer type (e.g. `'vec3'`). * @param {number} [stride=0] - The buffer stride. * @param {number} [offset=0] - The buffer offset. * @returns {BufferAttributeNode} @@ -304,7 +304,7 @@ export const bufferAttribute = ( array, type = null, stride = 0, offset = 0 ) => * @tsl * @function * @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data. - * @param {string?} [type=null] - The buffer type (e.g. `'vec3'`). + * @param {?string} [type=null] - The buffer type (e.g. `'vec3'`). * @param {number} [stride=0] - The buffer stride. * @param {number} [offset=0] - The buffer offset. * @returns {BufferAttributeNode} @@ -317,7 +317,7 @@ export const dynamicBufferAttribute = ( array, type = null, stride = 0, offset = * @tsl * @function * @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data. - * @param {string?} [type=null] - The buffer type (e.g. `'vec3'`). + * @param {?string} [type=null] - The buffer type (e.g. `'vec3'`). * @param {number} [stride=0] - The buffer stride. * @param {number} [offset=0] - The buffer offset. * @returns {BufferAttributeNode} @@ -330,7 +330,7 @@ export const instancedBufferAttribute = ( array, type = null, stride = 0, offset * @tsl * @function * @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data. - * @param {string?} [type=null] - The buffer type (e.g. `'vec3'`). + * @param {?string} [type=null] - The buffer type (e.g. `'vec3'`). * @param {number} [stride=0] - The buffer stride. * @param {number} [offset=0] - The buffer offset. * @returns {BufferAttributeNode} diff --git a/src/nodes/accessors/CubeTextureNode.js b/src/nodes/accessors/CubeTextureNode.js index b43350da8dd1f7..bafbddc60c21c4 100644 --- a/src/nodes/accessors/CubeTextureNode.js +++ b/src/nodes/accessors/CubeTextureNode.js @@ -21,9 +21,9 @@ class CubeTextureNode extends TextureNode { * Constructs a new cube texture node. * * @param {CubeTexture} value - The cube texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. - * @param {Node?} [biasNode=null] - The bias node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. */ constructor( value, uvNode = null, levelNode = null, biasNode = null ) { @@ -134,9 +134,9 @@ export default CubeTextureNode; * @tsl * @function * @param {CubeTexture} value - The cube texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. - * @param {Node?} [biasNode=null] - The bias node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. * @returns {CubeTextureNode} */ export const cubeTexture = /*@__PURE__*/ nodeProxy( CubeTextureNode ); diff --git a/src/nodes/accessors/MaterialReferenceNode.js b/src/nodes/accessors/MaterialReferenceNode.js index 80d71f4cbc58af..f4e20ec62c9ac6 100644 --- a/src/nodes/accessors/MaterialReferenceNode.js +++ b/src/nodes/accessors/MaterialReferenceNode.js @@ -25,7 +25,7 @@ class MaterialReferenceNode extends ReferenceNode { * * @param {string} property - The name of the property the node refers to. * @param {string} inputType - The uniform type that should be used to represent the property value. - * @param {Material?} [material=null] - The material the property belongs to. When no material is set, + * @param {?Material} [material=null] - The material the property belongs to. When no material is set, * the node refers to the material of the current rendered object. */ constructor( property, inputType, material = null ) { @@ -36,7 +36,7 @@ class MaterialReferenceNode extends ReferenceNode { * The material the property belongs to. When no material is set, * the node refers to the material of the current rendered object. * - * @type {Material?} + * @type {?Material} * @default null */ this.material = material; @@ -78,7 +78,7 @@ export default MaterialReferenceNode; * @function * @param {string} name - The name of the property the node refers to. * @param {string} type - The uniform type that should be used to represent the property value. - * @param {Material?} [material=null] - The material the property belongs to. + * @param {?Material} [material=null] - The material the property belongs to. * When no material is set, the node refers to the material of the current rendered object. * @returns {MaterialReferenceNode} */ diff --git a/src/nodes/accessors/Object3DNode.js b/src/nodes/accessors/Object3DNode.js index 9d40089d67e783..e3054222947848 100644 --- a/src/nodes/accessors/Object3DNode.js +++ b/src/nodes/accessors/Object3DNode.js @@ -29,7 +29,7 @@ class Object3DNode extends Node { * Constructs a new object 3D node. * * @param {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} scope - The node represents a different type of transformation depending on the scope. - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. */ constructor( scope, object3d = null ) { @@ -45,7 +45,7 @@ class Object3DNode extends Node { /** * The 3D object. * - * @type {Object3D?} + * @type {?Object3D} * @default null */ this.object3d = object3d; @@ -191,7 +191,7 @@ export default Object3DNode; * * @tsl * @function - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. * @returns {Object3DNode} */ export const objectDirection = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.DIRECTION ); @@ -201,7 +201,7 @@ export const objectDirection = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNo * * @tsl * @function - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. * @returns {Object3DNode} */ export const objectWorldMatrix = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.WORLD_MATRIX ); @@ -211,7 +211,7 @@ export const objectWorldMatrix = /*@__PURE__*/ nodeProxy( Object3DNode, Object3D * * @tsl * @function - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. * @returns {Object3DNode} */ export const objectPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.POSITION ); @@ -221,7 +221,7 @@ export const objectPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNod * * @tsl * @function - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. * @returns {Object3DNode} */ export const objectScale = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.SCALE ); @@ -231,7 +231,7 @@ export const objectScale = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.S * * @tsl * @function - * @param {Object3D?} [object3d=null] - The 3D object. + * @param {?Object3D} [object3d=null] - The 3D object. * @returns {Object3DNode} */ export const objectViewPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.VIEW_POSITION ); diff --git a/src/nodes/accessors/ReferenceBaseNode.js b/src/nodes/accessors/ReferenceBaseNode.js index 4b08dac7db2d27..2193c33f9afd98 100644 --- a/src/nodes/accessors/ReferenceBaseNode.js +++ b/src/nodes/accessors/ReferenceBaseNode.js @@ -24,7 +24,7 @@ class ReferenceElementNode extends ArrayElementNode { /** * Constructs a new reference element node. * - * @param {ReferenceBaseNode?} referenceNode - The reference node. + * @param {?ReferenceBaseNode} referenceNode - The reference node. * @param {Node} indexNode - The index node that defines the element access. */ constructor( referenceNode, indexNode ) { @@ -35,7 +35,7 @@ class ReferenceElementNode extends ArrayElementNode { * Similar to {@link ReferenceBaseNode#reference}, an additional * property references to the current node. * - * @type {ReferenceBaseNode?} + * @type {?ReferenceBaseNode} * @default null */ this.referenceNode = referenceNode; @@ -96,8 +96,8 @@ class ReferenceBaseNode extends Node { * * @param {string} property - The name of the property the node refers to. * @param {string} uniformType - The uniform type that should be used to represent the property value. - * @param {Object?} [object=null] - The object the property belongs to. - * @param {number?} [count=null] - When the linked property is an array-like, this parameter defines its length. + * @param {?Object} [object=null] - The object the property belongs to. + * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. */ constructor( property, uniformType, object = null, count = null ) { @@ -120,7 +120,7 @@ class ReferenceBaseNode extends Node { /** * The object the property belongs to. * - * @type {Object?} + * @type {?Object} * @default null */ this.object = object; @@ -128,7 +128,7 @@ class ReferenceBaseNode extends Node { /** * When the linked property is an array, this parameter defines its length. * - * @type {number?} + * @type {?number} * @default null */ this.count = count; @@ -145,7 +145,7 @@ class ReferenceBaseNode extends Node { * Points to the current referred object. This property exists next to {@link ReferenceNode#object} * since the final reference might be updated from calling code. * - * @type {Object?} + * @type {?Object} * @default null */ this.reference = object; diff --git a/src/nodes/accessors/ReferenceNode.js b/src/nodes/accessors/ReferenceNode.js index 616126cc345c27..7bb203f167e9b3 100644 --- a/src/nodes/accessors/ReferenceNode.js +++ b/src/nodes/accessors/ReferenceNode.js @@ -28,7 +28,7 @@ class ReferenceElementNode extends ArrayElementNode { /** * Constructs a new reference element node. * - * @param {ReferenceNode?} referenceNode - The reference node. + * @param {?ReferenceNode} referenceNode - The reference node. * @param {Node} indexNode - The index node that defines the element access. */ constructor( referenceNode, indexNode ) { @@ -39,7 +39,7 @@ class ReferenceElementNode extends ArrayElementNode { * Similar to {@link ReferenceNode#reference}, an additional * property references to the current node. * - * @type {ReferenceNode?} + * @type {?ReferenceNode} * @default null */ this.referenceNode = referenceNode; @@ -100,8 +100,8 @@ class ReferenceNode extends Node { * * @param {string} property - The name of the property the node refers to. * @param {string} uniformType - The uniform type that should be used to represent the property value. - * @param {Object?} [object=null] - The object the property belongs to. - * @param {number?} [count=null] - When the linked property is an array-like, this parameter defines its length. + * @param {?Object} [object=null] - The object the property belongs to. + * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. */ constructor( property, uniformType, object = null, count = null ) { @@ -124,7 +124,7 @@ class ReferenceNode extends Node { /** * The object the property belongs to. * - * @type {Object?} + * @type {?Object} * @default null */ this.object = object; @@ -132,7 +132,7 @@ class ReferenceNode extends Node { /** * When the linked property is an array, this parameter defines its length. * - * @type {number?} + * @type {?number} * @default null */ this.count = count; @@ -149,7 +149,7 @@ class ReferenceNode extends Node { * Points to the current referred object. This property exists next to {@link ReferenceNode#object} * since the final reference might be updated from calling code. * - * @type {Object?} + * @type {?Object} * @default null */ this.reference = object; @@ -173,7 +173,7 @@ class ReferenceNode extends Node { /** * An optional label of the internal uniform node. * - * @type {string?} + * @type {?string} * @default null */ this.name = null; diff --git a/src/nodes/accessors/RendererReferenceNode.js b/src/nodes/accessors/RendererReferenceNode.js index 8e951e8e42e6ed..e9be0e5151469d 100644 --- a/src/nodes/accessors/RendererReferenceNode.js +++ b/src/nodes/accessors/RendererReferenceNode.js @@ -26,7 +26,7 @@ class RendererReferenceNode extends ReferenceBaseNode { * * @param {string} property - The name of the property the node refers to. * @param {string} inputType - The uniform type that should be used to represent the property value. - * @param {Renderer?} [renderer=null] - The renderer the property belongs to. When no renderer is set, + * @param {?Renderer} [renderer=null] - The renderer the property belongs to. When no renderer is set, * the node refers to the renderer of the current state. */ constructor( property, inputType, renderer = null ) { @@ -37,7 +37,7 @@ class RendererReferenceNode extends ReferenceBaseNode { * The renderer the property belongs to. When no renderer is set, * the node refers to the renderer of the current state. * - * @type {Renderer?} + * @type {?Renderer} * @default null */ this.renderer = renderer; @@ -72,7 +72,7 @@ export default RendererReferenceNode; * @function * @param {string} name - The name of the property the node refers to. * @param {string} type - The uniform type that should be used to represent the property value. - * @param {Renderer?} [renderer=null] - The renderer the property belongs to. When no renderer is set, + * @param {?Renderer} [renderer=null] - The renderer the property belongs to. When no renderer is set, * the node refers to the renderer of the current state. * @returns {RendererReferenceNode} */ diff --git a/src/nodes/accessors/SceneNode.js b/src/nodes/accessors/SceneNode.js index 4119acbb1bd51b..686420bcd073e1 100644 --- a/src/nodes/accessors/SceneNode.js +++ b/src/nodes/accessors/SceneNode.js @@ -31,7 +31,7 @@ class SceneNode extends Node { * Constructs a new scene node. * * @param {('backgroundBlurriness'|'backgroundIntensity'|'backgroundRotation')} scope - The scope defines the type of scene property that is accessed. - * @param {Scene?} [scene=null] - A reference to the scene. + * @param {?Scene} [scene=null] - A reference to the scene. */ constructor( scope = SceneNode.BACKGROUND_BLURRINESS, scene = null ) { @@ -47,7 +47,7 @@ class SceneNode extends Node { /** * A reference to the scene that is going to be accessed. * - * @type {Scene?} + * @type {?Scene} * @default null */ this.scene = scene; diff --git a/src/nodes/accessors/SkinningNode.js b/src/nodes/accessors/SkinningNode.js index 1900c1f8f37662..155629cdfdde92 100644 --- a/src/nodes/accessors/SkinningNode.js +++ b/src/nodes/accessors/SkinningNode.js @@ -116,7 +116,7 @@ class SkinningNode extends Node { * The previous bind matrices as a uniform buffer node. * Required for computing motion vectors. * - * @type {Node?} + * @type {?Node} * @default null */ this.previousBoneMatricesNode = null; diff --git a/src/nodes/accessors/StorageBufferNode.js b/src/nodes/accessors/StorageBufferNode.js index f7f42bb86e62f9..c172971275d97c 100644 --- a/src/nodes/accessors/StorageBufferNode.js +++ b/src/nodes/accessors/StorageBufferNode.js @@ -48,7 +48,7 @@ class StorageBufferNode extends BufferNode { * Constructs a new storage buffer node. * * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. - * @param {(string|Struct)?} [bufferType=null] - The buffer type (e.g. `'vec3'`). + * @param {?(string|Struct)} [bufferType=null] - The buffer type (e.g. `'vec3'`). * @param {number} [bufferCount=0] - The buffer count. */ constructor( value, bufferType = null, bufferCount = 0 ) { @@ -86,7 +86,7 @@ class StorageBufferNode extends BufferNode { /** * The buffer struct type. * - * @type {structTypeNode?} + * @type {?structTypeNode} * @default null */ this.structTypeNode = structTypeNode; @@ -119,7 +119,7 @@ class StorageBufferNode extends BufferNode { /** * A reference to the internal buffer attribute node. * - * @type {BufferAttributeNode?} + * @type {?BufferAttributeNode} * @default null */ this._attribute = null; @@ -127,7 +127,7 @@ class StorageBufferNode extends BufferNode { /** * A reference to the internal varying node. * - * @type {VaryingNode?} + * @type {?VaryingNode} * @default null */ this._varying = null; @@ -365,7 +365,7 @@ export default StorageBufferNode; * @tsl * @function * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. - * @param {(string|Struct)?} [type=null] - The buffer type (e.g. `'vec3'`). + * @param {?(string|Struct)} [type=null] - The buffer type (e.g. `'vec3'`). * @param {number} [count=0] - The buffer count. * @returns {StorageBufferNode} */ @@ -377,7 +377,7 @@ export const storage = ( value, type = null, count = 0 ) => nodeObject( new Stor * @deprecated since r171. Use `storage().setPBO( true )` instead. * * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. - * @param {string?} type - The buffer type (e.g. `'vec3'`). + * @param {?string} type - The buffer type (e.g. `'vec3'`). * @param {number} count - The buffer count. * @returns {StorageBufferNode} */ diff --git a/src/nodes/accessors/StorageTextureNode.js b/src/nodes/accessors/StorageTextureNode.js index 287e6cd9ab11eb..972527100f26b6 100644 --- a/src/nodes/accessors/StorageTextureNode.js +++ b/src/nodes/accessors/StorageTextureNode.js @@ -46,7 +46,7 @@ class StorageTextureNode extends TextureNode { * * @param {StorageTexture} value - The storage texture. * @param {Node} uvNode - The uv node. - * @param {Node?} [storeNode=null] - The value node that should be stored in the texture. + * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. */ constructor( value, uvNode, storeNode = null ) { @@ -55,7 +55,7 @@ class StorageTextureNode extends TextureNode { /** * The value node that should be stored in the texture. * - * @type {Node?} + * @type {?Node} * @default null */ this.storeNode = storeNode; @@ -204,7 +204,7 @@ export default StorageTextureNode; * @function * @param {StorageTexture} value - The storage texture. * @param {Node} uvNode - The uv node. - * @param {Node?} [storeNode=null] - The value node that should be stored in the texture. + * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. * @returns {StorageTextureNode} */ export const storageTexture = /*@__PURE__*/ nodeProxy( StorageTextureNode ); @@ -217,7 +217,7 @@ export const storageTexture = /*@__PURE__*/ nodeProxy( StorageTextureNode ); * @function * @param {StorageTexture} value - The storage texture. * @param {Node} uvNode - The uv node. - * @param {Node?} [storeNode=null] - The value node that should be stored in the texture. + * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. * @returns {StorageTextureNode} */ export const textureStore = ( value, uvNode, storeNode ) => { diff --git a/src/nodes/accessors/Texture3DNode.js b/src/nodes/accessors/Texture3DNode.js index 9da439cd02a730..f042b2bbe92364 100644 --- a/src/nodes/accessors/Texture3DNode.js +++ b/src/nodes/accessors/Texture3DNode.js @@ -65,8 +65,8 @@ class Texture3DNode extends TextureNode { * Constructs a new 3D texture node. * * @param {Data3DTexture} value - The 3D texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. */ constructor( value, uvNode = null, levelNode = null ) { @@ -179,8 +179,8 @@ export default Texture3DNode; * @tsl * @function * @param {Data3DTexture} value - The 3D texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. * @returns {Texture3DNode} */ export const texture3D = /*@__PURE__*/ nodeProxy( Texture3DNode ); diff --git a/src/nodes/accessors/TextureNode.js b/src/nodes/accessors/TextureNode.js index a333df9b5b1b3d..3a6884767d3819 100644 --- a/src/nodes/accessors/TextureNode.js +++ b/src/nodes/accessors/TextureNode.js @@ -26,9 +26,9 @@ class TextureNode extends UniformNode { * Constructs a new texture node. * * @param {Texture} value - The texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. - * @param {Node?} [biasNode=null] - The bias node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. */ constructor( value, uvNode = null, levelNode = null, biasNode = null ) { @@ -46,7 +46,7 @@ class TextureNode extends UniformNode { /** * Represents the texture coordinates. * - * @type {Node?} + * @type {?Node} * @default null */ this.uvNode = uvNode; @@ -54,7 +54,7 @@ class TextureNode extends UniformNode { /** * Represents the mip level that should be selected. * - * @type {Node?} + * @type {?Node} * @default null */ this.levelNode = levelNode; @@ -62,7 +62,7 @@ class TextureNode extends UniformNode { /** * Represents the bias to be applied during level-of-detail computation. * - * @type {Node?} + * @type {?Node} * @default null */ this.biasNode = biasNode; @@ -70,7 +70,7 @@ class TextureNode extends UniformNode { /** * Represents a reference value a texture sample is compared to. * - * @type {Node?} + * @type {?Node} * @default null */ this.compareNode = null; @@ -78,7 +78,7 @@ class TextureNode extends UniformNode { /** * When using texture arrays, the depth node defines the layer to select. * - * @type {Node?} + * @type {?Node} * @default null */ this.depthNode = null; @@ -86,7 +86,7 @@ class TextureNode extends UniformNode { /** * When defined, a texture is sampled using explicit gradients. * - * @type {Array>?} + * @type {?Array>} * @default null */ this.gradNode = null; @@ -122,7 +122,7 @@ class TextureNode extends UniformNode { /** * The reference node. * - * @type {Node?} + * @type {?Node} * @default null */ this.referenceNode = null; @@ -139,7 +139,7 @@ class TextureNode extends UniformNode { * The uniform node that represents the uv transformation matrix. * * @private - * @type {UniformNode?} + * @type {?UniformNode} */ this._matrixUniform = null; @@ -382,11 +382,11 @@ class TextureNode extends UniformNode { * @param {NodeBuilder} builder - The current node builder. * @param {string} textureProperty - The texture property. * @param {string} uvSnippet - The uv snippet. - * @param {string?} levelSnippet - The level snippet. - * @param {string?} biasSnippet - The bias snippet. - * @param {string?} depthSnippet - The depth snippet. - * @param {string?} compareSnippet - The compare snippet. - * @param {Array?} gradSnippet - The grad snippet. + * @param {?string} levelSnippet - The level snippet. + * @param {?string} biasSnippet - The bias snippet. + * @param {?string} depthSnippet - The depth snippet. + * @param {?string} compareSnippet - The compare snippet. + * @param {?Array} gradSnippet - The grad snippet. * @return {string} The generated code snippet. */ generateSnippet( builder, textureProperty, uvSnippet, levelSnippet, biasSnippet, depthSnippet, compareSnippet, gradSnippet ) { @@ -725,9 +725,9 @@ export default TextureNode; * @tsl * @function * @param {Texture} value - The texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. - * @param {Node?} [biasNode=null] - The bias node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. * @returns {TextureNode} */ export const texture = /*@__PURE__*/ nodeProxy( TextureNode ); @@ -738,9 +738,9 @@ export const texture = /*@__PURE__*/ nodeProxy( TextureNode ); * @tsl * @function * @param {Texture} value - The texture. - * @param {Node?} [uvNode=null] - The uv node. - * @param {Node?} [levelNode=null] - The level node. - * @param {Node?} [biasNode=null] - The bias node. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. * @returns {TextureNode} */ export const textureLoad = ( ...params ) => texture( ...params ).setSampler( false ); diff --git a/src/nodes/accessors/TextureSizeNode.js b/src/nodes/accessors/TextureSizeNode.js index b01f75f8cc347c..1fa6af63327d83 100644 --- a/src/nodes/accessors/TextureSizeNode.js +++ b/src/nodes/accessors/TextureSizeNode.js @@ -20,7 +20,7 @@ class TextureSizeNode extends Node { * Constructs a new texture size node. * * @param {TextureNode} textureNode - A texture node which size should be retrieved. - * @param {Node?} [levelNode=null] - A level node which defines the requested mip. + * @param {?Node} [levelNode=null] - A level node which defines the requested mip. */ constructor( textureNode, levelNode = null ) { @@ -71,7 +71,7 @@ export default TextureSizeNode; * @tsl * @function * @param {TextureNode} textureNode - A texture node which size should be retrieved. - * @param {Node?} [levelNode=null] - A level node which defines the requested mip. + * @param {?Node} [levelNode=null] - A level node which defines the requested mip. * @returns {TextureSizeNode} */ export const textureSize = /*@__PURE__*/ nodeProxy( TextureSizeNode ); diff --git a/src/nodes/accessors/UniformArrayNode.js b/src/nodes/accessors/UniformArrayNode.js index d416ac619e71c7..e044c46bd8510f 100644 --- a/src/nodes/accessors/UniformArrayNode.js +++ b/src/nodes/accessors/UniformArrayNode.js @@ -79,7 +79,7 @@ class UniformArrayNode extends BufferNode { * Constructs a new uniform array node. * * @param {Array} value - Array holding the buffer data. - * @param {string?} [elementType=null] - The data type of a buffer element. + * @param {?string} [elementType=null] - The data type of a buffer element. */ constructor( value, elementType = null ) { @@ -342,7 +342,7 @@ export default UniformArrayNode; * @tsl * @function * @param {Array} values - Array-like data. - * @param {string?} nodeType - The data type of the array elements. + * @param {?string} nodeType - The data type of the array elements. * @returns {UniformArrayNode} */ export const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) ); diff --git a/src/nodes/accessors/UserDataNode.js b/src/nodes/accessors/UserDataNode.js index 8a8cc104cb1b0c..fd622ecdcbc883 100644 --- a/src/nodes/accessors/UserDataNode.js +++ b/src/nodes/accessors/UserDataNode.js @@ -28,7 +28,7 @@ class UserDataNode extends ReferenceNode { * * @param {string} property - The property name that should be referenced by the node. * @param {string} inputType - The node data type of the reference. - * @param {Object?} [userData=null] - 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=null] - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated. */ constructor( property, inputType, userData = null ) { @@ -38,7 +38,7 @@ class UserDataNode extends ReferenceNode { * A reference to the `userData` object. If not provided, the `userData` * property of the 3D object that uses the node material is evaluated. * - * @type {Object?} + * @type {?Object} * @default null */ this.userData = userData; @@ -71,7 +71,7 @@ export default UserDataNode; * @function * @param {string} name - The property name that should be referenced by the node. * @param {string} inputType - The node data type of the reference. - * @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} */ export const userData = ( name, inputType, userData ) => nodeObject( new UserDataNode( name, inputType, userData ) ); diff --git a/src/nodes/accessors/VelocityNode.js b/src/nodes/accessors/VelocityNode.js index a7abed7b68ef9b..4bf4b50b2be91b 100644 --- a/src/nodes/accessors/VelocityNode.js +++ b/src/nodes/accessors/VelocityNode.js @@ -39,7 +39,7 @@ class VelocityNode extends TempNode { /** * The current projection matrix. * - * @type {Matrix4?} + * @type {?Matrix4} * @default null */ this.projectionMatrix = null; diff --git a/src/nodes/code/FunctionCallNode.js b/src/nodes/code/FunctionCallNode.js index 5da9174e20750c..f73f217af6370c 100644 --- a/src/nodes/code/FunctionCallNode.js +++ b/src/nodes/code/FunctionCallNode.js @@ -19,7 +19,7 @@ class FunctionCallNode extends TempNode { /** * Constructs a new function call node. * - * @param {FunctionNode?} functionNode - The function node. + * @param {?FunctionNode} functionNode - The function node. * @param {Object} [parameters={}] - The parameters for the function call. */ constructor( functionNode = null, parameters = {} ) { @@ -29,7 +29,7 @@ class FunctionCallNode extends TempNode { /** * The function node. * - * @type {FunctionNode} + * @type {?FunctionNode} * @default null */ this.functionNode = functionNode; diff --git a/src/nodes/code/ScriptableNode.js b/src/nodes/code/ScriptableNode.js index fdff5973ad957a..d4b73359472324 100644 --- a/src/nodes/code/ScriptableNode.js +++ b/src/nodes/code/ScriptableNode.js @@ -117,7 +117,7 @@ class ScriptableNode extends Node { /** * Constructs a new scriptable node. * - * @param {CodeNode?} [codeNode=null] - The code node. + * @param {?CodeNode} [codeNode=null] - The code node. * @param {Object} [parameters={}] - The parameters definition. */ constructor( codeNode = null, parameters = {} ) { @@ -127,7 +127,7 @@ class ScriptableNode extends Node { /** * The code node. * - * @type {CodeNode?} + * @type {?CodeNode} * @default null */ this.codeNode = codeNode; @@ -444,7 +444,7 @@ class ScriptableNode extends Node { /** * Refreshes the script node. * - * @param {string?} [output=null] - An optional output. + * @param {?string} [output=null] - An optional output. */ refresh( output = null ) { @@ -719,7 +719,7 @@ export default ScriptableNode; * * @tsl * @function - * @param {CodeNode?} [codeNode=null] - The code node. + * @param {?CodeNode} [codeNode=null] - The code node. * @param {Object} [parameters={}] - The parameters definition. * @returns {ScriptableNode} */ diff --git a/src/nodes/code/ScriptableValueNode.js b/src/nodes/code/ScriptableValueNode.js index 93230ba3fb9f65..aa68c0fb64a8a3 100644 --- a/src/nodes/code/ScriptableValueNode.js +++ b/src/nodes/code/ScriptableValueNode.js @@ -45,7 +45,7 @@ class ScriptableValueNode extends Node { /** * If this node represents an input, this property represents the input type. * - * @type {string?} + * @type {?string} * @default null */ this.inputType = null; @@ -53,7 +53,7 @@ class ScriptableValueNode extends Node { /** * If this node represents an output, this property represents the output type. * - * @type {string?} + * @type {?string} * @default null */ this.outputType = null; diff --git a/src/nodes/core/ArrayNode.js b/src/nodes/core/ArrayNode.js index c7b42f366c82f2..7e611cea007722 100644 --- a/src/nodes/core/ArrayNode.js +++ b/src/nodes/core/ArrayNode.js @@ -27,7 +27,7 @@ class ArrayNode extends TempNode { * * @param {string} [nodeType] - The data type of the elements. * @param {number} [count] - Size of the array. - * @param {Array?} [values=null] - Array default values. + * @param {?Array} [values=null] - Array default values. */ constructor( nodeType, count, values = null ) { @@ -36,14 +36,14 @@ class ArrayNode extends TempNode { /** * Array size. * - * @type {Array} + * @type {number} */ this.count = count; /** * Array default values. * - * @type {Array} + * @type {?Array} */ this.values = values; @@ -95,7 +95,7 @@ export default ArrayNode; * @function * @param {string|Array} nodeTypeOrValues - A string representing the element type (e.g., 'vec3') * or an array containing the default values (e.g., [ vec3() ]). - * @param {number?} [count] - Size of the array. + * @param {?number} [count] - Size of the array. * @returns {ArrayNode} */ export const array = ( ...params ) => { diff --git a/src/nodes/core/AttributeNode.js b/src/nodes/core/AttributeNode.js index 3d4ddaac3ef02a..46cd085913168b 100644 --- a/src/nodes/core/AttributeNode.js +++ b/src/nodes/core/AttributeNode.js @@ -18,7 +18,7 @@ class AttributeNode extends Node { * Constructs a new attribute node. * * @param {string} attributeName - The name of the attribute. - * @param {string?} nodeType - The node type. + * @param {?string} nodeType - The node type. */ constructor( attributeName, nodeType = null ) { @@ -161,7 +161,7 @@ export default AttributeNode; * @tsl * @function * @param {string} name - The name of the attribute. - * @param {string?} nodeType - The node type. + * @param {?string} nodeType - The node type. * @returns {AttributeNode} */ export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) ); diff --git a/src/nodes/core/ConstNode.js b/src/nodes/core/ConstNode.js index 6ff325c0005cca..299b8abf96fd26 100644 --- a/src/nodes/core/ConstNode.js +++ b/src/nodes/core/ConstNode.js @@ -19,7 +19,7 @@ class ConstNode extends InputNode { * Constructs a new input node. * * @param {any} value - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color). - * @param {string?} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. + * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. */ constructor( value, nodeType = null ) { diff --git a/src/nodes/core/InputNode.js b/src/nodes/core/InputNode.js index 337de50727f0eb..10165323d71bc8 100644 --- a/src/nodes/core/InputNode.js +++ b/src/nodes/core/InputNode.js @@ -18,7 +18,7 @@ class InputNode extends Node { * Constructs a new input node. * * @param {any} value - The value of this node. This can be a any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors). - * @param {string?} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. + * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. */ constructor( value, nodeType = null ) { @@ -43,7 +43,7 @@ class InputNode extends Node { /** * The precision of the value in the shader. * - * @type {('low'|'medium'|'high')?} + * @type {?('low'|'medium'|'high')} * @default null */ this.precision = null; diff --git a/src/nodes/core/Node.js b/src/nodes/core/Node.js index 67e5e149a42976..14f670a4adf617 100644 --- a/src/nodes/core/Node.js +++ b/src/nodes/core/Node.js @@ -22,7 +22,7 @@ class Node extends EventDispatcher { /** * Constructs a new node. * - * @param {string?} nodeType - The node type. + * @param {?string} nodeType - The node type. */ constructor( nodeType = null ) { @@ -31,7 +31,7 @@ class Node extends EventDispatcher { /** * The node type. This represents the result type of the node (e.g. `float` or `vec3`). * - * @type {string?} + * @type {?string} * @default null */ this.nodeType = nodeType; @@ -102,7 +102,7 @@ class Node extends EventDispatcher { * The cache key of this node. * * @private - * @type {number?} + * @type {?number} * @default null */ this._cacheKey = null; @@ -473,7 +473,7 @@ class Node extends EventDispatcher { * The output node must be returned in the `return` statement. * * @param {NodeBuilder} builder - The current node builder. - * @return {Node?} The output node. + * @return {?Node} The output node. */ setup( builder ) { @@ -528,8 +528,8 @@ class Node extends EventDispatcher { * This state builds the output node and returns the resulting shader string. * * @param {NodeBuilder} builder - The current node builder. - * @param {string?} output - Can be used to define the output type. - * @return {string?} The generated shader string. + * @param {?string} output - Can be used to define the output type. + * @return {?string} The generated shader string. */ generate( builder, output ) { @@ -549,7 +549,7 @@ class Node extends EventDispatcher { * * @abstract * @param {NodeFrame} frame - A reference to the current node frame. - * @return {boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). */ updateBefore( /*frame*/ ) { @@ -563,7 +563,7 @@ class Node extends EventDispatcher { * * @abstract * @param {NodeFrame} frame - A reference to the current node frame. - * @return {boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). */ updateAfter( /*frame*/ ) { @@ -577,7 +577,7 @@ class Node extends EventDispatcher { * * @abstract * @param {NodeFrame} frame - A reference to the current node frame. - * @return {boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). */ update( /*frame*/ ) { @@ -590,8 +590,8 @@ class Node extends EventDispatcher { * on the current build stage (setup, analyze or generate). * * @param {NodeBuilder} builder - The current node builder. - * @param {string?} output - Can be used to define the output type. - * @return {string?} When this method is executed in the setup or analyze stage, `null` is returned. In the generate stage, the generated shader string. + * @param {?string} output - Can be used to define the output type. + * @return {?string} When this method is executed in the setup or analyze stage, `null` is returned. In the generate stage, the generated shader string. */ build( builder, output = null ) { @@ -807,7 +807,7 @@ class Node extends EventDispatcher { /** * Serializes the node into the three.js JSON Object/Scene format. * - * @param {Object?} meta - An optional JSON object that already holds serialized data from other scene objects. + * @param {?Object} meta - An optional JSON object that already holds serialized data from other scene objects. * @return {Object} The serialized node. */ toJSON( meta ) { diff --git a/src/nodes/core/NodeAttribute.js b/src/nodes/core/NodeAttribute.js index 493a1cddb55074..444572990d21e4 100644 --- a/src/nodes/core/NodeAttribute.js +++ b/src/nodes/core/NodeAttribute.js @@ -11,7 +11,7 @@ class NodeAttribute { * * @param {string} name - The name of the attribute. * @param {string} type - The type of the attribute. - * @param {Node?} node - An optional reference to the node. + * @param {?Node} node - An optional reference to the node. */ constructor( name, type, node = null ) { @@ -41,7 +41,7 @@ class NodeAttribute { /** * An optional reference to the node. * - * @type {Node?} + * @type {?Node} * @default null */ this.node = node; diff --git a/src/nodes/core/NodeBuilder.js b/src/nodes/core/NodeBuilder.js index 1fd4186adf9a52..a6c513b10cf06c 100644 --- a/src/nodes/core/NodeBuilder.js +++ b/src/nodes/core/NodeBuilder.js @@ -87,14 +87,14 @@ class NodeBuilder { /** * The material of the 3D object. * - * @type {Material?} + * @type {?Material} */ this.material = ( object && object.material ) || null; /** * The geometry of the 3D object. * - * @type {BufferGeometry?} + * @type {?BufferGeometry} */ this.geometry = ( object && object.geometry ) || null; @@ -115,7 +115,7 @@ class NodeBuilder { /** * The scene the 3D object belongs to. * - * @type {Scene?} + * @type {?Scene} * @default null */ this.scene = null; @@ -123,7 +123,7 @@ class NodeBuilder { /** * The camera the 3D object is rendered with. * - * @type {Camera?} + * @type {?Camera} * @default null */ this.camera = null; @@ -174,7 +174,7 @@ class NodeBuilder { /** * A reference to a node material observer. * - * @type {NodeMaterialObserver?} + * @type {?NodeMaterialObserver} * @default null */ this.observer = null; @@ -182,7 +182,7 @@ class NodeBuilder { /** * A reference to the current lights node. * - * @type {LightsNode?} + * @type {?LightsNode} * @default null */ this.lightsNode = null; @@ -190,7 +190,7 @@ class NodeBuilder { /** * A reference to the current environment node. * - * @type {Node?} + * @type {?Node} * @default null */ this.environmentNode = null; @@ -198,7 +198,7 @@ class NodeBuilder { /** * A reference to the current fog node. * - * @type {FogNode?} + * @type {?FogNode} * @default null */ this.fogNode = null; @@ -206,28 +206,28 @@ class NodeBuilder { /** * The current clipping context. * - * @type {ClippingContext?} + * @type {?ClippingContext} */ this.clippingContext = null; /** * The generated vertex shader. * - * @type {string?} + * @type {?string} */ this.vertexShader = null; /** * The generated fragment shader. * - * @type {string?} + * @type {?string} */ this.fragmentShader = null; /** * The generated compute shader. * - * @type {string?} + * @type {?string} */ this.computeShader = null; @@ -278,7 +278,7 @@ class NodeBuilder { /** * Reference to the array of bind groups. * - * @type {Array?} + * @type {?Array} */ this.bindGroups = null; @@ -365,7 +365,7 @@ class NodeBuilder { /** * Reference to the current function node. * - * @type {FunctionNode?} + * @type {?FunctionNode} * @default null */ this.currentFunctionNode = null; @@ -401,14 +401,14 @@ class NodeBuilder { /** * The current shader stage. * - * @type {('vertex'|'fragment'|'compute'|'any')?} + * @type {?('vertex'|'fragment'|'compute'|'any')} */ this.shaderStage = null; /** * The current build stage. * - * @type {('setup'|'analyze'|'generate')?} + * @type {?('setup'|'analyze'|'generate')} */ this.buildStage = null; @@ -1043,7 +1043,7 @@ class NodeBuilder { * @param {Texture} texture - The texture. * @param {string} textureProperty - The texture property name. * @param {string} uvSnippet - Snippet defining the texture coordinates. - * @param {string?} depthSnippet - Snippet defining the 0-based texture array index to sample. + * @param {?string} depthSnippet - Snippet defining the 0-based texture array index to sample. * @param {string} levelSnippet - Snippet defining the mip level. * @return {string} The generated shader string. */ @@ -1057,7 +1057,7 @@ class NodeBuilder { * Generates the array declaration string. * * @param {string} type - The type. - * @param {number?} [count] - The count. + * @param {?number} [count] - The count. * @return {string} The generated value as a shader string. */ generateArrayDeclaration( type, count ) { @@ -1070,8 +1070,8 @@ class NodeBuilder { * Generates the array shader string for the given type and value. * * @param {string} type - The type. - * @param {number?} [count] - The count. - * @param {Array?} [values=null] - The default values. + * @param {?number} [count] - The count. + * @param {?Array} [values=null] - The default values. * @return {string} The generated value as a shader string. */ generateArray( type, count, values = null ) { @@ -1107,7 +1107,7 @@ class NodeBuilder { * * @param {string} type - The type. * @param {Array} [membersLayout] - The count. - * @param {Array?} [values=null] - The default values. + * @param {?Array} [values=null] - The default values. * @return {string} The generated value as a shader string. */ generateStruct( type, membersLayout, values = null ) { @@ -1139,7 +1139,7 @@ class NodeBuilder { * Generates the shader string for the given type and value. * * @param {string} type - The type. - * @param {any?} [value=null] - The value. + * @param {?any} [value=null] - The value. * @return {string} The generated value as a shader string. */ generateConst( type, value = null ) { @@ -1558,7 +1558,7 @@ class NodeBuilder { * * @param {Node} node - The node to get the data for. * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @param {NodeCache?} cache - An optional cache. + * @param {?NodeCache} cache - An optional cache. * @return {Object} The node data. */ getDataFromNode( node, shaderStage = this.shaderStage, cache = null ) { @@ -1630,7 +1630,7 @@ class NodeBuilder { * * @param {OutputStructNode} node - The output struct node. * @param {Array} membersLayout - The output struct types. - * @param {string?} [name=null] - The name of the struct. + * @param {?string} [name=null] - The name of the struct. * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. * @return {StructType} The struct type attribute. */ @@ -1680,7 +1680,7 @@ class NodeBuilder { * @param {UniformNode} node - The uniform node. * @param {string} type - The uniform type. * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @param {string?} name - The name of the uniform. + * @param {?string} name - The name of the uniform. * @return {NodeUniform} The node uniform. */ getUniformFromNode( node, type, shaderStage = this.shaderStage, name = null ) { @@ -1709,7 +1709,7 @@ class NodeBuilder { * Returns the array length. * * @param {Node} node - The node. - * @return {number?} The array length. + * @return {?number} The array length. */ getArrayCount( node ) { @@ -1726,7 +1726,7 @@ class NodeBuilder { * Returns an instance of {@link NodeVar} for the given variable node. * * @param {VarNode} node - The variable node. - * @param {string?} name - The variable's name. + * @param {?string} name - The variable's name. * @param {string} [type=node.getNodeType( this )] - The variable's type. * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. * @param {boolean} [readOnly=false] - Whether the variable is read-only or not. @@ -1825,7 +1825,7 @@ class NodeBuilder { * Returns an instance of {@link NodeVarying} for the given varying node. * * @param {(VaryingNode|PropertyNode)} node - The varying node. - * @param {string?} name - The varying's name. + * @param {?string} name - The varying's name. * @param {string} [type=node.getNodeType( this )] - The varying's type. * @return {NodeVar} The node varying. */ @@ -1948,7 +1948,7 @@ class NodeBuilder { * Add a inline-code to the current flow. * * @param {string} code - The code to add. - * @param {Node?} [node= null] - Optional Node, can help the system understand if the Node is part of a code-block. + * @param {?Node} [node= null] - Optional Node, can help the system understand if the Node is part of a code-block. * @return {NodeBuilder} A reference to this node builder. */ addLineFlowCode( code, node = null ) { @@ -2134,7 +2134,7 @@ class NodeBuilder { * Runs the node flow through all the steps of creation, 'setup', 'analyze', 'generate'. * * @param {Node} node - The node to execute. - * @param {string?} output - Expected output type. For example 'vec3'. + * @param {?string} output - Expected output type. For example 'vec3'. * @return {Object} */ flowStagesNode( node, output = null ) { @@ -2193,7 +2193,7 @@ class NodeBuilder { * Generates a code flow based on a child Node. * * @param {Node} node - The node to execute. - * @param {string?} output - Expected output type. For example 'vec3'. + * @param {?string} output - Expected output type. For example 'vec3'. * @return {Object} The code flow. */ flowChildNode( node, output = null ) { @@ -2222,8 +2222,8 @@ class NodeBuilder { * * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. * @param {Node} node - The node to execute. - * @param {string?} output - Expected output type. For example 'vec3'. - * @param {string?} propertyName - The property name to assign the result. + * @param {?string} output - Expected output type. For example 'vec3'. + * @param {?string} propertyName - The property name to assign the result. * @return {Object} */ flowNodeFromShaderStage( shaderStage, node, output = null, propertyName = null ) { @@ -2290,7 +2290,7 @@ class NodeBuilder { * * @param {string} type - The variable's type. * @param {string} name - The variable's name. - * @param {number?} [count=null] - The array length. + * @param {?number} [count=null] - The array length. * @return {string} The shader string. */ getVar( type, name, count = null ) { @@ -2378,7 +2378,7 @@ class NodeBuilder { /** * Sets the current shader stage. * - * @param {('vertex'|'fragment'|'compute'|'any')?} shaderStage - The shader stage to set. + * @param {?('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage to set. */ setShaderStage( shaderStage ) { @@ -2389,7 +2389,7 @@ class NodeBuilder { /** * Returns the current shader stage. * - * @return {('vertex'|'fragment'|'compute'|'any')?} The current shader stage. + * @return {?('vertex'|'fragment'|'compute'|'any')} The current shader stage. */ getShaderStage() { @@ -2400,7 +2400,7 @@ class NodeBuilder { /** * Sets the current build stage. * - * @param {('setup'|'analyze'|'generate')?} buildStage - The build stage to set. + * @param {?('setup'|'analyze'|'generate')} buildStage - The build stage to set. */ setBuildStage( buildStage ) { @@ -2411,7 +2411,7 @@ class NodeBuilder { /** * Returns the current build stage. * - * @return {('setup'|'analyze'|'generate')?} The current build stage. + * @return {?('setup'|'analyze'|'generate')} The current build stage. */ getBuildStage() { diff --git a/src/nodes/core/NodeCache.js b/src/nodes/core/NodeCache.js index 2fd904f537a290..dd43e39120b6c7 100644 --- a/src/nodes/core/NodeCache.js +++ b/src/nodes/core/NodeCache.js @@ -9,7 +9,7 @@ class NodeCache { /** * Constructs a new node cache. * - * @param {NodeCache?} parent - A reference to a parent cache. + * @param {?NodeCache} parent - A reference to a parent cache. */ constructor( parent = null ) { @@ -31,7 +31,7 @@ class NodeCache { /** * Reference to a parent node cache. * - * @type {NodeCache?} + * @type {?NodeCache} * @default null */ this.parent = parent; @@ -42,7 +42,7 @@ class NodeCache { * Returns the data for the given node. * * @param {Node} node - The node. - * @return {Object?} The data for the node. + * @return {?Object} The data for the node. */ getData( node ) { diff --git a/src/nodes/core/NodeFrame.js b/src/nodes/core/NodeFrame.js index 2d0202eba3540b..50a1b1addffacc 100644 --- a/src/nodes/core/NodeFrame.js +++ b/src/nodes/core/NodeFrame.js @@ -69,7 +69,7 @@ class NodeFrame { /** * A reference to the current renderer. * - * @type {Renderer?} + * @type {?Renderer} * @default null */ this.renderer = null; @@ -77,7 +77,7 @@ class NodeFrame { /** * A reference to the current material. * - * @type {Material?} + * @type {?Material} * @default null */ this.material = null; @@ -85,7 +85,7 @@ class NodeFrame { /** * A reference to the current camera. * - * @type {Camera?} + * @type {?Camera} * @default null */ this.camera = null; @@ -93,7 +93,7 @@ class NodeFrame { /** * A reference to the current 3D object. * - * @type {Object3D?} + * @type {?Object3D} * @default null */ this.object = null; @@ -101,7 +101,7 @@ class NodeFrame { /** * A reference to the current scene. * - * @type {Scene?} + * @type {?Scene} * @default null */ this.scene = null; diff --git a/src/nodes/core/NodeFunctionInput.js b/src/nodes/core/NodeFunctionInput.js index 276e097f3f324c..2d298f382976e5 100644 --- a/src/nodes/core/NodeFunctionInput.js +++ b/src/nodes/core/NodeFunctionInput.js @@ -8,7 +8,7 @@ class NodeFunctionInput { * * @param {string} type - The input type. * @param {string} name - The input name. - * @param {number?} [count=null] - If the input is an Array, count will be the length. + * @param {?number} [count=null] - If the input is an Array, count will be the length. * @param {('in'|'out'|'inout')} [qualifier=''] - The parameter qualifier (only relevant for GLSL). * @param {boolean} [isConst=false] - Whether the input uses a const qualifier or not (only relevant for GLSL). */ @@ -31,7 +31,7 @@ class NodeFunctionInput { /** * If the input is an Array, count will be the length. * - * @type {number?} + * @type {?number} * @default null */ this.count = count; diff --git a/src/nodes/core/NodeUtils.js b/src/nodes/core/NodeUtils.js index f7c4bc2685bbe5..d683391ef8259c 100644 --- a/src/nodes/core/NodeUtils.js +++ b/src/nodes/core/NodeUtils.js @@ -241,7 +241,7 @@ export function getLengthFromType( type ) { * * @method * @param {any} value - The value. - * @return {string?} The data type. + * @return {?string} The data type. */ export function getValueType( value ) { diff --git a/src/nodes/core/NodeVar.js b/src/nodes/core/NodeVar.js index e173fc7eaf0f7c..d313d7a8c67cd2 100644 --- a/src/nodes/core/NodeVar.js +++ b/src/nodes/core/NodeVar.js @@ -12,7 +12,7 @@ class NodeVar { * @param {string} name - The name of the variable. * @param {string} type - The type of the variable. * @param {boolean} [readOnly=false] - The read-only flag. - * @param {number?} [count=null] - The size. + * @param {?number} [count=null] - The size. */ constructor( name, type, readOnly = false, count = null ) { @@ -49,7 +49,7 @@ class NodeVar { /** * The size. * - * @type {number?} + * @type {?number} */ this.count = count; diff --git a/src/nodes/core/ParameterNode.js b/src/nodes/core/ParameterNode.js index 5acdcd2037e229..bdc6353f0c5be5 100644 --- a/src/nodes/core/ParameterNode.js +++ b/src/nodes/core/ParameterNode.js @@ -18,7 +18,7 @@ class ParameterNode extends PropertyNode { * Constructs a new parameter node. * * @param {string} nodeType - The type of the node. - * @param {string?} [name=null] - The name of the parameter in the shader. + * @param {?string} [name=null] - The name of the parameter in the shader. */ constructor( nodeType, name = null ) { @@ -57,7 +57,7 @@ export default ParameterNode; * @tsl * @function * @param {string} type - The type of the node. - * @param {string?} name - The name of the parameter in the shader. + * @param {?string} name - The name of the parameter in the shader. * @returns {ParameterNode} */ export const parameter = ( type, name ) => nodeObject( new ParameterNode( type, name ) ); diff --git a/src/nodes/core/PropertyNode.js b/src/nodes/core/PropertyNode.js index e8fcd55bb8345c..68362a392b1509 100644 --- a/src/nodes/core/PropertyNode.js +++ b/src/nodes/core/PropertyNode.js @@ -25,7 +25,7 @@ class PropertyNode extends Node { * Constructs a new property node. * * @param {string} nodeType - The type of the 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. * @param {boolean} [varying=false] - Whether this property is a varying or not. */ constructor( nodeType, name = null, varying = false ) { @@ -36,7 +36,7 @@ class PropertyNode extends Node { * The name of the property in the shader. If no name is defined, * the node system auto-generates one. * - * @type {string?} + * @type {?string} * @default null */ this.name = name; @@ -107,7 +107,7 @@ export default PropertyNode; * @tsl * @function * @param {string} type - The type of the 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} */ export const property = ( type, name ) => nodeObject( new PropertyNode( type, name ) ); @@ -118,7 +118,7 @@ export const property = ( type, name ) => nodeObject( new PropertyNode( type, na * @tsl * @function * @param {string} type - The type of the node. - * @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} */ export const varyingProperty = ( type, name ) => nodeObject( new PropertyNode( type, name, true ) ); diff --git a/src/nodes/core/StackNode.js b/src/nodes/core/StackNode.js index afa7b6e31fac7f..8988bf965d0284 100644 --- a/src/nodes/core/StackNode.js +++ b/src/nodes/core/StackNode.js @@ -19,7 +19,7 @@ class StackNode extends Node { /** * Constructs a new stack node. * - * @param {StackNode?} [parent=null] - The parent stack node. + * @param {?StackNode} [parent=null] - The parent stack node. */ constructor( parent = null ) { @@ -35,7 +35,7 @@ class StackNode extends Node { /** * The output node. * - * @type {Node?} + * @type {?Node} * @default null */ this.outputNode = null; @@ -43,7 +43,7 @@ class StackNode extends Node { /** * The parent stack node. * - * @type {StackNode} + * @type {?StackNode} * @default null */ this.parent = parent; @@ -199,7 +199,7 @@ export default StackNode; * * @tsl * @function - * @param {StackNode?} [parent=null] - The parent stack node. + * @param {?StackNode} [parent=null] - The parent stack node. * @returns {StackNode} */ export const stack = /*@__PURE__*/ nodeProxy( StackNode ); diff --git a/src/nodes/core/TempNode.js b/src/nodes/core/TempNode.js index 01d441f2062b74..2d27f3c9de3f70 100644 --- a/src/nodes/core/TempNode.js +++ b/src/nodes/core/TempNode.js @@ -19,7 +19,7 @@ class TempNode extends Node { /** * Constructs a temp node. * - * @param {string?} nodeType - The node type. + * @param {?string} nodeType - The node type. */ constructor( nodeType = null ) { diff --git a/src/nodes/core/UniformNode.js b/src/nodes/core/UniformNode.js index 77e403fb4ecac8..89e9f77ac81b8e 100644 --- a/src/nodes/core/UniformNode.js +++ b/src/nodes/core/UniformNode.js @@ -19,7 +19,7 @@ class UniformNode extends InputNode { * Constructs a new uniform node. * * @param {any} value - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture). - * @param {string?} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. + * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. */ constructor( value, nodeType = null ) { @@ -162,7 +162,7 @@ export default UniformNode; * @tsl * @function * @param {any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture). - * @param {string?} arg2 - The node type. If no explicit type is defined, the node tries to derive the type from its value. + * @param {?string} arg2 - The node type. If no explicit type is defined, the node tries to derive the type from its value. * @returns {UniformNode} */ export const uniform = ( arg1, arg2 ) => { diff --git a/src/nodes/core/VarNode.js b/src/nodes/core/VarNode.js index 13d0bd41b0b3e6..1bf53f13f8d515 100644 --- a/src/nodes/core/VarNode.js +++ b/src/nodes/core/VarNode.js @@ -23,8 +23,8 @@ class VarNode extends Node { * Constructs a new variable node. * * @param {Node} node - The node for which a variable should be created. - * @param {string?} name - The name of the variable in the shader. - * @param {boolean?} readOnly - The read-only flag. + * @param {?string} name - The name of the variable in the shader. + * @param {?boolean} readOnly - The read-only flag. */ constructor( node, name = null, readOnly = false ) { @@ -41,7 +41,7 @@ class VarNode extends Node { * The name of the variable in the shader. If no name is defined, * the node system auto-generates one. * - * @type {string?} + * @type {?string} * @default null */ this.name = name; @@ -159,7 +159,7 @@ export default VarNode; * @tsl * @function * @param {Node} node - The node for which a variable should be created. - * @param {string?} name - The name of the variable in the shader. + * @param {?string} name - The name of the variable in the shader. * @returns {VarNode} */ const createVar = /*@__PURE__*/ nodeProxy( VarNode ); @@ -170,7 +170,7 @@ const createVar = /*@__PURE__*/ nodeProxy( VarNode ); * @tsl * @function * @param {Node} node - The node for which a variable should be created. - * @param {string?} name - The name of the variable in the shader. + * @param {?string} name - The name of the variable in the shader. * @returns {VarNode} */ export const Var = ( node, name = null ) => createVar( node, name ).append(); @@ -181,7 +181,7 @@ export const Var = ( node, name = null ) => createVar( node, name ).append(); * @tsl * @function * @param {Node} node - The node for which a constant should be created. - * @param {string?} name - The name of the constant in the shader. + * @param {?string} name - The name of the constant in the shader. * @returns {VarNode} */ export const Const = ( node, name = null ) => createVar( node, name, true ).append(); diff --git a/src/nodes/core/VaryingNode.js b/src/nodes/core/VaryingNode.js index c376f93b44bda8..9e4a05594720bf 100644 --- a/src/nodes/core/VaryingNode.js +++ b/src/nodes/core/VaryingNode.js @@ -24,7 +24,7 @@ class VaryingNode extends Node { * Constructs a new varying node. * * @param {Node} node - The node for which a varying should be created. - * @param {string?} name - The name of the varying in the shader. + * @param {?string} name - The name of the varying in the shader. */ constructor( node, name = null ) { @@ -41,7 +41,7 @@ class VaryingNode extends Node { * The name of the varying in the shader. If no name is defined, * the node system auto-generates one. * - * @type {string?} + * @type {?string} * @default null */ this.name = name; @@ -170,7 +170,7 @@ export default VaryingNode; * @tsl * @function * @param {Node} node - The node for which a varying should be created. - * @param {string?} name - The name of the varying in the shader. + * @param {?string} name - The name of the varying in the shader. * @returns {VaryingNode} */ export const varying = /*@__PURE__*/ nodeProxy( VaryingNode ); diff --git a/src/nodes/display/BumpMapNode.js b/src/nodes/display/BumpMapNode.js index 7f3e83feaa8819..a754376ab58055 100644 --- a/src/nodes/display/BumpMapNode.js +++ b/src/nodes/display/BumpMapNode.js @@ -65,7 +65,7 @@ class BumpMapNode extends TempNode { * Constructs a new bump map node. * * @param {Node} textureNode - Represents the bump map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect. + * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. */ constructor( textureNode, scaleNode = null ) { @@ -81,7 +81,7 @@ class BumpMapNode extends TempNode { /** * Controls the intensity of the bump effect. * - * @type {Node?} + * @type {?Node} * @default null */ this.scaleNode = scaleNode; @@ -111,7 +111,7 @@ export default BumpMapNode; * @tsl * @function * @param {Node} textureNode - Represents the bump map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect. + * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. * @returns {BumpMapNode} */ export const bumpMap = /*@__PURE__*/ nodeProxy( BumpMapNode ); diff --git a/src/nodes/display/ColorAdjustment.js b/src/nodes/display/ColorAdjustment.js index 204e95b850939a..0064232d5d368e 100644 --- a/src/nodes/display/ColorAdjustment.js +++ b/src/nodes/display/ColorAdjustment.js @@ -81,7 +81,7 @@ export const hue = /*@__PURE__*/ Fn( ( [ color, adjustment = float( 1 ) ] ) => { * @tsl * @function * @param {Node} color - The color value to compute the luminance for. - * @param {Node?} luminanceCoefficients - The luminance coefficients. By default predefined values of the current working color space are used. + * @param {?Node} luminanceCoefficients - The luminance coefficients. By default predefined values of the current working color space are used. * @return {Node} The luminance. */ export const luminance = ( diff --git a/src/nodes/display/NormalMapNode.js b/src/nodes/display/NormalMapNode.js index 5020645892dcde..3845bb4c3233f1 100644 --- a/src/nodes/display/NormalMapNode.js +++ b/src/nodes/display/NormalMapNode.js @@ -58,7 +58,7 @@ class NormalMapNode extends TempNode { * Constructs a new normal map node. * * @param {Node} node - Represents the normal map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the effect. + * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. */ constructor( node, scaleNode = null ) { @@ -74,7 +74,7 @@ class NormalMapNode extends TempNode { /** * Controls the intensity of the effect. * - * @type {Node?} + * @type {?Node} * @default null */ this.scaleNode = scaleNode; @@ -142,7 +142,7 @@ export default NormalMapNode; * @tsl * @function * @param {Node} node - Represents the normal map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the effect. + * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. * @returns {NormalMapNode} */ export const normalMap = /*@__PURE__*/ nodeProxy( NormalMapNode ); diff --git a/src/nodes/display/PassNode.js b/src/nodes/display/PassNode.js index 82cb03e4330a50..8ebc7ce9f95f11 100644 --- a/src/nodes/display/PassNode.js +++ b/src/nodes/display/PassNode.js @@ -309,7 +309,7 @@ class PassNode extends TempNode { * A MRT node configuring the MRT settings. * * @private - * @type {MRTNode?} + * @type {?MRTNode} * @default null */ this._mrt = null; diff --git a/src/nodes/display/RenderOutputNode.js b/src/nodes/display/RenderOutputNode.js index 01dc44cffd344b..de118f8faa8e3e 100644 --- a/src/nodes/display/RenderOutputNode.js +++ b/src/nodes/display/RenderOutputNode.js @@ -56,14 +56,14 @@ class RenderOutputNode extends TempNode { /** * The tone mapping type. * - * @type {number?} + * @type {?number} */ this.toneMapping = toneMapping; /** * The output color space. * - * @type {string?} + * @type {?string} */ this.outputColorSpace = outputColorSpace; @@ -115,8 +115,8 @@ export default RenderOutputNode; * @tsl * @function * @param {Node} color - The color node to process. - * @param {number?} [toneMapping=null] - The tone mapping type. - * @param {string?} [outputColorSpace=null] - The output color space. + * @param {?number} [toneMapping=null] - The tone mapping type. + * @param {?string} [outputColorSpace=null] - The output color space. * @returns {RenderOutputNode} */ export const renderOutput = ( color, toneMapping = null, outputColorSpace = null ) => nodeObject( new RenderOutputNode( nodeObject( color ), toneMapping, outputColorSpace ) ); diff --git a/src/nodes/display/ToneMappingNode.js b/src/nodes/display/ToneMappingNode.js index ed55f8582001ef..952c9c55a5ad73 100644 --- a/src/nodes/display/ToneMappingNode.js +++ b/src/nodes/display/ToneMappingNode.js @@ -47,7 +47,7 @@ class ToneMappingNode extends TempNode { /** * Represents the color to process. * - * @type {Node?} + * @type {?Node} * @default null */ this.colorNode = colorNode; diff --git a/src/nodes/display/ViewportDepthNode.js b/src/nodes/display/ViewportDepthNode.js index 94f5e80250f9f6..b8c4e8a8293307 100644 --- a/src/nodes/display/ViewportDepthNode.js +++ b/src/nodes/display/ViewportDepthNode.js @@ -23,7 +23,7 @@ class ViewportDepthNode extends Node { * Constructs a new viewport depth node. * * @param {('depth'|'depthBase'|'linearDepth')} scope - The node's scope. - * @param {Node?} [valueNode=null] - The value node. + * @param {?Node} [valueNode=null] - The value node. */ constructor( scope, valueNode = null ) { @@ -45,7 +45,7 @@ class ViewportDepthNode extends Node { * Can be used to define a custom depth value. * The property is ignored in the `ViewportDepthNode.DEPTH` scope. * - * @type {Node?} + * @type {?Node} * @default null */ this.valueNode = valueNode; diff --git a/src/nodes/display/ViewportDepthTextureNode.js b/src/nodes/display/ViewportDepthTextureNode.js index f64ae1eb62bf05..c21e7b8065b6dd 100644 --- a/src/nodes/display/ViewportDepthTextureNode.js +++ b/src/nodes/display/ViewportDepthTextureNode.js @@ -25,7 +25,7 @@ class ViewportDepthTextureNode extends ViewportTextureNode { * Constructs a new viewport depth texture node. * * @param {Node} [uvNode=screenUV] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [levelNode=null] - The level node. */ constructor( uvNode = screenUV, levelNode = null ) { @@ -49,7 +49,7 @@ export default ViewportDepthTextureNode; * @tsl * @function * @param {Node} [uvNode=screenUV] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [levelNode=null] - The level node. * @returns {ViewportDepthTextureNode} */ export const viewportDepthTexture = /*@__PURE__*/ nodeProxy( ViewportDepthTextureNode ); diff --git a/src/nodes/display/ViewportSharedTextureNode.js b/src/nodes/display/ViewportSharedTextureNode.js index b1e7b9ceac1030..c9e6033850c632 100644 --- a/src/nodes/display/ViewportSharedTextureNode.js +++ b/src/nodes/display/ViewportSharedTextureNode.js @@ -25,7 +25,7 @@ class ViewportSharedTextureNode extends ViewportTextureNode { * Constructs a new viewport shared texture node. * * @param {Node} [uvNode=screenUV] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [levelNode=null] - The level node. */ constructor( uvNode = screenUV, levelNode = null ) { @@ -55,7 +55,7 @@ export default ViewportSharedTextureNode; * @tsl * @function * @param {Node} [uvNode=screenUV] - The uv node. - * @param {Node?} [levelNode=null] - The level node. + * @param {?Node} [levelNode=null] - The level node. * @returns {ViewportSharedTextureNode} */ export const viewportSharedTexture = /*@__PURE__*/ nodeProxy( ViewportSharedTextureNode ); diff --git a/src/nodes/display/ViewportTextureNode.js b/src/nodes/display/ViewportTextureNode.js index 1c40eef588f0de..288454df3eb91c 100644 --- a/src/nodes/display/ViewportTextureNode.js +++ b/src/nodes/display/ViewportTextureNode.js @@ -30,8 +30,8 @@ class ViewportTextureNode extends TextureNode { * Constructs a new viewport texture node. * * @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. + * @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. */ constructor( uvNode = screenUV, levelNode = null, framebufferTexture = null ) { @@ -119,8 +119,8 @@ export default ViewportTextureNode; * @tsl * @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. + * @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 ); @@ -131,8 +131,8 @@ export const viewportTexture = /*@__PURE__*/ nodeProxy( ViewportTextureNode ); * @tsl * @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. + * @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 } ); diff --git a/src/nodes/functions/PhysicalLightingModel.js b/src/nodes/functions/PhysicalLightingModel.js index 1cf62857cf2466..59bd60e1e5a143 100644 --- a/src/nodes/functions/PhysicalLightingModel.js +++ b/src/nodes/functions/PhysicalLightingModel.js @@ -414,7 +414,7 @@ class PhysicalLightingModel extends LightingModel { /** * The clear coat radiance. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatRadiance = null; @@ -422,7 +422,7 @@ class PhysicalLightingModel extends LightingModel { /** * The clear coat specular direct. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatSpecularDirect = null; @@ -430,7 +430,7 @@ class PhysicalLightingModel extends LightingModel { /** * The clear coat specular indirect. * - * @type {Node?} + * @type {?Node} * @default null */ this.clearcoatSpecularIndirect = null; @@ -438,7 +438,7 @@ class PhysicalLightingModel extends LightingModel { /** * The sheen specular direct. * - * @type {Node?} + * @type {?Node} * @default null */ this.sheenSpecularDirect = null; @@ -446,7 +446,7 @@ class PhysicalLightingModel extends LightingModel { /** * The sheen specular indirect. * - * @type {Node?} + * @type {?Node} * @default null */ this.sheenSpecularIndirect = null; @@ -454,7 +454,7 @@ class PhysicalLightingModel extends LightingModel { /** * The iridescence Fresnel. * - * @type {Node?} + * @type {?Node} * @default null */ this.iridescenceFresnel = null; @@ -462,7 +462,7 @@ class PhysicalLightingModel extends LightingModel { /** * The iridescence F0. * - * @type {Node?} + * @type {?Node} * @default null */ this.iridescenceF0 = null; diff --git a/src/nodes/gpgpu/AtomicFunctionNode.js b/src/nodes/gpgpu/AtomicFunctionNode.js index fdb832ef569d86..80ed066965ed8a 100644 --- a/src/nodes/gpgpu/AtomicFunctionNode.js +++ b/src/nodes/gpgpu/AtomicFunctionNode.js @@ -26,7 +26,7 @@ class AtomicFunctionNode extends TempNode { * @param {string} method - The signature of the atomic function to construct. * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. */ constructor( method, pointerNode, valueNode, storeNode = null ) { @@ -56,7 +56,7 @@ class AtomicFunctionNode extends TempNode { /** * A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * - * @type {Node?} + * @type {?Node} * @default null */ this.storeNode = storeNode; @@ -147,7 +147,7 @@ export default AtomicFunctionNode; * @param {string} method - The signature of the atomic function to construct. * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ const atomicNode = nodeProxy( AtomicFunctionNode ); @@ -160,7 +160,7 @@ const atomicNode = nodeProxy( AtomicFunctionNode ); * @param {string} method - The signature of the atomic function to construct. * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicFunc = ( method, pointerNode, valueNode, storeNode = null ) => { @@ -178,7 +178,7 @@ export const atomicFunc = ( method, pointerNode, valueNode, storeNode = null ) = * @tsl * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicLoad = ( pointerNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_LOAD, pointerNode, null, storeNode ); @@ -190,7 +190,7 @@ export const atomicLoad = ( pointerNode, storeNode = null ) => atomicFunc( Atomi * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicStore = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_STORE, pointerNode, valueNode, storeNode ); @@ -202,7 +202,7 @@ export const atomicStore = ( pointerNode, valueNode, storeNode = null ) => atomi * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicAdd = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_ADD, pointerNode, valueNode, storeNode ); @@ -214,7 +214,7 @@ export const atomicAdd = ( pointerNode, valueNode, storeNode = null ) => atomicF * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicSub = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_SUB, pointerNode, valueNode, storeNode ); @@ -226,7 +226,7 @@ export const atomicSub = ( pointerNode, valueNode, storeNode = null ) => atomicF * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicMax = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_MAX, pointerNode, valueNode, storeNode ); @@ -238,7 +238,7 @@ export const atomicMax = ( pointerNode, valueNode, storeNode = null ) => atomicF * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicMin = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_MIN, pointerNode, valueNode, storeNode ); @@ -250,7 +250,7 @@ export const atomicMin = ( pointerNode, valueNode, storeNode = null ) => atomicF * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicAnd = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_AND, pointerNode, valueNode, storeNode ); @@ -262,7 +262,7 @@ export const atomicAnd = ( pointerNode, valueNode, storeNode = null ) => atomicF * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicOr = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_OR, pointerNode, valueNode, storeNode ); @@ -274,7 +274,7 @@ export const atomicOr = ( pointerNode, valueNode, storeNode = null ) => atomicFu * @function * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. * @param {Node} valueNode - The value that mutates the atomic variable. - * @param {Node?} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. + * @param {?Node} [storeNode=null] - A variable storing the return value of an atomic operation, typically the value of the atomic variable before the operation. * @returns {AtomicFunctionNode} */ export const atomicXor = ( pointerNode, valueNode, storeNode = null ) => atomicFunc( AtomicFunctionNode.ATOMIC_XOR, pointerNode, valueNode, storeNode ); diff --git a/src/nodes/lighting/AONode.js b/src/nodes/lighting/AONode.js index 59ddfb4ae08749..71cbf9a265de4e 100644 --- a/src/nodes/lighting/AONode.js +++ b/src/nodes/lighting/AONode.js @@ -18,7 +18,7 @@ class AONode extends LightingNode { /** * Constructs a new AO node. * - * @param {Node?} [aoNode=null] - The ambient occlusion node. + * @param {?Node} [aoNode=null] - The ambient occlusion node. */ constructor( aoNode = null ) { @@ -27,7 +27,7 @@ class AONode extends LightingNode { /** * The ambient occlusion node. * - * @type {Node?} + * @type {?Node} * @default null */ this.aoNode = aoNode; diff --git a/src/nodes/lighting/AmbientLightNode.js b/src/nodes/lighting/AmbientLightNode.js index dd53ab348611db..4cd7c6abdd1be7 100644 --- a/src/nodes/lighting/AmbientLightNode.js +++ b/src/nodes/lighting/AmbientLightNode.js @@ -16,7 +16,7 @@ class AmbientLightNode extends AnalyticLightNode { /** * Constructs a new ambient light node. * - * @param {AmbientLight?} [light=null] - The ambient light source. + * @param {?AmbientLight} [light=null] - The ambient light source. */ constructor( light = null ) { diff --git a/src/nodes/lighting/AnalyticLightNode.js b/src/nodes/lighting/AnalyticLightNode.js index 7d18184a7dd19d..77162268805337 100644 --- a/src/nodes/lighting/AnalyticLightNode.js +++ b/src/nodes/lighting/AnalyticLightNode.js @@ -23,7 +23,7 @@ class AnalyticLightNode extends LightingNode { /** * Constructs a new analytic light node. * - * @param {Light?} [light=null] - The light source. + * @param {?Light} [light=null] - The light source. */ constructor( light = null ) { @@ -32,7 +32,7 @@ class AnalyticLightNode extends LightingNode { /** * The light source. * - * @type {Light?} + * @type {?Light} * @default null */ this.light = light; @@ -56,7 +56,7 @@ class AnalyticLightNode extends LightingNode { * This property is used to retain a reference to the original value of {@link AnalyticLightNode#colorNode}. * The final color node is represented by a different node when using shadows. * - * @type {Node?} + * @type {?Node} * @default null */ this.baseColorNode = null; @@ -64,7 +64,7 @@ class AnalyticLightNode extends LightingNode { /** * Represents the light's shadow. * - * @type {ShadowNode?} + * @type {?ShadowNode} * @default null */ this.shadowNode = null; @@ -72,7 +72,7 @@ class AnalyticLightNode extends LightingNode { /** * Represents the light's shadow color. * - * @type {Node?} + * @type {?Node} * @default null */ this.shadowColorNode = null; diff --git a/src/nodes/lighting/BasicLightMapNode.js b/src/nodes/lighting/BasicLightMapNode.js index bfe68dea8ba1f3..ca90795d60032b 100644 --- a/src/nodes/lighting/BasicLightMapNode.js +++ b/src/nodes/lighting/BasicLightMapNode.js @@ -19,7 +19,7 @@ class BasicLightMapNode extends LightingNode { /** * Constructs a new basic light map node. * - * @param {Node?} [lightMapNode=null] - The light map node. + * @param {?Node} [lightMapNode=null] - The light map node. */ constructor( lightMapNode = null ) { @@ -28,7 +28,7 @@ class BasicLightMapNode extends LightingNode { /** * The light map node. * - * @type {Node?} + * @type {?Node} */ this.lightMapNode = lightMapNode; diff --git a/src/nodes/lighting/DirectionalLightNode.js b/src/nodes/lighting/DirectionalLightNode.js index 8cc7339c45be8a..6b731ef027563a 100644 --- a/src/nodes/lighting/DirectionalLightNode.js +++ b/src/nodes/lighting/DirectionalLightNode.js @@ -17,7 +17,7 @@ class DirectionalLightNode extends AnalyticLightNode { /** * Constructs a new directional light node. * - * @param {DirectionalLight?} [light=null] - The directional light source. + * @param {?DirectionalLight} [light=null] - The directional light source. */ constructor( light = null ) { diff --git a/src/nodes/lighting/EnvironmentNode.js b/src/nodes/lighting/EnvironmentNode.js index 1e12822edcf9ef..3db64254096526 100644 --- a/src/nodes/lighting/EnvironmentNode.js +++ b/src/nodes/lighting/EnvironmentNode.js @@ -38,7 +38,7 @@ class EnvironmentNode extends LightingNode { /** * A node representing the environment. * - * @type {Node?} + * @type {?Node} * @default null */ this.envNode = envNode; diff --git a/src/nodes/lighting/HemisphereLightNode.js b/src/nodes/lighting/HemisphereLightNode.js index a692f548038ccf..3f7f2e13d294dc 100644 --- a/src/nodes/lighting/HemisphereLightNode.js +++ b/src/nodes/lighting/HemisphereLightNode.js @@ -23,7 +23,7 @@ class HemisphereLightNode extends AnalyticLightNode { /** * Constructs a new hemisphere light node. * - * @param {HemisphereLight?} [light=null] - The hemisphere light source. + * @param {?HemisphereLight} [light=null] - The hemisphere light source. */ constructor( light = null ) { diff --git a/src/nodes/lighting/LightProbeNode.js b/src/nodes/lighting/LightProbeNode.js index d017f3cf38cd2f..44b1b68fbb781a 100644 --- a/src/nodes/lighting/LightProbeNode.js +++ b/src/nodes/lighting/LightProbeNode.js @@ -20,7 +20,7 @@ class LightProbeNode extends AnalyticLightNode { /** * Constructs a new light probe node. * - * @param {LightProbe?} [light=null] - The light probe. + * @param {?LightProbe} [light=null] - The light probe. */ constructor( light = null ) { diff --git a/src/nodes/lighting/LightingContextNode.js b/src/nodes/lighting/LightingContextNode.js index bcfffd305a85fb..77acaa72224ec4 100644 --- a/src/nodes/lighting/LightingContextNode.js +++ b/src/nodes/lighting/LightingContextNode.js @@ -20,9 +20,9 @@ class LightingContextNode extends ContextNode { * Constructs a new lighting context node. * * @param {LightsNode} node - The lights node. - * @param {LightingModel?} [lightingModel=null] - The current lighting model. - * @param {Node?} [backdropNode=null] - A backdrop node. - * @param {Node?} [backdropAlphaNode=null] - A backdrop alpha node. + * @param {?LightingModel} [lightingModel=null] - The current lighting model. + * @param {?Node} [backdropNode=null] - A backdrop node. + * @param {?Node} [backdropAlphaNode=null] - A backdrop alpha node. */ constructor( node, lightingModel = null, backdropNode = null, backdropAlphaNode = null ) { @@ -31,7 +31,7 @@ class LightingContextNode extends ContextNode { /** * The current lighting model. * - * @type {LightingModel?} + * @type {?LightingModel} * @default null */ this.lightingModel = lightingModel; @@ -39,7 +39,7 @@ class LightingContextNode extends ContextNode { /** * A backdrop node. * - * @type {Node?} + * @type {?Node} * @default null */ this.backdropNode = backdropNode; @@ -47,7 +47,7 @@ class LightingContextNode extends ContextNode { /** * A backdrop alpha node. * - * @type {Node?} + * @type {?Node} * @default null */ this.backdropAlphaNode = backdropAlphaNode; diff --git a/src/nodes/lighting/LightsNode.js b/src/nodes/lighting/LightsNode.js index 93d152b7cbf163..6a87183cdfdc5a 100644 --- a/src/nodes/lighting/LightsNode.js +++ b/src/nodes/lighting/LightsNode.js @@ -82,7 +82,7 @@ class LightsNode extends Node { * corresponding light node. * * @private - * @type {Array?} + * @type {?Array} * @default null */ this._lightNodes = null; @@ -91,7 +91,7 @@ class LightsNode extends Node { * A hash for identifying the current light nodes setup. * * @private - * @type {string?} + * @type {?string} * @default null */ this._lightNodesHash = null; diff --git a/src/nodes/lighting/PointLightNode.js b/src/nodes/lighting/PointLightNode.js index be7034f3dc9075..bff29bf62a64f6 100644 --- a/src/nodes/lighting/PointLightNode.js +++ b/src/nodes/lighting/PointLightNode.js @@ -50,7 +50,7 @@ class PointLightNode extends AnalyticLightNode { /** * Constructs a new point light node. * - * @param {PointLight?} [light=null] - The point light source. + * @param {?PointLight} [light=null] - The point light source. */ constructor( light = null ) { diff --git a/src/nodes/lighting/PointShadowNode.js b/src/nodes/lighting/PointShadowNode.js index afea881f492b25..661b2309c826be 100644 --- a/src/nodes/lighting/PointShadowNode.js +++ b/src/nodes/lighting/PointShadowNode.js @@ -175,7 +175,7 @@ class PointShadowNode extends ShadowNode { * Constructs a new point shadow node. * * @param {PointLight} light - The shadow casting point light. - * @param {PointLightShadow?} [shadow=null] - An optional point light shadow. + * @param {?PointLightShadow} [shadow=null] - An optional point light shadow. */ constructor( light, shadow = null ) { @@ -300,7 +300,7 @@ export default PointShadowNode; * @tsl * @function * @param {PointLight} light - The shadow casting point light. - * @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. */ export const pointShadow = ( light, shadow ) => nodeObject( new PointShadowNode( light, shadow ) ); diff --git a/src/nodes/lighting/RectAreaLightNode.js b/src/nodes/lighting/RectAreaLightNode.js index 18de18cef5c9d9..1272bbb8a50904 100644 --- a/src/nodes/lighting/RectAreaLightNode.js +++ b/src/nodes/lighting/RectAreaLightNode.js @@ -29,7 +29,7 @@ class RectAreaLightNode extends AnalyticLightNode { /** * Constructs a new rect area light node. * - * @param {RectAreaLight?} [light=null] - The rect area light source. + * @param {?RectAreaLight} [light=null] - The rect area light source. */ constructor( light = null ) { diff --git a/src/nodes/lighting/ShadowNode.js b/src/nodes/lighting/ShadowNode.js index 162675c646a2f0..6e028c393e93d1 100644 --- a/src/nodes/lighting/ShadowNode.js +++ b/src/nodes/lighting/ShadowNode.js @@ -326,7 +326,7 @@ class ShadowNode extends ShadowBaseNode { * Constructs a new shadow node. * * @param {Light} light - The shadow casting light. - * @param {LightShadow?} [shadow=null] - An optional light shadow. + * @param {?LightShadow} [shadow=null] - An optional light shadow. */ constructor( light, shadow = null ) { @@ -336,7 +336,7 @@ class ShadowNode extends ShadowBaseNode { * The light shadow which defines the properties light's * shadow. * - * @type {LightShadow?} + * @type {?LightShadow} * @default null */ this.shadow = shadow || light.shadow; @@ -344,7 +344,7 @@ class ShadowNode extends ShadowBaseNode { /** * A reference to the shadow map which is a render target. * - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this.shadowMap = null; @@ -353,7 +353,7 @@ class ShadowNode extends ShadowBaseNode { * Only relevant for VSM shadows. Render target for the * first VSM render pass. * - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this.vsmShadowMapVertical = null; @@ -362,7 +362,7 @@ class ShadowNode extends ShadowBaseNode { * Only relevant for VSM shadows. Render target for the * second VSM render pass. * - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this.vsmShadowMapHorizontal = null; @@ -371,7 +371,7 @@ class ShadowNode extends ShadowBaseNode { * Only relevant for VSM shadows. Node material which * is used to render the first VSM pass. * - * @type {NodeMaterial?} + * @type {?NodeMaterial} * @default null */ this.vsmMaterialVertical = null; @@ -380,7 +380,7 @@ class ShadowNode extends ShadowBaseNode { * Only relevant for VSM shadows. Node material which * is used to render the second VSM pass. * - * @type {NodeMaterial?} + * @type {?NodeMaterial} * @default null */ this.vsmMaterialHorizontal = null; @@ -389,7 +389,7 @@ class ShadowNode extends ShadowBaseNode { * A reference to the output node which defines the * final result of this shadow node. * - * @type {Node?} + * @type {?Node} * @private * @default null */ diff --git a/src/nodes/lighting/SpotLightNode.js b/src/nodes/lighting/SpotLightNode.js index 21795ef762a486..2f8b5239526ed7 100644 --- a/src/nodes/lighting/SpotLightNode.js +++ b/src/nodes/lighting/SpotLightNode.js @@ -23,7 +23,7 @@ class SpotLightNode extends AnalyticLightNode { /** * Constructs a new spot light node. * - * @param {SpotLight?} [light=null] - The spot light source. + * @param {?SpotLight} [light=null] - The spot light source. */ constructor( light = null ) { diff --git a/src/nodes/math/ConditionalNode.js b/src/nodes/math/ConditionalNode.js index 7bed85c591bffa..9bb95a8bfa345d 100644 --- a/src/nodes/math/ConditionalNode.js +++ b/src/nodes/math/ConditionalNode.js @@ -28,7 +28,7 @@ class ConditionalNode extends Node { * * @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`. + * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. */ constructor( condNode, ifNode, elseNode = null ) { @@ -51,7 +51,7 @@ class ConditionalNode extends Node { /** * The node that is evaluate when the condition ends up `false`. * - * @type {Node?} + * @type {?Node} * @default null */ this.elseNode = elseNode; @@ -203,7 +203,7 @@ export default ConditionalNode; * @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`. + * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. * @returns {ConditionalNode} */ export const select = /*@__PURE__*/ nodeProxy( ConditionalNode ); diff --git a/src/nodes/math/MathNode.js b/src/nodes/math/MathNode.js index 4c95cf5b0a9a28..87fac4e2ee2fcf 100644 --- a/src/nodes/math/MathNode.js +++ b/src/nodes/math/MathNode.js @@ -26,8 +26,8 @@ class MathNode extends TempNode { * * @param {string} method - The method name. * @param {Node} aNode - The first input. - * @param {Node?} [bNode=null] - The second input. - * @param {Node?} [cNode=null] - The third input. + * @param {?Node} [bNode=null] - The second input. + * @param {?Node} [cNode=null] - The third input. */ constructor( method, aNode, bNode = null, cNode = null ) { @@ -50,7 +50,7 @@ class MathNode extends TempNode { /** * The second input. * - * @type {Node?} + * @type {?Node} * @default null */ this.bNode = bNode; @@ -58,7 +58,7 @@ class MathNode extends TempNode { /** * The third input. * - * @type {Node?} + * @type {?Node} * @default null */ this.cNode = cNode; @@ -569,7 +569,7 @@ export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS ); * @tsl * @function * @param {Node | number} y - The y parameter. - * @param {(Node | number)?} x - The x parameter. + * @param {?(Node | number)} x - The x parameter. * @returns {Node} */ export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN ); diff --git a/src/nodes/utils/Discard.js b/src/nodes/utils/Discard.js index 0cc0932a89722e..0c5163c4d389d0 100644 --- a/src/nodes/utils/Discard.js +++ b/src/nodes/utils/Discard.js @@ -7,7 +7,7 @@ import { addMethodChaining } from '../tsl/TSLCore.js'; * * @tsl * @function - * @param {ConditionalNode?} conditional - An optional conditional node. It allows to decide whether the discard should be executed or not. + * @param {?ConditionalNode} conditional - An optional conditional node. It allows to decide whether the discard should be executed or not. * @return {Node} The `discard` expression. */ export const Discard = ( conditional ) => ( conditional ? select( conditional, expression( 'discard' ) ) : expression( 'discard' ) ).append(); diff --git a/src/nodes/utils/JoinNode.js b/src/nodes/utils/JoinNode.js index 5a7cfb509b4b97..9cdc7e908d9942 100644 --- a/src/nodes/utils/JoinNode.js +++ b/src/nodes/utils/JoinNode.js @@ -19,7 +19,7 @@ class JoinNode extends TempNode { * Constructs a new join node. * * @param {Array} nodes - An array of nodes that should be joined. - * @param {string?} [nodeType=null] - The node type. + * @param {?string} [nodeType=null] - The node type. */ constructor( nodes = [], nodeType = null ) { diff --git a/src/nodes/utils/RTTNode.js b/src/nodes/utils/RTTNode.js index 5d0e91a3b63aa2..a2b1b31b29870a 100644 --- a/src/nodes/utils/RTTNode.js +++ b/src/nodes/utils/RTTNode.js @@ -31,8 +31,8 @@ class RTTNode extends TextureNode { * Constructs a new RTT node. * * @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 {?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. */ constructor( node, width = null, height = null, options = { type: HalfFloatType } ) { @@ -52,7 +52,7 @@ class RTTNode extends TextureNode { * The width of the internal render target. * If not width is applied, the render target is automatically resized. * - * @type {number?} + * @type {?number} * @default null */ this.width = width; @@ -60,7 +60,7 @@ class RTTNode extends TextureNode { /** * The height of the internal render target. * - * @type {number?} + * @type {?number} * @default null */ this.height = height; @@ -234,8 +234,8 @@ export default RTTNode; * @tsl * @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 {?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} */ @@ -247,8 +247,8 @@ export const rtt = ( node, ...params ) => nodeObject( new RTTNode( nodeObject( n * @tsl * @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 {?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} */ diff --git a/src/nodes/utils/ReflectorNode.js b/src/nodes/utils/ReflectorNode.js index f84b520c3541ac..6183b34fb9f41c 100644 --- a/src/nodes/utils/ReflectorNode.js +++ b/src/nodes/utils/ReflectorNode.js @@ -76,7 +76,7 @@ class ReflectorNode extends TextureNode { * A reference to the internal reflector base node which holds the actual implementation. * * @private - * @type {ReflectorBaseNode?} + * @type {?ReflectorBaseNode} * @default null */ this._reflectorBaseNode = parameters.reflector || new ReflectorBaseNode( this, parameters ); @@ -85,7 +85,7 @@ class ReflectorNode extends TextureNode { * A reference to the internal depth node. * * @private - * @type {Node?} + * @type {?Node} * @default null */ this._depthNode = null; diff --git a/src/nodes/utils/SpriteUtils.js b/src/nodes/utils/SpriteUtils.js index a6219a9037035d..fce1f56e343fa5 100644 --- a/src/nodes/utils/SpriteUtils.js +++ b/src/nodes/utils/SpriteUtils.js @@ -14,7 +14,7 @@ import { Fn, defined } from '../tsl/TSLBase.js'; * @tsl * @function * @param {Object} config - The configuration object. - * @param {Node?} [config.position=null] - Can be used to define the vertex positions in world space. + * @param {?Node} [config.position=null] - Can be used to define the vertex positions in world space. * @param {boolean} [config.horizontal=true] - Whether to follow the camera rotation horizontally or not. * @param {boolean} [config.vertical=false] - Whether to follow the camera rotation vertically or not. * @return {Node} The updated vertex position in clip space. diff --git a/src/nodes/utils/TriplanarTexturesNode.js b/src/nodes/utils/TriplanarTexturesNode.js index 1f6454a027037e..5828afd1290376 100644 --- a/src/nodes/utils/TriplanarTexturesNode.js +++ b/src/nodes/utils/TriplanarTexturesNode.js @@ -26,11 +26,11 @@ class TriplanarTexturesNode extends Node { * Constructs a new triplanar textures node. * * @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?} [scaleNode=float(1)] - The scale node. - * @param {Node?} [positionNode=positionLocal] - Vertex positions in local space. - * @param {Node?} [normalNode=normalLocal] - Normals in local space. + * @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} [scaleNode=float(1)] - The scale node. + * @param {?Node} [positionNode=positionLocal] - Vertex positions in local space. + * @param {?Node} [normalNode=normalLocal] - Normals in local space. */ constructor( textureXNode, textureYNode = null, textureZNode = null, scaleNode = float( 1 ), positionNode = positionLocal, normalNode = normalLocal ) { @@ -123,11 +123,11 @@ export default TriplanarTexturesNode; * @tsl * @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?} [scaleNode=float(1)] - The scale node. - * @param {Node?} [positionNode=positionLocal] - Vertex positions in local space. - * @param {Node?} [normalNode=normalLocal] - Normals in local space. + * @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} [scaleNode=float(1)] - The scale node. + * @param {?Node} [positionNode=positionLocal] - Vertex positions in local space. + * @param {?Node} [normalNode=normalLocal] - Normals in local space. * @returns {TriplanarTexturesNode} */ export const triplanarTextures = /*@__PURE__*/ nodeProxy( TriplanarTexturesNode ); @@ -138,11 +138,11 @@ export const triplanarTextures = /*@__PURE__*/ nodeProxy( TriplanarTexturesNode * @tsl * @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?} [scaleNode=float(1)] - The scale node. - * @param {Node?} [positionNode=positionLocal] - Vertex positions in local space. - * @param {Node?} [normalNode=normalLocal] - Normals in local space. + * @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} [scaleNode=float(1)] - The scale node. + * @param {?Node} [positionNode=positionLocal] - Vertex positions in local space. + * @param {?Node} [normalNode=normalLocal] - Normals in local space. * @returns {TriplanarTexturesNode} */ export const triplanarTexture = ( ...params ) => triplanarTextures( ...params ); diff --git a/src/nodes/utils/ViewportUtils.js b/src/nodes/utils/ViewportUtils.js index 145af40b2439a7..060fc9d36dd357 100644 --- a/src/nodes/utils/ViewportUtils.js +++ b/src/nodes/utils/ViewportUtils.js @@ -12,7 +12,7 @@ import { linearDepth } from '../display/ViewportDepthNode.js'; * * @tsl * @function - * @param {Node?} uv - Optional uv coordinates. By default `screenUV` is used. + * @param {?Node} uv - Optional uv coordinates. By default `screenUV` is used. * @return {Node} The update uv coordinates. */ export const viewportSafeUV = /*@__PURE__*/ Fn( ( [ uv = null ] ) => { diff --git a/src/renderers/common/Animation.js b/src/renderers/common/Animation.js index 99b1ca9ae276bc..6aba7a9f84cb22 100644 --- a/src/renderers/common/Animation.js +++ b/src/renderers/common/Animation.js @@ -39,7 +39,7 @@ class Animation { /** * The user-defined animation loop. * - * @type {Function?} + * @type {?Function} * @default null */ this._animationLoop = null; @@ -48,7 +48,7 @@ class Animation { * The requestId which is returned from the `requestAnimationFrame()` call. * Can be used to cancel the stop the animation loop. * - * @type {number?} + * @type {?number} * @default null */ this._requestId = null; diff --git a/src/renderers/common/Backend.js b/src/renderers/common/Backend.js index 3883facc8a7eb3..c759ce0bd6306e 100644 --- a/src/renderers/common/Backend.js +++ b/src/renderers/common/Backend.js @@ -45,7 +45,7 @@ class Backend { /** * A reference to the renderer. * - * @type {Renderer?} + * @type {?Renderer} * @default null */ this.renderer = null; @@ -53,7 +53,7 @@ class Backend { /** * A reference to the canvas element the renderer is drawing to. * - * @type {(HTMLCanvasElement|OffscreenCanvas)?} + * @type {?(HTMLCanvasElement|OffscreenCanvas)} * @default null */ this.domElement = null; @@ -61,7 +61,7 @@ class Backend { /** * A reference to the timestamp query pool. * - * @type {{render: TimestampQueryPool?, compute: TimestampQueryPool?}} + * @type {{render: ?TimestampQueryPool, compute: ?TimestampQueryPool}} */ this.timestampQueryPool = { 'render': null, @@ -344,8 +344,8 @@ class Backend { * @abstract * @param {Texture} srcTexture - The source texture. * @param {Texture} dstTexture - The destination texture. - * @param {Vector4?} [srcRegion=null] - The region of the source texture to copy. - * @param {(Vector2|Vector3)?} [dstPosition=null] - The destination position of the copy. + * @param {?Vector4} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. * @param {number} [level=0] - The mip level to copy. */ copyTextureToTexture( /*srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0*/ ) {} diff --git a/src/renderers/common/ClippingContext.js b/src/renderers/common/ClippingContext.js index c4b0e4dabd93c9..f556143fd50583 100644 --- a/src/renderers/common/ClippingContext.js +++ b/src/renderers/common/ClippingContext.js @@ -17,7 +17,7 @@ class ClippingContext { /** * Constructs a new clipping context. * - * @param {ClippingContext?} [parentContext=null] - A reference to the parent clipping context. + * @param {?ClippingContext} [parentContext=null] - A reference to the parent clipping context. */ constructor( parentContext = null ) { @@ -32,7 +32,7 @@ class ClippingContext { /** * Whether the intersection of the clipping planes is used to clip objects, rather than their union. * - * @type {boolean?} + * @type {?boolean} * @default null */ this.clipIntersection = null; @@ -83,7 +83,7 @@ class ClippingContext { /** * The version of the clipping context's parent context. * - * @type {number?} + * @type {?number} * @readonly */ this.parentVersion = null; diff --git a/src/renderers/common/DataMap.js b/src/renderers/common/DataMap.js index 81a9e1efad3956..5152d43f093588 100644 --- a/src/renderers/common/DataMap.js +++ b/src/renderers/common/DataMap.js @@ -46,7 +46,7 @@ class DataMap { * Deletes the dictionary for the given object. * * @param {Object} object - The object. - * @return {Object?} The deleted dictionary. + * @return {?Object} The deleted dictionary. */ delete( object ) { diff --git a/src/renderers/common/Geometries.js b/src/renderers/common/Geometries.js index 7a0829941a4e0b..14f4129f044165 100644 --- a/src/renderers/common/Geometries.js +++ b/src/renderers/common/Geometries.js @@ -288,7 +288,7 @@ class Geometries extends DataMap { * Returns the indirect buffer attribute of the given render object. * * @param {RenderObject} renderObject - The render object. - * @return {BufferAttribute?} The indirect attribute. `null` if no indirect drawing is used. + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. */ getIndirect( renderObject ) { @@ -301,7 +301,7 @@ class Geometries extends DataMap { * in a method to return a wireframe index if necessary. * * @param {RenderObject} renderObject - The render object. - * @return {BufferAttribute?} The index. Returns `null` for non-indexed geometries. + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. */ getIndex( renderObject ) { diff --git a/src/renderers/common/Pipelines.js b/src/renderers/common/Pipelines.js index f787357d9e6a37..df8e1d79ecc2b2 100644 --- a/src/renderers/common/Pipelines.js +++ b/src/renderers/common/Pipelines.js @@ -40,7 +40,7 @@ class Pipelines extends DataMap { * This reference will be set inside the `Bindings` * constructor. * - * @type {Bindings?} + * @type {?Bindings} * @default null */ this.bindings = null; @@ -145,7 +145,7 @@ class Pipelines extends DataMap { * Returns a render pipeline for the given render object. * * @param {RenderObject} renderObject - The render object. - * @param {Array?} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @param {?Array} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. * @return {RenderPipeline} The render pipeline. */ getForRender( renderObject, promises = null ) { @@ -238,7 +238,7 @@ class Pipelines extends DataMap { * Deletes the pipeline for the given render object. * * @param {RenderObject} object - The render object. - * @return {Object?} The deleted dictionary. + * @return {?Object} The deleted dictionary. */ delete( object ) { @@ -343,7 +343,7 @@ class Pipelines extends DataMap { * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. * @param {string} cacheKey - The cache key. - * @param {Array?} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @param {?Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. * @return {ComputePipeline} The compute pipeline. */ _getRenderPipeline( renderObject, stageVertex, stageFragment, cacheKey, promises ) { diff --git a/src/renderers/common/ProgrammableStage.js b/src/renderers/common/ProgrammableStage.js index 1f22fb920f35fe..51cd6797dab253 100644 --- a/src/renderers/common/ProgrammableStage.js +++ b/src/renderers/common/ProgrammableStage.js @@ -15,8 +15,8 @@ class ProgrammableStage { * @param {string} code - The shader code. * @param {('vertex'|'fragment'|'compute')} stage - The type of stage. * @param {string} name - The name of the shader. - * @param {Array?} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). - * @param {Array?} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * @param {?Array} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * @param {?Array} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). */ constructor( code, stage, name, transforms = null, attributes = null ) { @@ -52,14 +52,14 @@ class ProgrammableStage { /** * The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). * - * @type {Array?} + * @type {?Array} */ this.transforms = transforms; /** * The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). * - * @type {Array?} + * @type {?Array} */ this.attributes = attributes; diff --git a/src/renderers/common/QuadMesh.js b/src/renderers/common/QuadMesh.js index d934c572372760..becaf339279740 100644 --- a/src/renderers/common/QuadMesh.js +++ b/src/renderers/common/QuadMesh.js @@ -50,7 +50,7 @@ class QuadMesh extends Mesh { /** * Constructs a new quad mesh. * - * @param {Material?} [material=null] - The material to render the quad mesh with. + * @param {?Material} [material=null] - The material to render the quad mesh with. */ constructor( material = null ) { diff --git a/src/renderers/common/RenderContext.js b/src/renderers/common/RenderContext.js index bd7ab87da92acd..e025d57d4e3b1d 100644 --- a/src/renderers/common/RenderContext.js +++ b/src/renderers/common/RenderContext.js @@ -134,7 +134,7 @@ class RenderContext { /** * The active render target. * - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this.renderTarget = null; @@ -143,7 +143,7 @@ class RenderContext { * The textures of the active render target. * `null` when no render target is set. * - * @type {Array?} + * @type {?Array} * @default null */ this.textures = null; @@ -152,7 +152,7 @@ class RenderContext { * The depth texture of the active render target. * `null` when no render target is set. * - * @type {DepthTexture?} + * @type {?DepthTexture} * @default null */ this.depthTexture = null; @@ -209,7 +209,7 @@ class RenderContext { /** * The current clipping context. * - * @type {ClippingContext?} + * @type {?ClippingContext} * @default null */ this.clippingContext = null; diff --git a/src/renderers/common/RenderContexts.js b/src/renderers/common/RenderContexts.js index f08f5062c79d28..fa10b0edb274e4 100644 --- a/src/renderers/common/RenderContexts.js +++ b/src/renderers/common/RenderContexts.js @@ -34,7 +34,7 @@ class RenderContexts { * * @param {Scene} scene - The scene. * @param {Camera} camera - The camera that is used to render the scene. - * @param {RenderTarget?} [renderTarget=null] - The active render target. + * @param {?RenderTarget} [renderTarget=null] - The active render target. * @return {RenderContext} The render context. */ get( scene, camera, renderTarget = null ) { @@ -80,7 +80,7 @@ class RenderContexts { /** * Returns a render context intended for clear operations. * - * @param {RenderTarget?} [renderTarget=null] - The active render target. + * @param {?RenderTarget} [renderTarget=null] - The active render target. * @return {RenderContext} The render context. */ getForClear( renderTarget = null ) { diff --git a/src/renderers/common/RenderList.js b/src/renderers/common/RenderList.js index 9ab43b515b049d..e1cb5217efc3af 100644 --- a/src/renderers/common/RenderList.js +++ b/src/renderers/common/RenderList.js @@ -225,7 +225,7 @@ class RenderList { * @param {Material} material - The 3D object's material. * @param {number} groupOrder - The current group order. * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {ClippingContext} clippingContext - The current clipping context. * @return {Object} The render item. */ @@ -278,7 +278,7 @@ class RenderList { * @param {Material} material - The 3D object's material. * @param {number} groupOrder - The current group order. * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {ClippingContext} clippingContext - The current clipping context. */ push( object, geometry, material, groupOrder, z, group, clippingContext ) { @@ -310,7 +310,7 @@ class RenderList { * @param {Material} material - The 3D object's material. * @param {number} groupOrder - The current group order. * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {ClippingContext} clippingContext - The current clipping context. */ unshift( object, geometry, material, groupOrder, z, group, clippingContext ) { diff --git a/src/renderers/common/RenderObject.js b/src/renderers/common/RenderObject.js index 855c98023f11b1..641cbc84c91abc 100644 --- a/src/renderers/common/RenderObject.js +++ b/src/renderers/common/RenderObject.js @@ -156,7 +156,7 @@ class RenderObject { /** * The draw range of the geometry. * - * @type {Object?} + * @type {?Object} * @default null */ this.drawRange = null; @@ -166,7 +166,7 @@ class RenderObject { * of the render object. This entails attribute * definitions on geometry and node level. * - * @type {Array?} + * @type {?Array} * @default null */ this.attributes = null; @@ -185,7 +185,7 @@ class RenderObject { * multiple materials. This represents a group entry * from the respective `BufferGeometry`. * - * @type {{start: number, count: number}?} + * @type {?{start: number, count: number}} * @default null */ this.group = null; @@ -194,7 +194,7 @@ class RenderObject { * An array holding the vertex buffers which can * be buffer attributes but also interleaved buffers. * - * @type {Array?} + * @type {?Array} * @default null */ this.vertexBuffers = null; @@ -202,7 +202,7 @@ class RenderObject { /** * The parameters for the draw command. * - * @type {Object?} + * @type {?Object} * @default null */ this.drawParams = null; @@ -211,7 +211,7 @@ class RenderObject { * If this render object is used inside a render bundle, * this property points to the respective bundle group. * - * @type {BundleGroup?} + * @type {?BundleGroup} * @default null */ this.bundle = null; @@ -247,7 +247,7 @@ class RenderObject { /** * The node builder state. * - * @type {NodeBuilderState?} + * @type {?NodeBuilderState} * @private * @default null */ @@ -256,7 +256,7 @@ class RenderObject { /** * An array of bindings. * - * @type {Array?} + * @type {?Array} * @private * @default null */ @@ -265,7 +265,7 @@ class RenderObject { /** * Reference to the node material observer. * - * @type {NodeMaterialObserver?} + * @type {?NodeMaterialObserver} * @private * @default null */ @@ -380,7 +380,7 @@ class RenderObject { * Returns a binding group by group name of this render object. * * @param {string} name - The name of the binding group. - * @return {BindGroup?} The bindings. + * @return {?BindGroup} The bindings. */ getBindingGroup( name ) { @@ -399,7 +399,7 @@ class RenderObject { /** * Returns the index of the render object's geometry. * - * @return {BufferAttribute?} The index. Returns `null` for non-indexed geometries. + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. */ getIndex() { @@ -410,7 +410,7 @@ class RenderObject { /** * Returns the indirect buffer attribute. * - * @return {BufferAttribute?} The indirect attribute. `null` if no indirect drawing is used. + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. */ getIndirect() { diff --git a/src/renderers/common/RenderObjects.js b/src/renderers/common/RenderObjects.js index 4c77b2fce2ce9c..07eb93c0ed63e2 100644 --- a/src/renderers/common/RenderObjects.js +++ b/src/renderers/common/RenderObjects.js @@ -84,7 +84,7 @@ class RenderObjects { * @param {LightsNode} lightsNode - The lights node. * @param {RenderContext} renderContext - The render context. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} passId - An optional ID for identifying the pass. + * @param {?string} passId - An optional ID for identifying the pass. * @return {RenderObject} The render object. */ get( object, material, scene, camera, lightsNode, renderContext, clippingContext, passId ) { @@ -173,7 +173,7 @@ class RenderObjects { * @param {LightsNode} lightsNode - The lights node. * @param {RenderContext} renderContext - The render context. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} passId - An optional ID for identifying the pass. + * @param {?string} passId - An optional ID for identifying the pass. * @return {RenderObject} The render object. */ createRenderObject( nodes, geometries, renderer, object, material, scene, camera, lightsNode, renderContext, clippingContext, passId ) { diff --git a/src/renderers/common/Renderer.js b/src/renderers/common/Renderer.js index f8c23c603357ca..b4142bfdcbbda0 100644 --- a/src/renderers/common/Renderer.js +++ b/src/renderers/common/Renderer.js @@ -52,7 +52,7 @@ class Renderer { * @param {boolean} [parameters.antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. * @param {number} [parameters.samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0 * to overwrite the default. - * @param {Function?} [parameters.getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. + * @param {?Function} [parameters.getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. * @param {number} [parameters.colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. */ @@ -304,7 +304,7 @@ class Renderer { * A reference to a renderer module for managing shader attributes. * * @private - * @type {Attributes?} + * @type {?Attributes} * @default null */ this._attributes = null; @@ -313,7 +313,7 @@ class Renderer { * A reference to a renderer module for managing geometries. * * @private - * @type {Geometries?} + * @type {?Geometries} * @default null */ this._geometries = null; @@ -322,7 +322,7 @@ class Renderer { * A reference to a renderer module for managing node related logic. * * @private - * @type {Nodes?} + * @type {?Nodes} * @default null */ this._nodes = null; @@ -331,7 +331,7 @@ class Renderer { * A reference to a renderer module for managing the internal animation loop. * * @private - * @type {Animation?} + * @type {?Animation} * @default null */ this._animation = null; @@ -340,7 +340,7 @@ class Renderer { * A reference to a renderer module for managing shader program bindings. * * @private - * @type {Bindings?} + * @type {?Bindings} * @default null */ this._bindings = null; @@ -349,7 +349,7 @@ class Renderer { * A reference to a renderer module for managing render objects. * * @private - * @type {RenderObjects?} + * @type {?RenderObjects} * @default null */ this._objects = null; @@ -358,7 +358,7 @@ class Renderer { * A reference to a renderer module for managing render and compute pipelines. * * @private - * @type {Pipelines?} + * @type {?Pipelines} * @default null */ this._pipelines = null; @@ -367,7 +367,7 @@ class Renderer { * A reference to a renderer module for managing render bundles. * * @private - * @type {RenderBundles?} + * @type {?RenderBundles} * @default null */ this._bundles = null; @@ -376,7 +376,7 @@ class Renderer { * A reference to a renderer module for managing render lists. * * @private - * @type {RenderLists?} + * @type {?RenderLists} * @default null */ this._renderLists = null; @@ -385,7 +385,7 @@ class Renderer { * A reference to a renderer module for managing render contexts. * * @private - * @type {RenderContexts?} + * @type {?RenderContexts} * @default null */ this._renderContexts = null; @@ -394,7 +394,7 @@ class Renderer { * A reference to a renderer module for managing textures. * * @private - * @type {Textures?} + * @type {?Textures} * @default null */ this._textures = null; @@ -403,7 +403,7 @@ class Renderer { * A reference to a renderer module for backgrounds. * * @private - * @type {Background?} + * @type {?Background} * @default null */ this._background = null; @@ -422,7 +422,7 @@ class Renderer { * A reference to the current render context. * * @private - * @type {RenderContext?} + * @type {?RenderContext} * @default null */ this._currentRenderContext = null; @@ -431,7 +431,7 @@ class Renderer { * A custom sort function for the opaque render list. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._opaqueSort = null; @@ -440,7 +440,7 @@ class Renderer { * A custom sort function for the transparent render list. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._transparentSort = null; @@ -449,7 +449,7 @@ class Renderer { * The framebuffer target. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this._frameBufferTarget = null; @@ -486,7 +486,7 @@ class Renderer { * The current render target. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this._renderTarget = null; @@ -513,7 +513,7 @@ class Renderer { * The MRT setting. * * @private - * @type {MRTNode?} + * @type {?MRTNode} * @default null */ this._mrt = null; @@ -523,7 +523,7 @@ class Renderer { * to be rendered. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._renderObjectFunction = null; @@ -532,7 +532,7 @@ class Renderer { * Used to keep track of the current render object function. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._currentRenderObjectFunction = null; @@ -541,7 +541,7 @@ class Renderer { * Used to keep track of the current render bundle. * * @private - * @type {RenderBundle?} + * @type {?RenderBundle} * @default null */ this._currentRenderBundle = null; @@ -555,7 +555,7 @@ class Renderer { * and pipeline updates. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._handleObjectFunction = this._renderObjectDirect; @@ -602,7 +602,7 @@ class Renderer { * A reference to the promise which initializes the renderer. * * @private - * @type {Promise?} + * @type {?Promise} * @default null */ this._initPromise = null; @@ -611,7 +611,7 @@ class Renderer { * An array of compilation promises which are used in `compileAsync()`. * * @private - * @type {Array?} + * @type {?Array} * @default null */ this._compilationPromises = null; @@ -1107,7 +1107,7 @@ class Renderer { * * @param {Object3D} scene - The scene or 3D object to render. * @param {Camera} camera - The camera to render the scene with. - * @return {Promise?} A Promise that resolve when the scene has been rendered. + * @return {?Promise} A Promise that resolve when the scene has been rendered. * Only returned when the renderer has not been initialized. */ render( scene, camera ) { @@ -1130,7 +1130,7 @@ class Renderer { * pass and not inline to achieve more correct results. * * @private - * @return {RenderTarget?} The render target. The method returns `null` if no output conversion should be applied. + * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied. */ _getFrameBufferTarget() { @@ -2071,7 +2071,7 @@ class Renderer { * target the default framebuffer (meaning the canvas) anymore but a custom framebuffer. * Use `null` as the first argument to reset the state. * - * @param {RenderTarget?} renderTarget - The render target to set. + * @param {?RenderTarget} renderTarget - The render target to set. * @param {number} [activeCubeFace=0] - The active cube face. * @param {number} [activeMipmapLevel=0] - The active mipmap level. */ @@ -2086,7 +2086,7 @@ class Renderer { /** * Returns the current render target. * - * @return {RenderTarget?} The render target. Returns `null` if no render target is set. + * @return {?RenderTarget} The render target. Returns `null` if no render target is set. */ getRenderTarget() { @@ -2103,10 +2103,10 @@ class Renderer { * @param {Camera} camera - The camera the object should be rendered with. * @param {BufferGeometry} geometry - The object's geometry. * @param {Material} material - The object's material. - * @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {LightsNode} lightsNode - The current lights node. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} [passId=null] - An optional ID for identifying the pass. + * @param {?string} [passId=null] - An optional ID for identifying the pass. */ /** @@ -2118,7 +2118,7 @@ class Renderer { * * Use `null` as the first argument to reset the state. * - * @param {renderObjectFunction?} renderObjectFunction - The render object function. + * @param {?renderObjectFunction} renderObjectFunction - The render object function. */ setRenderObjectFunction( renderObjectFunction ) { @@ -2129,7 +2129,7 @@ class Renderer { /** * Returns the current render object function. * - * @return {Function?} The current render object function. Returns `null` if no function is set. + * @return {?Function} The current render object function. Returns `null` if no function is set. */ getRenderObjectFunction() { @@ -2142,7 +2142,7 @@ class Renderer { * if the renderer has been initialized. * * @param {Node|Array} computeNodes - The compute node(s). - * @return {Promise?} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. + * @return {?Promise} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. */ compute( computeNodes ) { @@ -2648,7 +2648,7 @@ class Renderer { * @param {Camera} camera - The camera the render list should be rendered with. * @param {Scene} scene - The scene the render list belongs to. * @param {LightsNode} lightsNode - The current lights node. - * @param {string?} [passId=null] - An optional ID for identifying the pass. + * @param {?string} [passId=null] - An optional ID for identifying the pass. */ _renderObjects( renderList, camera, scene, lightsNode, passId = null ) { @@ -2671,10 +2671,10 @@ class Renderer { * @param {Camera} camera - The camera the object should be rendered with. * @param {BufferGeometry} geometry - The object's geometry. * @param {Material} material - The object's material. - * @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {LightsNode} lightsNode - The current lights node. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} [passId=null] - An optional ID for identifying the pass. + * @param {?string} [passId=null] - An optional ID for identifying the pass. */ renderObject( object, scene, camera, geometry, material, group, lightsNode, clippingContext = null, passId = null ) { @@ -2781,9 +2781,9 @@ class Renderer { * @param {Scene} scene - The scene the 3D object belongs to. * @param {Camera} camera - The camera the object should be rendered with. * @param {LightsNode} lightsNode - The current lights node. - * @param {{start: number, count: number}?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} [passId=null] - An optional ID for identifying the pass. + * @param {?string} [passId=null] - An optional ID for identifying the pass. */ _renderObjectDirect( object, material, scene, camera, lightsNode, group, clippingContext, passId ) { @@ -2836,9 +2836,9 @@ class Renderer { * @param {Scene} scene - The scene the 3D object belongs to. * @param {Camera} camera - The camera the object should be rendered with. * @param {LightsNode} lightsNode - The current lights node. - * @param {{start: number, count: number}?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. * @param {ClippingContext} clippingContext - The clipping context. - * @param {string?} [passId=null] - An optional ID for identifying the pass. + * @param {?string} [passId=null] - An optional ID for identifying the pass. */ _createObjectPipeline( object, material, scene, camera, lightsNode, group, clippingContext, passId ) { diff --git a/src/renderers/common/SampledTexture.js b/src/renderers/common/SampledTexture.js index d1f311e69ca1f8..d86d43ea77f8a8 100644 --- a/src/renderers/common/SampledTexture.js +++ b/src/renderers/common/SampledTexture.js @@ -14,7 +14,7 @@ class SampledTexture extends Binding { * Constructs a new sampled texture. * * @param {string} name - The sampled texture's name. - * @param {Texture?} texture - The texture this binding is referring to. + * @param {?Texture} texture - The texture this binding is referring to. */ constructor( name, texture ) { @@ -30,7 +30,7 @@ class SampledTexture extends Binding { /** * The texture this binding is referring to. * - * @type {Texture?} + * @type {?Texture} */ this.texture = texture; @@ -53,7 +53,7 @@ class SampledTexture extends Binding { * The binding's generation which is an additional version * qualifier. * - * @type {number?} + * @type {?number} * @default null */ this.generation = null; @@ -128,7 +128,7 @@ class SampledArrayTexture extends SampledTexture { * Constructs a new sampled array texture. * * @param {string} name - The sampled array texture's name. - * @param {(DataArrayTexture|CompressedArrayTexture)?} texture - The texture this binding is referring to. + * @param {?(DataArrayTexture|CompressedArrayTexture)} texture - The texture this binding is referring to. */ constructor( name, texture ) { @@ -159,7 +159,7 @@ class Sampled3DTexture extends SampledTexture { * Constructs a new sampled 3D texture. * * @param {string} name - The sampled 3D texture's name. - * @param {Data3DTexture?} texture - The texture this binding is referring to. + * @param {?Data3DTexture} texture - The texture this binding is referring to. */ constructor( name, texture ) { @@ -190,7 +190,7 @@ class SampledCubeTexture extends SampledTexture { * Constructs a new sampled cube texture. * * @param {string} name - The sampled cube texture's name. - * @param {(CubeTexture|CompressedCubeTexture)?} texture - The texture this binding is referring to. + * @param {?(CubeTexture|CompressedCubeTexture)} texture - The texture this binding is referring to. */ constructor( name, texture ) { diff --git a/src/renderers/common/Sampler.js b/src/renderers/common/Sampler.js index f3ea4ab514483c..9c1c8025328f83 100644 --- a/src/renderers/common/Sampler.js +++ b/src/renderers/common/Sampler.js @@ -12,7 +12,7 @@ class Sampler extends Binding { * Constructs a new sampler. * * @param {string} name - The samplers's name. - * @param {Texture?} texture - The texture this binding is referring to. + * @param {?Texture} texture - The texture this binding is referring to. */ constructor( name, texture ) { @@ -21,7 +21,7 @@ class Sampler extends Binding { /** * The texture the sampler is referring to. * - * @type {Texture?} + * @type {?Texture} */ this.texture = texture; diff --git a/src/renderers/common/UniformsGroup.js b/src/renderers/common/UniformsGroup.js index 1f79866c5e405f..cdeebf66505133 100644 --- a/src/renderers/common/UniformsGroup.js +++ b/src/renderers/common/UniformsGroup.js @@ -32,7 +32,7 @@ class UniformsGroup extends UniformBuffer { * An array with the raw uniform values. * * @private - * @type {Array?} + * @type {?Array} * @default null */ this._values = null; diff --git a/src/renderers/common/XRManager.js b/src/renderers/common/XRManager.js index e5d45c5107bf64..103bb29dd18434 100644 --- a/src/renderers/common/XRManager.js +++ b/src/renderers/common/XRManager.js @@ -105,7 +105,7 @@ class XRManager extends EventDispatcher { * The current near value of the XR camera. * * @private - * @type {number?} + * @type {?number} * @default null */ this._currentDepthNear = null; @@ -114,7 +114,7 @@ class XRManager extends EventDispatcher { * The current far value of the XR camera. * * @private - * @type {number?} + * @type {?number} * @default null */ this._currentDepthFar = null; @@ -140,7 +140,7 @@ class XRManager extends EventDispatcher { * The current render target of the renderer. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this._currentRenderTarget = null; @@ -150,7 +150,7 @@ class XRManager extends EventDispatcher { * during an active XR session. * * @private - * @type {RenderTarget?} + * @type {?RenderTarget} * @default null */ this._xrRenderTarget = null; @@ -159,7 +159,7 @@ class XRManager extends EventDispatcher { * The current animation context. * * @private - * @type {Window?} + * @type {?Window} * @default null */ this._currentAnimationContext = null; @@ -168,7 +168,7 @@ class XRManager extends EventDispatcher { * The current animation loop. * * @private - * @type {Function?} + * @type {?Function} * @default null */ this._currentAnimationLoop = null; @@ -177,7 +177,7 @@ class XRManager extends EventDispatcher { * The current pixel ratio. * * @private - * @type {number?} + * @type {?number} * @default null */ this._currentPixelRatio = null; @@ -229,7 +229,7 @@ class XRManager extends EventDispatcher { * The current XR reference space. * * @private - * @type {XRReferenceSpace?} + * @type {?XRReferenceSpace} * @default null */ this._referenceSpace = null; @@ -247,7 +247,7 @@ class XRManager extends EventDispatcher { * A custom reference space defined by the application. * * @private - * @type {XRReferenceSpace?} + * @type {?XRReferenceSpace} * @default null */ this._customReferenceSpace = null; @@ -274,7 +274,7 @@ class XRManager extends EventDispatcher { * A reference to the current XR session. * * @private - * @type {XRSession?} + * @type {?XRSession} * @default null */ this._session = null; @@ -283,7 +283,7 @@ class XRManager extends EventDispatcher { * A reference to the current XR base layer. * * @private - * @type {XRWebGLLayer?} + * @type {?XRWebGLLayer} * @default null */ this._glBaseLayer = null; @@ -292,7 +292,7 @@ class XRManager extends EventDispatcher { * A reference to the current XR binding. * * @private - * @type {XRWebGLBinding?} + * @type {?XRWebGLBinding} * @default null */ this._glBinding = null; @@ -301,7 +301,7 @@ class XRManager extends EventDispatcher { * A reference to the current XR projection layer. * * @private - * @type {XRProjectionLayer?} + * @type {?XRProjectionLayer} * @default null */ this._glProjLayer = null; @@ -310,7 +310,7 @@ class XRManager extends EventDispatcher { * A reference to the current XR frame. * * @private - * @type {XRFrame?} + * @type {?XRFrame} * @default null */ this._xrFrame = null; @@ -511,7 +511,7 @@ class XRManager extends EventDispatcher { /** * Returns the environment blend mode from the current XR session. * - * @return {('opaque'|'additive'|'alpha-blend')?} The environment blend mode. Returns `null` when used outside of a XR session. + * @return {?('opaque'|'additive'|'alpha-blend')} The environment blend mode. Returns `null` when used outside of a XR session. */ getEnvironmentBlendMode() { @@ -526,7 +526,7 @@ class XRManager extends EventDispatcher { /** * Returns the current XR frame. * - * @return {XRFrame?} The XR frame. Returns `null` when used outside a XR session. + * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session. */ getFrame() { @@ -537,7 +537,7 @@ class XRManager extends EventDispatcher { /** * Returns the current XR session. * - * @return {XRSession?} The XR session. Returns `null` when used outside a XR session. + * @return {?XRSession} The XR session. Returns `null` when used outside a XR session. */ getSession() { diff --git a/src/renderers/common/extras/PMREMGenerator.js b/src/renderers/common/extras/PMREMGenerator.js index 4a84e5c98675eb..6477261867e3e4 100644 --- a/src/renderers/common/extras/PMREMGenerator.js +++ b/src/renderers/common/extras/PMREMGenerator.js @@ -135,7 +135,7 @@ class PMREMGenerator { * @param {number} [sigma=0] - The blur radius in radians. * @param {number} [near=0.1] - The near plane distance. * @param {number} [far=100] - The far plane distance. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {RenderTarget} The resulting PMREM. * @see fromSceneAsync */ @@ -189,7 +189,7 @@ class PMREMGenerator { * @param {number} [sigma=0] - The blur radius in radians. * @param {number} [near=0.1] - The near plane distance. * @param {number} [far=100] - The far plane distance. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {Promise} The resulting PMREM. * @see fromScene */ @@ -207,7 +207,7 @@ class PMREMGenerator { * as this matches best with the 256 x 256 cubemap output. * * @param {Texture} equirectangular - The equirectangular texture to be converted. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {RenderTarget} The resulting PMREM. * @see fromEquirectangularAsync */ @@ -237,7 +237,7 @@ class PMREMGenerator { * as this matches best with the 256 x 256 cubemap output. * * @param {Texture} equirectangular - The equirectangular texture to be converted. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {Promise} The resulting PMREM. * @see fromEquirectangular */ @@ -255,7 +255,7 @@ class PMREMGenerator { * as this matches best with the 256 x 256 cubemap output. * * @param {Texture} cubemap - The cubemap texture to be converted. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {RenderTarget} The resulting PMREM. * @see fromCubemapAsync */ @@ -285,7 +285,7 @@ class PMREMGenerator { * with the 256 x 256 cubemap output. * * @param {Texture} cubemap - The cubemap texture to be converted. - * @param {RenderTarget?} [renderTarget=null] - The render target to use. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. * @return {Promise} The resulting PMREM. * @see fromCubemap */ diff --git a/src/renderers/common/nodes/NodeBuilderState.js b/src/renderers/common/nodes/NodeBuilderState.js index addb680dee5fc4..155acf3c80a9f9 100644 --- a/src/renderers/common/nodes/NodeBuilderState.js +++ b/src/renderers/common/nodes/NodeBuilderState.js @@ -14,9 +14,9 @@ class NodeBuilderState { /** * Constructs a new node builder state. * - * @param {string?} vertexShader - The native vertex shader code. - * @param {string?} fragmentShader - The native fragment shader code. - * @param {string?} computeShader - The native compute shader code. + * @param {?string} vertexShader - The native vertex shader code. + * @param {?string} fragmentShader - The native fragment shader code. + * @param {?string} computeShader - The native compute shader code. * @param {Array} nodeAttributes - An array of node attributes. * @param {Array} bindings - An array of bind groups. * @param {Array} updateNodes - An array of nodes that implement their `update()` method. diff --git a/src/renderers/common/nodes/NodeLibrary.js b/src/renderers/common/nodes/NodeLibrary.js index a931500aad040e..821fdc31e12c0b 100644 --- a/src/renderers/common/nodes/NodeLibrary.js +++ b/src/renderers/common/nodes/NodeLibrary.js @@ -87,7 +87,7 @@ class NodeLibrary { * Returns a tone mapping node function for a tone mapping technique (constant). * * @param {number} toneMapping - The tone mapping. - * @return {Function?} The tone mapping node function. Returns `null` if no node function is found. + * @return {?Function} The tone mapping node function. Returns `null` if no node function is found. */ getToneMappingFunction( toneMapping ) { @@ -99,7 +99,7 @@ class NodeLibrary { * Returns a node material class definition for a material type. * * @param {string} materialType - The material type. - * @return {NodeMaterial.constructor?} The node material class definition. Returns `null` if no node material is found. + * @return {?NodeMaterial.constructor} The node material class definition. Returns `null` if no node material is found. */ getMaterialNodeClass( materialType ) { @@ -123,7 +123,7 @@ class NodeLibrary { * Returns a light node class definition for a light class definition. * * @param {Light.constructor} light - The light class definition. - * @return {AnalyticLightNode.constructor?} The light node class definition. Returns `null` if no light node is found. + * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found. */ getLightNodeClass( light ) { diff --git a/src/renderers/common/nodes/NodeSampledTexture.js b/src/renderers/common/nodes/NodeSampledTexture.js index 6f97310cac2dcd..d3bc51ba382a37 100644 --- a/src/renderers/common/nodes/NodeSampledTexture.js +++ b/src/renderers/common/nodes/NodeSampledTexture.js @@ -15,7 +15,7 @@ class NodeSampledTexture extends SampledTexture { * @param {string} name - The textures's name. * @param {TextureNode} textureNode - The texture node. * @param {UniformGroupNode} groupNode - The uniform group node. - * @param {string?} [access=null] - The access type. + * @param {?string} [access=null] - The access type. */ constructor( name, textureNode, groupNode, access = null ) { @@ -38,7 +38,7 @@ class NodeSampledTexture extends SampledTexture { /** * The access type. * - * @type {string?} + * @type {?string} * @default null */ this.access = access; @@ -96,7 +96,7 @@ class NodeSampledCubeTexture extends NodeSampledTexture { * @param {string} name - The textures's name. * @param {TextureNode} textureNode - The texture node. * @param {UniformGroupNode} groupNode - The uniform group node. - * @param {string?} [access=null] - The access type. + * @param {?string} [access=null] - The access type. */ constructor( name, textureNode, groupNode, access = null ) { @@ -130,7 +130,7 @@ class NodeSampledTexture3D extends NodeSampledTexture { * @param {string} name - The textures's name. * @param {TextureNode} textureNode - The texture node. * @param {UniformGroupNode} groupNode - The uniform group node. - * @param {string?} [access=null] - The access type. + * @param {?string} [access=null] - The access type. */ constructor( name, textureNode, groupNode, access = null ) { diff --git a/src/renderers/common/nodes/Nodes.js b/src/renderers/common/nodes/Nodes.js index 02ac46f112a725..600d918cecbe22 100644 --- a/src/renderers/common/nodes/Nodes.js +++ b/src/renderers/common/nodes/Nodes.js @@ -223,7 +223,7 @@ class Nodes extends DataMap { * Deletes the given object from the internal data map * * @param {any} object - The object to delete. - * @return {Object?} The deleted dictionary. + * @return {?Object} The deleted dictionary. */ delete( object ) { diff --git a/src/renderers/webgl-fallback/WebGLBackend.js b/src/renderers/webgl-fallback/WebGLBackend.js index 456fc0545af5c8..9b03f33894de72 100644 --- a/src/renderers/webgl-fallback/WebGLBackend.js +++ b/src/renderers/webgl-fallback/WebGLBackend.js @@ -53,7 +53,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding shader attribute-related * utility functions. * - * @type {WebGLAttributeUtils?} + * @type {?WebGLAttributeUtils} * @default null */ this.attributeUtils = null; @@ -62,7 +62,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding extension-related * utility functions. * - * @type {WebGLExtensions?} + * @type {?WebGLExtensions} * @default null */ this.extensions = null; @@ -71,7 +71,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding capability-related * utility functions. * - * @type {WebGLCapabilities?} + * @type {?WebGLCapabilities} * @default null */ this.capabilities = null; @@ -80,7 +80,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding texture-related * utility functions. * - * @type {WebGLTextureUtils?} + * @type {?WebGLTextureUtils} * @default null */ this.textureUtils = null; @@ -89,7 +89,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding renderer-related * utility functions. * - * @type {WebGLBufferRenderer?} + * @type {?WebGLBufferRenderer} * @default null */ this.bufferRenderer = null; @@ -97,7 +97,7 @@ class WebGLBackend extends Backend { /** * A reference to the rendering context. * - * @type {WebGL2RenderingContext?} + * @type {?WebGL2RenderingContext} * @default null */ this.gl = null; @@ -106,7 +106,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding state-related * utility functions. * - * @type {WebGLState?} + * @type {?WebGLState} * @default null */ this.state = null; @@ -115,7 +115,7 @@ class WebGLBackend extends Backend { * A reference to a backend module holding common * utility functions. * - * @type {WebGLUtils?} + * @type {?WebGLUtils} * @default null */ this.utils = null; @@ -147,7 +147,7 @@ class WebGLBackend extends Backend { * A reference to the `EXT_disjoint_timer_query_webgl2` extension. `null` if the * device does not support the extension. * - * @type {EXTDisjointTimerQueryWebGL2?} + * @type {?EXTDisjointTimerQueryWebGL2} * @default null */ this.disjoint = null; @@ -156,7 +156,7 @@ class WebGLBackend extends Backend { * A reference to the `KHR_parallel_shader_compile` extension. `null` if the * device does not support the extension. * - * @type {KHRParallelShaderCompile?} + * @type {?KHRParallelShaderCompile} * @default null */ this.parallel = null; @@ -337,7 +337,7 @@ class WebGLBackend extends Backend { * * @param {XRRenderTarget} renderTarget - The XR render target. * @param {WebGLTexture} colorTexture - A native color texture. - * @param {WebGLTexture?} [depthTexture=null] - A native depth texture. + * @param {?WebGLTexture} [depthTexture=null] - A native depth texture. */ setXRRenderTargetTextures( renderTarget, colorTexture, depthTexture = null ) { @@ -712,7 +712,7 @@ class WebGLBackend extends Backend { * @param {boolean} color - Whether the color buffer should be cleared or not. * @param {boolean} depth - Whether the depth buffer should be cleared or not. * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. - * @param {Object?} [descriptor=null] - The render context of the current set render target. + * @param {?Object} [descriptor=null] - The render context of the current set render target. * @param {boolean} [setFrameBuffer=true] - TODO. */ clear( color, depth, stencil, descriptor = null, setFrameBuffer = true ) { @@ -1848,8 +1848,8 @@ class WebGLBackend extends Backend { * * @param {Texture} srcTexture - The source texture. * @param {Texture} dstTexture - The destination texture. - * @param {Vector4?} [srcRegion=null] - The region of the source texture to copy. - * @param {(Vector2|Vector3)?} [dstPosition=null] - The destination position of the copy. + * @param {?Vector4} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. * @param {number} [level=0] - The mip level to copy. */ copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) { @@ -2135,7 +2135,7 @@ class WebGLBackend extends Backend { * Computes the VAO key for the given index and attributes. * * @private - * @param {BufferAttribute?} index - The index. `null` for non-indexed geometries. + * @param {?BufferAttribute} index - The index. `null` for non-indexed geometries. * @param {Array} attributes - An array of buffer attributes. * @return {string} The VAO key. */ @@ -2167,7 +2167,7 @@ class WebGLBackend extends Backend { * Creates a VAO from the index and attributes. * * @private - * @param {BufferAttribute?} index - The index. `null` for non-indexed geometries. + * @param {?BufferAttribute} index - The index. `null` for non-indexed geometries. * @param {Array} attributes - An array of buffer attributes. * @return {Object} The VAO data. */ diff --git a/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js b/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js index 6b6b31f2b2bf65..78378dae4e0001 100644 --- a/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +++ b/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js @@ -366,7 +366,7 @@ ${ flowData.code } * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvIndexSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. + * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. * @param {string} [levelSnippet='0u'] - A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture. * @return {string} The GLSL snippet. */ @@ -390,7 +390,7 @@ ${ flowData.code } * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. + * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. * @return {string} The GLSL snippet. */ generateTexture( texture, textureProperty, uvSnippet, depthSnippet ) { @@ -462,7 +462,7 @@ ${ flowData.code } * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. * @param {string} compareSnippet - A GLSL snippet that represents the reference value. - * @param {string?} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The GLSL snippet. */ @@ -853,7 +853,7 @@ ${ flowData.code } /** * Returns the draw index builtin. * - * @return {string?} The drawIndex shader string. Returns `null` if `WEBGL_multi_draw` isn't supported by the device. + * @return {?string} The drawIndex shader string. Returns `null` if `WEBGL_multi_draw` isn't supported by the device. */ getDrawIndex() { @@ -1285,7 +1285,7 @@ void main() { * @param {UniformNode} node - The uniform node. * @param {string} type - The node data type. * @param {string} shaderStage - The shader stage. - * @param {string?} [name=null] - An optional uniform name. + * @param {?string} [name=null] - An optional uniform name. * @return {NodeUniform} The node uniform object. */ getUniformFromNode( node, type, shaderStage, name = null ) { diff --git a/src/renderers/webgl-fallback/utils/WebGLCapabilities.js b/src/renderers/webgl-fallback/utils/WebGLCapabilities.js index 1c35264067a1a8..c311d1ff550272 100644 --- a/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +++ b/src/renderers/webgl-fallback/utils/WebGLCapabilities.js @@ -22,7 +22,7 @@ class WebGLCapabilities { /** * This value holds the cached max anisotropy value. * - * @type {number?} + * @type {?number} * @default null */ this.maxAnisotropy = null; diff --git a/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js b/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js index e01faf8312760a..881bc5c6b227c9 100644 --- a/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +++ b/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js @@ -134,7 +134,7 @@ class WebGLTextureUtils { /** * Returns the native texture type for the given texture. * - * @param {string?} internalFormatName - The internal format name. When `null`, the internal format is derived from the subsequent parameters. + * @param {?string} internalFormatName - The internal format name. When `null`, the internal format is derived from the subsequent parameters. * @param {GLenum} glFormat - The WebGL format. * @param {GLenum} glType - The WebGL type. * @param {string} colorSpace - The texture's color space. @@ -697,8 +697,8 @@ class WebGLTextureUtils { * * @param {Texture} srcTexture - The source texture. * @param {Texture} dstTexture - The destination texture. - * @param {Vector4?} [srcRegion=null] - The region of the source texture to copy. - * @param {(Vector2|Vector3)?} [dstPosition=null] - The destination position of the copy. + * @param {?Vector4} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. * @param {number} [level=0] - The mip level to copy. */ copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) { diff --git a/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js b/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js index fa22bf071627a1..9d409b9d84d450 100644 --- a/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +++ b/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js @@ -52,7 +52,7 @@ class WebGLTimestampQueryPool extends TimestampQueryPool { * Allocates a pair of queries for a given render context. * * @param {Object} renderContext - The render context to allocate queries for. - * @returns {number?} The base offset for the allocated queries, or null if allocation failed. + * @returns {?number} The base offset for the allocated queries, or null if allocation failed. */ allocateQueriesForContext( renderContext ) { diff --git a/src/renderers/webgpu/WebGPUBackend.js b/src/renderers/webgpu/WebGPUBackend.js index 18dccf042a3d66..b41f1524c4d291 100644 --- a/src/renderers/webgpu/WebGPUBackend.js +++ b/src/renderers/webgpu/WebGPUBackend.js @@ -70,7 +70,7 @@ class WebGPUBackend extends Backend { /** * A reference to the device. * - * @type {GPUDevice?} + * @type {?GPUDevice} * @default null */ this.device = null; @@ -78,7 +78,7 @@ class WebGPUBackend extends Backend { /** * A reference to the context. * - * @type {GPUCanvasContext?} + * @type {?GPUCanvasContext} * @default null */ this.context = null; @@ -86,7 +86,7 @@ class WebGPUBackend extends Backend { /** * A reference to the color attachment of the default framebuffer. * - * @type {GPUTexture?} + * @type {?GPUTexture} * @default null */ this.colorBuffer = null; @@ -94,7 +94,7 @@ class WebGPUBackend extends Backend { /** * A reference to the default render pass descriptor. * - * @type {Object?} + * @type {?Object} * @default null */ this.defaultRenderPassdescriptor = null; @@ -824,7 +824,7 @@ class WebGPUBackend extends Backend { * @param {boolean} color - Whether the color buffer should be cleared or not. * @param {boolean} depth - Whether the depth buffer should be cleared or not. * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. - * @param {RenderContext?} [renderTargetContext=null] - The render context of the current set render target. + * @param {?RenderContext} [renderTargetContext=null] - The render context of the current set render target. */ clear( color, depth, stencil, renderTargetContext = null ) { @@ -1825,8 +1825,8 @@ class WebGPUBackend extends Backend { * * @param {Texture} srcTexture - The source texture. * @param {Texture} dstTexture - The destination texture. - * @param {Vector4?} [srcRegion=null] - The region of the source texture to copy. - * @param {(Vector2|Vector3)?} [dstPosition=null] - The destination position of the copy. + * @param {?Vector4} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. * @param {number} [level=0] - The mip level to copy. */ copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) { diff --git a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js index 3c7b35db6e963f..0932c02611b729 100644 --- a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +++ b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js @@ -230,7 +230,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -291,7 +291,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -392,7 +392,7 @@ class WGSLNodeBuilder extends NodeBuilder { * Generates the array declaration string. * * @param {string} type - The type. - * @param {number?} [count] - The count. + * @param {?number} [count] - The count. * @return {string} The generated value as a shader string. */ generateArrayDeclaration( type, count ) { @@ -506,7 +506,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. * @return {string} The WGSL snippet. */ @@ -528,7 +528,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. * @return {string} The WGSL snippet. */ @@ -598,7 +598,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {Texture} texture - The texture. * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -631,7 +631,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. * @param {Array} gradSnippet - An array holding both gradient WGSL snippets. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -658,7 +658,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. * @param {string} compareSnippet - A WGSL snippet that represents the reference value. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -683,7 +683,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -712,7 +712,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {string} textureProperty - The name of the texture uniform in the shader. * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. * @param {string} biasSnippet - A WGSL snippet that represents the bias to apply to the mip level before sampling. - * @param {string?} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. * @return {string} The WGSL snippet. */ @@ -863,7 +863,7 @@ class WGSLNodeBuilder extends NodeBuilder { * @param {UniformNode} node - The uniform node. * @param {string} type - The node data type. * @param {string} shaderStage - The shader stage. - * @param {string?} [name=null] - An optional uniform name. + * @param {?string} [name=null] - An optional uniform name. * @return {NodeUniform} The node uniform object. */ getUniformFromNode( node, type, shaderStage, name = null ) { @@ -1492,7 +1492,7 @@ ${ flowData.code } * * @param {string} type - The variable's type. * @param {string} name - The variable's name. - * @param {number?} [count=null] - The array length. + * @param {?number} [count=null] - The array length. * @return {string} The WGSL snippet that defines a variable. */ getVar( type, name, count = null ) { diff --git a/src/renderers/webgpu/utils/WebGPUTextureUtils.js b/src/renderers/webgpu/utils/WebGPUTextureUtils.js index 7d87a13cb9b3e3..38074d345d4dd5 100644 --- a/src/renderers/webgpu/utils/WebGPUTextureUtils.js +++ b/src/renderers/webgpu/utils/WebGPUTextureUtils.js @@ -56,7 +56,7 @@ class WebGPUTextureUtils { /** * A reference to the pass utils. * - * @type {WebGPUTexturePassUtils?} + * @type {?WebGPUTexturePassUtils} * @default null */ this._passUtils = null; @@ -80,7 +80,7 @@ class WebGPUTextureUtils { /** * A default video frame. * - * @type {VideoFrame?} + * @type {?VideoFrame} * @default null */ this.defaultVideoFrame = null; @@ -88,7 +88,7 @@ class WebGPUTextureUtils { /** * Represents the color attachment of the default framebuffer. * - * @type {GPUTexture?} + * @type {?GPUTexture} * @default null */ this.colorBuffer = null; @@ -1104,7 +1104,7 @@ class WebGPUTextureUtils { * Returns the GPU format for the given texture. * * @param {Texture} texture - The texture. - * @param {GPUDevice?} [device=null] - The GPU device which is used for feature detection. + * @param {?GPUDevice} [device=null] - The GPU device which is used for feature detection. * It is not necessary to apply the device for most formats. * @return {string} The GPU format. */ diff --git a/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js b/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js index ce476867635f48..056ef3e143b8bb 100644 --- a/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +++ b/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js @@ -47,7 +47,7 @@ class WebGPUTimestampQueryPool extends TimestampQueryPool { * Allocates a pair of queries for a given render context. * * @param {Object} renderContext - The render context to allocate queries for. - * @returns {number?} The base offset for the allocated queries, or null if allocation failed. + * @returns {?number} The base offset for the allocated queries, or null if allocation failed. */ allocateQueriesForContext( renderContext ) {