Răsfoiți Sursa

Renderer: Document more modules. (#30182)

* Renderer: Document more modules.

* Docs: Finish `Renderer`.

* Clean up.

* More clean up.

* Clean up.

* Fix typo.

* Remove parameter.
Michael Herzog 1 an în urmă
părinte
comite
8e86f023d0

+ 2 - 0
src/materials/nodes/VolumeNodeMaterial.js

@@ -10,6 +10,8 @@ import { Loop, Break } from '../../nodes/utils/LoopNode.js';
 import { texture3D } from '../../nodes/accessors/Texture3DNode.js';
 import { Color } from '../../math/Color.js';
 
+/** @module VolumeNodeMaterial **/
+
 /**
  * Node material intended for volume rendering. The volumetic data are
  * defined with an instance of {@link Data3DTexture}.

+ 2 - 0
src/nodes/code/ScriptableNode.js

@@ -3,6 +3,8 @@ import { scriptableValue } from './ScriptableValueNode.js';
 import { nodeProxy, float } from '../tsl/TSLBase.js';
 import { hashArray, hashString } from '../core/NodeUtils.js';
 
+/** @module ScriptableNode **/
+
 /**
  * A Map-like data structure for managing resources of scriptable nodes.
  *

+ 2 - 0
src/nodes/code/ScriptableValueNode.js

@@ -4,6 +4,8 @@ import { nodeProxy, float } from '../tsl/TSLBase.js';
 
 import { EventDispatcher } from '../../core/EventDispatcher.js';
 
+/** @module ScriptableValueNode **/
+
 /**
  * `ScriptableNode` uses this class to manage script inputs and outputs.
  *

Fișier diff suprimat deoarece este prea mare
+ 699 - 2
src/renderers/common/Renderer.js


+ 35 - 0
src/renderers/webgpu/WebGPURenderer.js

@@ -16,8 +16,30 @@ const debugHandler = {
 
 };
 */
+
+/**
+ * This renderer is the new alternative of `WebGLRenderer`. `WebGPURenderer` has the ability
+ * to target different backends. By default, the renderer tries to use a WebGPU backend if the
+ * browser supports WebGPU. If not, `WebGPURenderer` falls backs to a WebGL 2 backend.
+ *
+ * @augments module:Renderer~Renderer
+ */
 class WebGPURenderer extends Renderer {
 
+	/**
+	 * Constructs a new WebGPU renderer.
+	 *
+	 * @param {Object} parameters - The configuration parameter.
+	 * @param {Boolean} [parameters.logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
+	 * @param {Boolean} [parameters.alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
+	 * @param {Boolean} [parameters.depth=true] - Whether the default framebuffer should have a depth buffer or not.
+	 * @param {Boolean} [parameters.stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
+	 * @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. Set this parameter to any other integer value than 0
+	 * to overwrite the default.
+	 * @param {Boolean} [parameters.forceWebGL=false] - If set to `true`, the renderer uses it
+	 * WebGL 2 backend no matter if WebGPU is supported or not.
+	 */
 	constructor( parameters = {} ) {
 
 		let BackendClass;
@@ -45,8 +67,21 @@ class WebGPURenderer extends Renderer {
 		//super( new Proxy( backend, debugHandler ) );
 		super( backend, parameters );
 
+		/**
+		 * The generic default value is overwritten with the
+		 * standard node library for type mapping.
+		 *
+		 * @type {StandardNodeLibrary}
+		 */
 		this.library = new StandardNodeLibrary();
 
+		/**
+		 * This flag can be used for type testing.
+		 *
+		 * @type {Boolean}
+		 * @readonly
+		 * @default true
+		 */
 		this.isWebGPURenderer = true;
 
 	}

+ 8 - 1
utils/docs/jsdoc.config.json

@@ -8,6 +8,13 @@
     },
     "plugins": [ "plugins/markdown" ],
     "source": {
-        "include": [ "src/nodes", "src/loaders/nodes", "src/materials/nodes", "examples/jsm/tsl" ]
+        "include": [
+            "examples/jsm/tsl",
+            "src/loaders/nodes", 
+            "src/materials/nodes", 
+            "src/nodes", 
+            "src/renderers/common", 
+            "src/renderers/webgpu" 
+        ]
     }
 }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff

粤ICP备19079148号