Skip to content

Commit

Permalink
Renderer: Document more modules. (mrdoob#30246)
Browse files Browse the repository at this point in the history
* Renderer: Document more modules.

* Renderer: Document more modules.

* Renderer: Document more modules.

* Renderer: Document more modules.

* Fix typo.
  • Loading branch information
Mugen87 authored Jan 1, 2025
1 parent 9a0137a commit 4c1941f
Show file tree
Hide file tree
Showing 13 changed files with 1,356 additions and 33 deletions.
16 changes: 13 additions & 3 deletions src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ class NodeBuilder {

}

/**
* Returns the output struct name which is required by
* {@link module:OutputStructNode}.
*
* @abstract
* @return {String} The name of the output struct.
*/
getOutputStructName() {}

/**
* Returns a bind group for the given group name and binding.
*
Expand Down Expand Up @@ -1034,10 +1043,11 @@ 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} levelSnippet - Snippet defining the mip level.
* @return {String} The generated shader string.
*/
generateTextureLod( /* texture, textureProperty, uvSnippet, levelSnippet */ ) {
generateTextureLod( /* texture, textureProperty, uvSnippet, depthSnippet, levelSnippet */ ) {

console.warn( 'Abstract function.' );

Expand Down Expand Up @@ -1211,11 +1221,11 @@ class NodeBuilder {
}

/**
* Whether the given texture needs a conversion to working color space.
* Checks if the given texture requires a manual conversion to the working color space.
*
* @abstract
* @param {Texture} texture - The texture to check.
* @return {Boolean} Whether a color space conversion is required or not.
* @return {Boolean} Whether the given texture requires a conversion to working color space or not.
*/
needsToWorkingColorSpace( /*texture*/ ) {

Expand Down
5 changes: 3 additions & 2 deletions src/renderers/common/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,16 @@ class Backend {
* Returns texture data as a typed array.
*
* @abstract
* @async
* @param {Texture} texture - The texture to copy.
* @param {Number} x - The x coordinate of the copy origin.
* @param {Number} y - The y coordinate of the copy origin.
* @param {Number} width - The width of the copy.
* @param {Number} height - The height of the copy.
* @param {Number} faceIndex - The face index.
* @return {TypedArray} The texture data as a typed array.
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
*/
copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}
async copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}

/**
* Copies data of the given source texture to the given destination texture.
Expand Down
5 changes: 3 additions & 2 deletions src/renderers/webgl-fallback/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,15 +1161,16 @@ class WebGLBackend extends Backend {
/**
* Returns texture data as a typed array.
*
* @async
* @param {Texture} texture - The texture to copy.
* @param {Number} x - The x coordinate of the copy origin.
* @param {Number} y - The y coordinate of the copy origin.
* @param {Number} width - The width of the copy.
* @param {Number} height - The height of the copy.
* @param {Number} faceIndex - The face index.
* @return {TypedArray} The texture data as a typed array.
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
*/
copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {
async copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {

return this.textureUtils.copyTextureToBuffer( texture, x, y, width, height, faceIndex );

Expand Down
Loading

0 comments on commit 4c1941f

Please sign in to comment.