From 716dd61ac1de31fe29ee0da46231d7f493bbc80b Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Mon, 6 Jan 2025 15:44:30 +0100 Subject: [PATCH 1/2] Docs: Clean up. --- src/nodes/accessors/MaterialNode.js | 8 ++++---- src/nodes/display/BumpMapNode.js | 12 ++++++------ src/nodes/display/NormalMapNode.js | 12 ++++++------ src/renderers/common/ChainMap.js | 2 +- utils/docs/jsdoc.config.json | 9 ++++++++- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/nodes/accessors/MaterialNode.js b/src/nodes/accessors/MaterialNode.js index 8f8397d37aaf1f..7acdae7a48a41f 100644 --- a/src/nodes/accessors/MaterialNode.js +++ b/src/nodes/accessors/MaterialNode.js @@ -520,7 +520,7 @@ export const materialReflectivity = /*@__PURE__*/ nodeImmutable( MaterialNode, M /** * TSL object that represents the roughness of the current material. - * The value is composed via `roughness` * `roughnessMap.g` + * The value is composed via `roughness` * `roughnessMap.g`. * * @type {Node} */ @@ -528,7 +528,7 @@ export const materialRoughness = /*@__PURE__*/ nodeImmutable( MaterialNode, Mate /** * TSL object that represents the metalness of the current material. - * The value is composed via `metalness` * `metalnessMap.b` + * The value is composed via `metalness` * `metalnessMap.b`. * * @type {Node} */ @@ -552,7 +552,7 @@ export const materialClearcoat = /*@__PURE__*/ nodeImmutable( MaterialNode, Mate /** * TSL object that represents the clearcoat roughness of the current material. - * The value is composed via `clearcoatRoughness` * `clearcoatRoughnessMap.r` + * The value is composed via `clearcoatRoughness` * `clearcoatRoughnessMap.r`. * * @type {Node} */ @@ -583,7 +583,7 @@ export const materialSheen = /*@__PURE__*/ nodeImmutable( MaterialNode, Material /** * TSL object that represents the sheen roughness of the current material. - * The value is composed via `sheenRoughness` * `sheenRoughnessMap.a` . + * The value is composed via `sheenRoughness` * `sheenRoughnessMap.a`. * * @type {Node} */ diff --git a/src/nodes/display/BumpMapNode.js b/src/nodes/display/BumpMapNode.js index 08adb6901e2f9f..a591463b0aaf95 100644 --- a/src/nodes/display/BumpMapNode.js +++ b/src/nodes/display/BumpMapNode.js @@ -66,8 +66,8 @@ 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} textureNode - Represents the bump map data. + * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect. */ constructor( textureNode, scaleNode = null ) { @@ -76,14 +76,14 @@ class BumpMapNode extends TempNode { /** * Represents the bump map data. * - * @type {Node} + * @type {Node} */ this.textureNode = textureNode; /** * Controls the intensity of the bump effect. * - * @type {Node?} + * @type {Node?} * @default null */ this.scaleNode = scaleNode; @@ -111,8 +111,8 @@ export default BumpMapNode; * TSL function for creating a bump map node. * * @function - * @param {Node} textureNode - Represents the bump map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect. + * @param {Node} textureNode - Represents the bump map data. + * @param {Node?} [scaleNode=null] - Controls the intensity of the bump effect. * @returns {BumpMapNode} */ export const bumpMap = /*@__PURE__*/ nodeProxy( BumpMapNode ); diff --git a/src/nodes/display/NormalMapNode.js b/src/nodes/display/NormalMapNode.js index f4429ad6f6fa15..5d5b9c70a7d4a6 100644 --- a/src/nodes/display/NormalMapNode.js +++ b/src/nodes/display/NormalMapNode.js @@ -59,8 +59,8 @@ 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} node - Represents the normal map data. + * @param {Node?} [scaleNode=null] - Controls the intensity of the effect. */ constructor( node, scaleNode = null ) { @@ -69,14 +69,14 @@ class NormalMapNode extends TempNode { /** * Represents the normal map data. * - * @type {Node} + * @type {Node} */ this.node = node; /** * Controls the intensity of the effect. * - * @type {Node?} + * @type {Node?} * @default null */ this.scaleNode = scaleNode; @@ -142,8 +142,8 @@ export default NormalMapNode; * TSL function for creating a normal map node. * * @function - * @param {Node} node - Represents the normal map data. - * @param {Node?} [scaleNode=null] - Controls the intensity of the effect. + * @param {Node} node - Represents the normal map data. + * @param {Node?} [scaleNode=null] - Controls the intensity of the effect. * @returns {NormalMapNode} */ export const normalMap = /*@__PURE__*/ nodeProxy( NormalMapNode ); diff --git a/src/renderers/common/ChainMap.js b/src/renderers/common/ChainMap.js index 9419ac50d0ac30..83e05f7869573b 100644 --- a/src/renderers/common/ChainMap.js +++ b/src/renderers/common/ChainMap.js @@ -9,7 +9,7 @@ class ChainMap { /** - * Constructs a new chained map. + * Constructs a new chain map. */ constructor() { diff --git a/utils/docs/jsdoc.config.json b/utils/docs/jsdoc.config.json index 3f6bb30c589b7a..040ce014759bd4 100644 --- a/utils/docs/jsdoc.config.json +++ b/utils/docs/jsdoc.config.json @@ -4,7 +4,10 @@ "encoding": "utf8", "package": "package.json", "recurse": true, - "template": "node_modules/clean-jsdoc-theme" + "template": "node_modules/clean-jsdoc-theme", + "theme_opts": { + "homepageTitle": "three.js docs" + } }, "plugins": [ "plugins/markdown" ], "source": { @@ -16,5 +19,9 @@ "src/renderers/common", "src/renderers/webgpu" ] + }, + "markdown": { + "hardwrap": false, + "idInHeadings": true } } From f0b6b5e6b3ac71d5cf12680fe21c35d186561d34 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Mon, 6 Jan 2025 15:46:31 +0100 Subject: [PATCH 2/2] Update ChainMap.js --- src/renderers/common/ChainMap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderers/common/ChainMap.js b/src/renderers/common/ChainMap.js index 83e05f7869573b..02203123518275 100644 --- a/src/renderers/common/ChainMap.js +++ b/src/renderers/common/ChainMap.js @@ -2,14 +2,14 @@ * Data structure for the renderer. It allows defining values * with chained, hierarchical keys. Keys are meant to be * objects since the module internally works with Weak Maps - * for perforamnce reasons. + * for performance reasons. * * @private */ class ChainMap { /** - * Constructs a new chain map. + * Constructs a new Chain Map. */ constructor() { @@ -49,7 +49,7 @@ class ChainMap { * * @param {Array} keys - List of keys. * @param {Any} value - The value to set. - * @return {ChainMap} A reference to this chain map. + * @return {ChainMap} A reference to this Chain Map. */ set( keys, value ) {