### SSGIPluginPass Methods Source: https://webgi.dev/docs/classes/SSGIPluginPass Contains methods for managing the rendering lifecycle, including pre-render setup, the main rendering logic, and utility functions for state management. ```APIDOC ## beforeRender ### Description This function is called at the beginning of every frame when this pass is enabled. It's used for any setup required before the main rendering of the pass. ### Parameters * **scene**: IScene - The current scene. * **camera**: ICamera - The current camera. * **renderManager**: IRenderManager - The render manager instance. ### Returns * void ## render ### Description Performs the main rendering logic for the SSGI pass. ### Parameters * **renderer**: IWebGLRenderer - The WebGL renderer instance. * **writeBuffer**: WebGLRenderTarget - The buffer to write the rendered output to. * **readBuffer**: WebGLRenderTarget - The buffer to read input from. * **deltaTime**: number - The time elapsed since the last frame. * **maskActive**: boolean - Whether a mask is active. ### Returns * void ## setDirty ### Description Marks the pass as dirty, indicating that its state or output needs to be recalculated. ### Returns * void ## setGBufferUnpackExtension ### Description Sets the GBuffer unpack extension for the pass. ### Parameters * **extension**: undefined | MaterialExtension - The MaterialExtension to set. ### Returns * void ``` -------------------------------- ### enabled Property Source: https://webgi.dev/docs/classes/AnisotropyPlugin Gets or sets a value indicating whether the plugin is enabled. ```APIDOC ## Property: enabled enabled: boolean = true ``` -------------------------------- ### materialExtension Property Source: https://webgi.dev/docs/classes/AnisotropyPlugin Gets the material extension associated with this plugin. ```APIDOC ## Property: materialExtension materialExtension: MaterialExtension = ... ``` -------------------------------- ### AdvancedGroundPlugin Constructor Source: https://webgi.dev/docs/classes/AdvancedGroundPlugin Initializes a new instance of the AdvancedGroundPlugin class. ```APIDOC ## constructor AdvancedGroundPlugin ### Description Initializes a new instance of the AdvancedGroundPlugin class. ### Returns AdvancedGroundPlugin ``` -------------------------------- ### SSGIPlugin Constructor Source: https://webgi.dev/docs/classes/SSGIPlugin Initializes a new instance of the SSGIPlugin class. This plugin adds screen space reflections to the scene and can be configured with texture data type, size multiplier, and initial enabled state. ```APIDOC ## Constructor ### `SSGIPlugin` Initializes a new instance of the `SSGIPlugin` class. #### Parameters * **bufferType** (`TextureDataType`): Optional. The data type for the buffer. Defaults to `UnsignedByteType`. * **sizeMultiplier** (`number`): Optional. A multiplier for the size of the rendering target. Defaults to `1`. * **enabled** (`boolean`): Optional. Whether the plugin is enabled initially. Defaults to `true`. #### Returns * `SSGIPlugin`: The newly created SSGIPlugin instance. ``` -------------------------------- ### SSGIPlugin Methods Source: https://webgi.dev/docs/classes/SSGIPlugin Provides methods for managing the SSGIPlugin's lifecycle and rendering process, including internal rendering hooks, pass and target creation/disposal, and integration with the viewer. ```APIDOC ## Methods ### `_beforeRender` **Protected** This function is called every frame before the composer renders, if this pass is being used in the pipeline. #### Parameters * `_` (`IScene`): Optional. The scene object. * `_1` (`ICamera`): Optional. The camera object. * `_2` (`IRenderManager`): Optional. The render manager object. #### Returns * `boolean`: Indicates if the rendering should proceed. ``` ```APIDOC ### `_createPass` **Protected** Creates the internal rendering pass for SSGI. #### Returns * `SSGIPluginPass`: The created pass object. ``` ```APIDOC ### `_createTarget` **Protected** Creates or recreates the rendering target for SSGI. #### Parameters * `recreate` (`boolean`): Optional. If true, forces recreation of the target. Defaults to `true`. #### Returns * `void` ``` ```APIDOC ### `_disposeTarget` **Protected** Disposes of the rendering target used by SSGI. #### Returns * `void` ``` ```APIDOC ### `fromJSON` Loads SSGIPlugin settings from JSON data. #### Parameters * `data` (`any`): The JSON data to load. * `meta` (`any`): Optional. Metadata for loading. #### Returns * `null | SSGIPlugin | Promise`: The loaded SSGIPlugin instance or null if loading fails, potentially asynchronous. ``` ```APIDOC ### `onAdded` Called when the SSGIPlugin is added to the viewer. #### Parameters * `viewer` (`ThreeViewer`): The viewer instance. #### Returns * `void` ``` ```APIDOC ### `onRemove` Called when the SSGIPlugin is removed from the viewer. #### Parameters * `viewer` (`ThreeViewer`): The viewer instance. #### Returns * `void` ``` -------------------------------- ### SSVelocityMaterial Constructor Source: https://webgi.dev/docs/classes/SSVelocityMaterial Initializes a new instance of the SSVelocityMaterial class. ```APIDOC ## constructor ### Description Initializes a new instance of the SSVelocityMaterial class. ### Returns - SSVelocityMaterial: The newly created SSVelocityMaterial instance. ``` -------------------------------- ### OutlinePlugin Constructor Source: https://webgi.dev/docs/classes/OutlinePlugin Initializes a new instance of the OutlinePlugin. This plugin adds an extension to ScreenPass material and a RenderPass to render outlines and highlights. ```APIDOC ## new OutlinePlugin ### Description Initializes a new instance of the OutlinePlugin. This plugin adds an extension to ScreenPass material and a RenderPass to render outlines and highlights. ### Parameters * **enabled** (boolean) - Optional - Defaults to true. * **bufferType** (TextureDataType) - Optional - Defaults to UnsignedByteType. ### Returns * OutlinePlugin ``` -------------------------------- ### AdvancedGroundPlugin Methods Source: https://webgi.dev/docs/classes/AdvancedGroundPlugin Details the various methods available for interacting with and managing the AdvancedGroundPlugin. ```APIDOC ## Methods ### `Protected` _createMesh Creates the mesh for the ground. This is a protected method. ### `Protected` _extraUiConfig Provides extra UI configuration for the plugin. This is a protected method. ### `Protected` _onSceneUpdate Handles scene updates. This is a protected method. ### `Protected` _postFrame Performs actions after the frame is rendered. This is a protected method. ### `Protected` _preRender Performs actions before rendering the frame. This is a protected method. ### `Protected` _refreshMaterial Refreshes the material of the ground. This is a protected method. ### `Protected` _refreshTransform Refreshes the transform of the ground. This is a protected method. ### `Protected` _removeMaterial Removes the material from the ground. This is a protected method. ### autoResetShadows Resets the shadows automatically. ### bakeShadows Bakes shadows manually. Use this when `autoBakeShadows` is set to false. ### fromJSON Loads plugin data from a JSON object. ### onAdded Called when the plugin is added to the viewer. ### onRemove Called when the plugin is removed from the viewer. ### refresh Refreshes the plugin. ``` -------------------------------- ### OutlinePlugin Methods Source: https://webgi.dev/docs/classes/OutlinePlugin Contains methods for managing the plugin's lifecycle and rendering process, including creating render passes and targets, and handling viewer events. ```APIDOC ## OutlinePlugin Methods ### `Protected` Methods * **_createPass**(): OutlineRenderPass<"outline", undefined | OutlinePluginTarget> - Creates the render pass for outlines. * **_createTarget**(?recreate?: boolean): void - Creates or recreates the render target. * **_disposeTarget**(): void - Disposes of the render target. ### Public Methods * **onAdded**(viewer: ThreeViewer): void - Called when the plugin is added to the viewer. * **onRemove**(viewer: ThreeViewer): void - Called when the plugin is removed from the viewer. * **parsFragmentSnippet**(): string - Parses and returns the fragment shader snippet for outlines. * **setDirty**(): void - Marks the plugin as dirty, requiring a re-render. ``` -------------------------------- ### OutlineRenderPass Methods Source: https://webgi.dev/docs/classes/OutlineRenderPass Provides documentation for the methods available on the OutlineRenderPass class, including beforeRender, dispose, render, and setDirty. ```APIDOC ## beforeRender(scene: IScene, camera: ICamera, _: IRenderManager): void ### Description This function gets called at the beginning of every frame where this pass would be enabled. ### Parameters * **scene** (IScene) - The current scene. * **camera** (ICamera) - The current camera. * **_** (IRenderManager) - The render manager. ### Returns void ## dispose(): void ### Description Disposes of the resources used by this pass. ### Returns void ## render(renderer: IWebGLRenderer, writeBuffer?: null | WebGLRenderTarget>, _1?: WebGLRenderTarget>, deltaTime?: number, maskActive?: boolean): void ### Description Renders the pass to the target. ### Parameters * **renderer** (IWebGLRenderer) - The WebGL renderer. * **writeBuffer** (null | WebGLRenderTarget>) - Optional. The buffer to write the rendered output to. This is ignored or used as transmissionRenderTarget. * **_1** (WebGLRenderTarget>) - Optional. This parameter is ignored. * **deltaTime** (number) - Optional. The time elapsed since the last frame. * **maskActive** (boolean) - Optional. Indicates if the mask is active. ### Returns void ## setDirty(): void ### Description Set the pass as dirty. This is implementation specific to the pass/plugin. It generally calls all onDirty and set the viewer dirty. ### Returns void ``` -------------------------------- ### WatchHandsPlugin Methods Source: https://webgi.dev/docs/classes/WatchHandsPlugin Provides methods for managing the plugin's lifecycle and refreshing its state. ```APIDOC ## Methods ### onAdded * onAdded(viewer: ThreeViewer): void #### Description Called when the plugin is added to the viewer. #### Parameters * viewer: ThreeViewer - The ThreeViewer instance. #### Returns void ### onRemove * onRemove(viewer: ThreeViewer): void #### Description Called when the plugin is removed from the viewer. #### Parameters * viewer: ThreeViewer - The ThreeViewer instance. #### Returns void ### refresh * refresh(): void #### Description Refreshes the state of the watch hands. #### Returns void ``` -------------------------------- ### onAdded Method Source: https://webgi.dev/docs/classes/AnisotropyPlugin Callback function executed when the plugin is added to the viewer. ```APIDOC ## Method: onAdded onAdded(v: ThreeViewer): void #### Parameters * v: ThreeViewer #### Returns void ``` -------------------------------- ### SSReflectionPlugin Constructor Source: https://webgi.dev/docs/classes/SSReflectionPlugin Initializes a new instance of the SSReflectionPlugin class. This plugin adds screen space reflections to the scene. ```APIDOC ## new SSReflectionPlugin ### Description Initializes a new instance of the SSReflectionPlugin class. This plugin adds screen space reflections to the scene. ### Parameters * **inlineShaderRayTrace** (boolean) - Optional - Defaults to `true`. * **bufferType** (TextureDataType) - Optional - Defaults to `UnsignedByteType`. * **sizeMultiplier** (number) - Optional - Defaults to `1`. * **enabled** (boolean) - Optional - Defaults to `true`. ### Returns * SSReflectionPlugin ``` -------------------------------- ### SSGIPluginPass Constructor Source: https://webgi.dev/docs/classes/SSGIPluginPass Initializes a new instance of the SSGIPluginPass class. This constructor can optionally take a target render target and a boolean to enable/disable GI. ```APIDOC ## new SSGIPluginPass ### Description Initializes a new instance of the SSGIPluginPass class. ### Parameters * **pid**: string - The unique identifier for the pass. * **target?**: ValOrFunc>> - Optional. The render target to use for rendering. * **giEnabled?**: boolean - Optional. Whether Global Illumination is enabled. Defaults to true. ### Returns * SSGIPluginPass - A new instance of the SSGIPluginPass. ``` -------------------------------- ### BloomPlugin Constructor Source: https://webgi.dev/docs/classes/BloomPlugin Initializes a new instance of the BloomPlugin class. The plugin can be optionally enabled upon creation. ```APIDOC ## new BloomPlugin ### Description Initializes a new instance of the BloomPlugin class. The plugin can be optionally enabled upon creation. ### Parameters * **enabled** (boolean) - Optional - Defaults to true. Indicates if the plugin should be enabled. ### Returns * **BloomPlugin** - The newly created BloomPlugin instance. ``` -------------------------------- ### AnisotropyPlugin Constructor Source: https://webgi.dev/docs/classes/AnisotropyPlugin Initializes a new instance of the AnisotropyPlugin class. ```APIDOC ## Constructor ### new AnisotropyPlugin() #### Returns AnisotropyPlugin ``` -------------------------------- ### SSContactShadowsPlugin Constructor Source: https://webgi.dev/docs/classes/SSContactShadowsPlugin Initializes a new instance of the SSContactShadowsPlugin class. The plugin adds screen space ray traced contact shadows and a UI to the material settings. ```APIDOC ## Constructor ### Description Initializes a new instance of the SSContactShadowsPlugin class. The plugin adds screen space ray traced contact shadows and a UI to the material settings. ### Signature `new SSContactShadowsPlugin(enabled?: boolean): SSContactShadowsPlugin` ### Parameters * **enabled** (boolean) - Optional - Defaults to true. Determines if the plugin is enabled upon initialization. ### Returns * **SSContactShadowsPlugin** - An instance of the SSContactShadowsPlugin. ``` -------------------------------- ### SSReflectionPluginPass Constructor Source: https://webgi.dev/docs/classes/SSReflectionPluginPass Initializes a new instance of the SSReflectionPluginPass class. It accepts a pass ID, an optional target render target, and an optional boolean to enable inline shader ray tracing. ```APIDOC ## new SSReflectionPluginPass ### Description Initializes a new instance of the SSReflectionPluginPass class. ### Parameters * **pid**: string - The unique identifier for the pass. * **target?**: ValOrFunc>> - Optional. The target render target for the pass. * **inlineShaderRayTrace?**: boolean - Optional. Enables or disables inline shader ray tracing. Defaults to true. ### Returns * SSReflectionPluginPass - A new instance of the SSReflectionPluginPass. ``` -------------------------------- ### SSReflectionPluginPass Methods Source: https://webgi.dev/docs/classes/SSReflectionPluginPass Provides documentation for the public methods of the SSReflectionPluginPass class, including beforeRender, render, setDirty, and setGBufferUnpackExtension. ```APIDOC ## beforeRender ### Description This method is called at the beginning of every frame when the pass is enabled. ### Parameters * **scene**: IScene - The current scene. * **camera**: ICamera - The current camera. * **renderManager**: IRenderManager - The render manager. ### Returns * void ``` ```APIDOC ## render ### Description Renders the pass. ### Parameters * **renderer**: IWebGLRenderer - The WebGL renderer. * **writeBuffer**: WebGLRenderTarget - The buffer to write the rendered output to. * **readBuffer**: WebGLRenderTarget - The buffer to read from. * **deltaTime**: number - The time elapsed since the last frame. * **maskActive**: boolean - Indicates if the mask is active. ### Returns * void ``` ```APIDOC ## setDirty ### Description Marks the pass as dirty, indicating that its state has changed and requires re-rendering. ### Returns * void ``` ```APIDOC ## setGBufferUnpackExtension ### Description Sets the GBuffer unpack extension for the pass. ### Parameters * **extension**: undefined | MaterialExtension - The MaterialExtension to set. ### Returns * void ``` -------------------------------- ### TemporalAAPluginPass Methods Source: https://webgi.dev/docs/classes/TemporalAAPluginPass Provides documentation for the core methods of the TemporalAAPluginPass class, including rendering, size updates, and camera property adjustments. ```APIDOC ## onSizeUpdate() ### Description Updates the pass's internal state when the rendering size changes. ### Returns void ## render(renderer: IWebGLRenderer, writeBuffer?: null | WebGLRenderTarget>, readBuffer?: WebGLRenderTarget>, deltaTime?: number, maskActive?: boolean): void ### Description Executes the rendering logic for this pass. It takes the renderer, input/output buffers, and timing information to perform its operation. ### Parameters * **renderer**: IWebGLRenderer - The WebGL renderer instance. * **writeBuffer**: null | WebGLRenderTarget> (Optional) - The buffer to write the rendered output to. * **readBuffer**: WebGLRenderTarget> (Optional) - The buffer to read input from. * **deltaTime**: number (Optional) - The time elapsed since the last frame. * **maskActive**: boolean (Optional) - Indicates if a mask is currently active. ### Returns void ## setSize(width: number, height: number): void ### Description Sets the dimensions (width and height) for the pass's render target. ### Parameters * **width**: number - The new width. * **height**: number - The new height. ### Returns void ## updateCameraProperties(camera?: Camera): void ### Description Updates the pass with properties from the current camera, which might be necessary for certain rendering effects. ### Parameters * **camera**: Camera (Optional) - The camera whose properties should be updated. ### Returns void ``` -------------------------------- ### onBeforeRender Method Source: https://webgi.dev/docs/classes/SSVelocityMaterial Callback function executed before the material is rendered. ```APIDOC ## onBeforeRender ### Description This method is a callback that is executed automatically before the material is rendered. It allows for custom logic or updates prior to the rendering process. ### Parameters - **_r** (WebGLRenderer): The WebGL renderer instance. - **_s** (Scene): The scene being rendered. - **_c** (Camera): The camera used for rendering. - **_geometry** (BufferGeometry): The geometry being rendered. - **object** (IObject3D): The object associated with the material. - **group** (Group): The group the object belongs to. ### Returns - void: This method does not return any value. ``` -------------------------------- ### SSReflectionPlugin Methods Source: https://webgi.dev/docs/classes/SSReflectionPlugin Provides details on the methods available for interacting with the SSReflectionPlugin, including lifecycle and rendering hooks. ```APIDOC ## SSReflectionPlugin Methods ### `_beforeRender` #### Description This function is called every frame before composer render, if this pass is being used in the pipeline. #### Parameters * **_** (IScene) - Optional * **_1** (ICamera) - Optional * **_2** (IRenderManager) - Optional #### Returns * boolean ### `_createPass` #### Description Creates the SSReflectionPluginPass. #### Returns * SSReflectionPluginPass ### `_createTarget` #### Description Creates or recreates the target for the SSReflectionPlugin. #### Parameters * **recreate** (boolean) - Optional - Defaults to `true`. #### Returns * void ### `_disposeTarget` #### Description Disposes of the target associated with the SSReflectionPlugin. #### Returns * void ### `fromJSON` #### Description Loads SSReflectionPlugin settings from a JSON object. #### Parameters * **data** (any) * **meta** (any) - Optional #### Returns * null | SSReflectionPlugin | Promise ### `onAdded` #### Description Called when the plugin is added to the viewer. #### Parameters * **viewer** (ThreeViewer) #### Returns * void ### `onRemove` #### Description Called when the plugin is removed from the viewer. #### Parameters * **viewer** (ThreeViewer) #### Returns * void ``` -------------------------------- ### WatchHandsPlugin Constructor Source: https://webgi.dev/docs/classes/WatchHandsPlugin Creates an instance of WatchHandsPlugin. This constructor initializes a THREE.EventDispatcher object. ```APIDOC ## new WatchHandsPlugin() ### Description Creates an instance of WatchHandsPlugin. This constructor initializes a THREE.EventDispatcher object. ### Returns - WatchHandsPlugin: An instance of the WatchHandsPlugin. ``` -------------------------------- ### OutlinePlugin Properties Source: https://webgi.dev/docs/classes/OutlinePlugin Provides access to various properties for configuring the outline and highlight effects, such as color, intensity, thickness, and dynamic selection. ```APIDOC ## OutlinePlugin Properties ### Properties * **color** (Color) - The color of the outline. * **debugOutline** (boolean) - Enables debug mode for outlines. Defaults to false. * **enabled** (boolean) - Enables or disables the plugin. * **enableDynamicSelection** (boolean) - Enables dynamic selection for outlines. Defaults to true. * **enableHighlight** (boolean) - Enables highlighting of selected objects. Defaults to false. * **highlightTransparency** (number) - Controls the transparency of the highlight effect. Defaults to 0.84. * **intensity** (number) - The intensity of the outline effect. Defaults to 2. * **mouseInOutAnimationEnabled** (boolean) - Enables animation when the mouse enters or leaves an object. Defaults to true. * **thickness** (number) - The thickness of the outline. Defaults to 2. * **transparency** (number) - The transparency of the highlight. Defaults to 0. Use `highlightTransparency` instead. ### Accessors * **outlineColor** (number) - Gets or sets the outline color. * **outlineIntensity** (number) - Gets or sets the outline intensity. ### Readonly Properties * **bufferType** (TextureDataType) * **extraUniforms** (object) - Contains uniforms for highlight and outline effects. * **material** (ShaderMaterial) * **passId** (string) - The ID of the pass, set to 'outline'. ### Static Readonly Properties * **OldPluginType** (string) - 'Outline' * **PluginType** (string) - 'OutlinePlugin' ``` -------------------------------- ### BloomPlugin Methods Source: https://webgi.dev/docs/classes/BloomPlugin Provides details on the methods available for interacting with the BloomPlugin, including internal pass creation and lifecycle management. ```APIDOC ## _createPass ### Description Creates the internal pass object for the BloomPlugin. ### Returns * **BloomPluginPass<"bloom">** - The created pass object. ## onAdded ### Description Called when the plugin is added to the viewer. ### Parameters * **viewer** (ThreeViewer) - The ThreeViewer instance. ### Returns * **void** ## onRemove ### Description Called when the plugin is removed from the viewer. ### Parameters * **viewer** (ThreeViewer) - The ThreeViewer instance. ### Returns * **void** ## updateGBufferFlags ### Description Updates the GBuffer flags based on the provided data and context. ### Parameters * **data** (Vector4) - The data to update the flags with. * **c** (GBufferUpdaterContext) - The context for updating the GBuffer. ### Returns * **void** ``` -------------------------------- ### TemporalAAPlugin Constructor Source: https://webgi.dev/docs/classes/TemporalAAPlugin Initializes a new instance of the TemporalAAPlugin class. The plugin can be optionally enabled upon creation. ```APIDOC ## new TemporalAAPlugin ### Description Initializes a new instance of the TemporalAAPlugin class. ### Parameters * **enabled** (boolean) - Optional - Defaults to true. Specifies whether the plugin should be enabled by default. ### Returns * TemporalAAPlugin - A new instance of the TemporalAAPlugin. ``` -------------------------------- ### OutlineRenderPass Constructor Source: https://webgi.dev/docs/classes/OutlineRenderPass Initializes a new instance of the OutlineRenderPass class. This constructor sets up the pass with a unique ID, a mechanism to select objects for outlining, a target render target, and an override material. ```APIDOC ## new OutlineRenderPass(passId: TP, _getSelectedObjectOrMaterial: () => SelectionObject | SelectionObjectArr, target: ValOrFunc, overrideMaterial: ShaderMaterial): OutlineRenderPass ### Description Initializes a new instance of the OutlineRenderPass class. ### Type Parameters * TP extends string = string * T extends undefined | WebGLRenderTarget> = undefined | WebGLRenderTarget> ### Parameters * **passId** (TP) - The unique identifier for this pass. * **_getSelectedObjectOrMaterial** (() => SelectionObject | SelectionObjectArr) - A function that returns the object or array of objects to be outlined. * **target** (ValOrFunc) - The render target where the output of this pass will be rendered. * **overrideMaterial** (ShaderMaterial) - The material to use for rendering the outlined objects. ### Returns OutlineRenderPass ``` -------------------------------- ### BloomPlugin Static Methods Source: https://webgi.dev/docs/classes/BloomPlugin Details on static methods for managing BloomPlugin data, such as adding bloom effects to materials. ```APIDOC ## AddBloomData ### Description Adds bloom data to a material, optionally enabling the effect and marking it as dirty. ### Parameters * **material** (IMaterial) - The material to add bloom data to. * **params** (object) - Optional. An object containing parameters, such as `enable` (boolean). * **setDirty** (boolean) - Optional - Defaults to true. Indicates if the material should be marked as dirty after modification. ### Returns * **undefined | null | { enable?: boolean }** - Returns the bloom enable state or null/undefined. ``` -------------------------------- ### tryComputeTangents Method Source: https://webgi.dev/docs/classes/AnisotropyPlugin Attempts to compute tangents for the given object and materials. ```APIDOC ## Method: tryComputeTangents tryComputeTangents(m: IObject3D, mats: IMaterial[]): void #### Parameters * m: IObject3D * mats: IMaterial[] #### Returns void ``` -------------------------------- ### DepthOfFieldPlugin Methods Source: https://webgi.dev/docs/classes/DepthOfFieldPlugin Details the methods available for interacting with the DepthOfFieldPlugin, such as rendering, hit detection, and focal point manipulation. ```APIDOC ## DepthOfFieldPlugin Methods ### `_beforeRender` * **Description:** Called every frame before the composer renders, if the pass is active in the pipeline. * **Parameters:** * **scene** (IScene): The current scene. * **camera** (ICamera): The current camera. * **renderManager** (IRenderManager): The render manager instance. * **Returns:** boolean - True if rendering should proceed, false otherwise. ### `_createPass` * **Description:** Creates and returns a new DepthOfFieldPluginPass. * **Returns:** DepthOfFieldPluginPass<"depthOfField"> ### `_onObjectHit` * **Description:** Handles object hit events. * **Parameters:** * **e** (any): The event object. * **Returns:** void ### `getFocalPoint` * **Description:** Retrieves the current focal point of the depth of field effect. * **Returns:** Vector3 - The current focal point. ### `onAdded` * **Description:** Lifecycle method called when the plugin is added to the viewer. * **Parameters:** * **viewer** (ThreeViewer): The Three.js viewer instance. * **Returns:** void ### `onRemove` * **Description:** Lifecycle method called when the plugin is removed from the viewer. * **Parameters:** * **viewer** (ThreeViewer): The Three.js viewer instance. * **Returns:** void ### `setFocalPoint` * **Description:** Sets the focal point for the depth of field effect. * **Parameters:** * **p** (Vector3): The new focal point coordinates. * **fade** (boolean) - Optional - Defaults to true. Whether to animate the focal point change. * **showGizmo** (boolean) - Optional - Defaults to false. Whether to display a gizmo for the focal point. ``` -------------------------------- ### SSContactShadowsPlugin Methods Source: https://webgi.dev/docs/classes/SSContactShadowsPlugin Details the methods available for interacting with and managing the SSContactShadowsPlugin, such as lifecycle hooks and update functions. ```APIDOC ## Methods ### `onAdded(v: ThreeViewer): void` * **Description**: Lifecycle method called when the plugin is added to the viewer. * **Parameters**: * **v** (`ThreeViewer`) - The viewer instance. * **Returns**: `void` ### `onRemove(v: ThreeViewer): void` * **Description**: Lifecycle method called when the plugin is removed from the viewer. * **Parameters**: * **v** (`ThreeViewer`) - The viewer instance. * **Returns**: `void` ### `setDirty(): void` * **Description**: Marks the plugin's settings as dirty, indicating a need for update. * **Returns**: `void` ### `setGBufferUnpackExtension(extension: undefined | MaterialExtension): void` * **Description**: Sets the GBuffer unpack extension for the plugin. * **Parameters**: * **extension** (`undefined | MaterialExtension`) - The MaterialExtension to set. * **Returns**: `void` ``` -------------------------------- ### AdvancedGroundPlugin Static Properties Source: https://webgi.dev/docs/classes/AdvancedGroundPlugin Provides static properties for the AdvancedGroundPlugin, such as its type identifier. ```APIDOC ## Static Properties ### `Static` `Readonly` PluginType Type: string Value: 'AdvancedGroundPlugin' Description: The type identifier for the AdvancedGroundPlugin. ``` -------------------------------- ### DepthOfFieldPlugin Constructor Source: https://webgi.dev/docs/classes/DepthOfFieldPlugin Initializes a new instance of the DepthOfFieldPlugin. It can be enabled or disabled, and edit mode can be toggled. ```APIDOC ## new DepthOfFieldPlugin ### Description Initializes a new instance of the DepthOfFieldPlugin. It can be enabled or disabled, and edit mode can be toggled. ### Parameters * **enabled** (boolean) - Optional - Defaults to true. Indicates if the plugin should be enabled. * **enableEdit** (boolean) - Optional - Defaults to false. Indicates if edit mode should be enabled. ``` -------------------------------- ### VelocityBufferPlugin Methods Source: https://webgi.dev/docs/classes/VelocityBufferPlugin Provides methods for managing the VelocityBufferPlugin, including lifecycle events and internal rendering processes. ```APIDOC ## VelocityBufferPlugin Methods ### `Protected` _beforeRender #### Description This function is called every frame before the composer renders, if this pass is being used in the pipeline. #### Parameters - **scene** (IScene) - **camera** (ICamera) - **renderManager** (IRenderManager) #### Returns - boolean ### `Protected` _createPass #### Description Creates the pass for the VelocityBufferPlugin. #### Returns - any ### `Protected` _createTarget #### Parameters - **recreate** (boolean) - Optional - Defaults to true. #### Returns - void ### `Protected` _disposeTarget #### Returns - void ### onAdded #### Parameters - **viewer** (ThreeViewer) #### Returns - void ### onRemove #### Parameters - **viewer** (ThreeViewer) #### Returns - void ### setDirty #### Returns - void ``` -------------------------------- ### PluginType Static Property Source: https://webgi.dev/docs/classes/AnisotropyPlugin The type identifier for this plugin. ```APIDOC ## Static Property: PluginType PluginType: "AnisotropyPlugin" = 'AnisotropyPlugin' ``` -------------------------------- ### TemporalAAPluginPass Constructor Source: https://webgi.dev/docs/classes/TemporalAAPluginPass Initializes a new instance of the TemporalAAPluginPass class. This constructor is used to set up the pass with a unique ID, a target render buffer, and an optional background application flag. ```APIDOC ## new TemporalAAPluginPass(pid: Tid, target: ValOrFunc>>, applyOnBackground?: boolean): TemporalAAPluginPass ### Parameters * **pid**: Tid - Unique identifier for the pass. * **target**: ValOrFunc>> - The render target where the pass's output will be written. * **applyOnBackground**: boolean (Optional, defaults to false) - Determines if the pass should apply its effect when the application is in the background. ``` -------------------------------- ### DepthOfFieldPluginPass Methods Source: https://webgi.dev/docs/classes/DepthOfFieldPluginPass Provides details on the methods available for the DepthOfFieldPluginPass class, including the render method. ```APIDOC ## render(renderer: IWebGLRenderer, writeBuffer?: null | WebGLRenderTarget>, readBuffer?: WebGLRenderTarget>, deltaTime?: number, maskActive?: boolean): void ### Description Renders the depth-of-field effect. This method is called as part of the rendering pipeline. ### Parameters * **renderer** (IWebGLRenderer) - The WebGL renderer instance. * **writeBuffer** (null | WebGLRenderTarget>) - Optional. The buffer to write the rendered output to. * **readBuffer** (WebGLRenderTarget>) - Optional. The buffer to read input from. * **deltaTime** (number) - Optional. The time elapsed since the last frame. * **maskActive** (boolean) - Optional. Indicates if a mask is active. ``` -------------------------------- ### VelocityBufferPlugin Constructor Source: https://webgi.dev/docs/classes/VelocityBufferPlugin Initializes a new instance of the VelocityBufferPlugin class. This plugin adds a pre-render pass to render the normal buffer to a render target for postprocessing. ```APIDOC ## new VelocityBufferPlugin ### Description Initializes a new instance of the VelocityBufferPlugin class. This plugin adds a pre-render pass to render the normal buffer to a render target for postprocessing. ### Parameters #### Parameters - **bufferType** (TextureDataType) - Optional - Defaults to UnsignedByteType. - **enabled** (boolean) - Optional - Defaults to true. - **_attachToTaa** (boolean) - Optional - Defaults to true. ### Returns - VelocityBufferPlugin ``` -------------------------------- ### AdvancedGroundPlugin Properties Source: https://webgi.dev/docs/classes/AdvancedGroundPlugin Provides access to various properties of the AdvancedGroundPlugin, controlling aspects like shadow baking, reflections, and UI configuration. ```APIDOC ## Properties ### _mesh Type: Reflector2 & PlaneGeometry> ### autoBakeShadows Type: boolean Default: true Description: When true, shadows are baked automatically on scene update. Set to `false` to trigger baking manually with `bakeShadows()`. ### autoFrustumSize Type: boolean Default: true ### bakedShadows Type: boolean Default: true ### groundReflection Type: boolean Default: false ### physicalReflections Type: boolean Default: false ### planarReflections Type: boolean ### uiConfig Type: UiObjectConfig ``` -------------------------------- ### TemporalAAPlugin.onAdded Method Source: https://webgi.dev/docs/classes/TemporalAAPlugin A public method called when the plugin is added to the viewer. ```APIDOC ## onAdded ### Description This method is called when the plugin is added to the viewer. ### Parameters * **viewer** (ThreeViewer) - The ThreeViewer instance to which the plugin is added. ### Returns * void ``` -------------------------------- ### WatchHandsPlugin Properties Source: https://webgi.dev/docs/classes/WatchHandsPlugin Exposes properties for configuring and managing watch hands, including axis, enabled state, hand definitions, offsets, and regex matching. ```APIDOC ## Properties ### analog - **analog** (boolean): Defaults to `true`. ### axis - **axis** (string): Specifies the axis for hand rotation. Accepts 'y', 'x', or 'z'. Defaults to 'y'. ### dependencies - **dependencies** (never[]): An empty array for dependencies. Defaults to `[]`. ### enabled - **enabled** (boolean): Controls whether the plugin is active. Defaults to `true`. ### hands - **hands** (Array<{ object: Object3D; type: "hour" | "minute" | "second" }>): An array defining the watch hands, each with an `object` and a `type` ('hour', 'minute', or 'second'). Defaults to `[]`. ### hour - **hour** (string): Regex pattern for identifying hour hands. Defaults to '.*hour.*'. ### hourOffset - **hourOffset** (number): Offset in degrees for the hour hand. Defaults to `0`. ### invertAxis - **invertAxis** (boolean): Inverts the rotation axis. Defaults to `false`. ### minute - **minute** (string): Regex pattern for identifying minute hands. Defaults to '.*minute.*'. ### minuteOffset - **minuteOffset** (number): Offset in degrees for the minute hand. Defaults to `0`. ### regex - **regex** (boolean): Enables or disables regex matching for hands. Defaults to `true`. ### second - **second** (string): Regex pattern for identifying second hands. Defaults to '.*second.*'. ### secondOffset - **secondOffset** (number): Offset in degrees for the second hand. Defaults to `0`. ### `Static` `Readonly` PluginType - **PluginType** (string): A static, read-only property indicating the type of the plugin. Value is 'WatchHandsPlugin'. ``` -------------------------------- ### SSGIPluginPass Properties Source: https://webgi.dev/docs/classes/SSGIPluginPass Exposes various properties to configure the behavior and appearance of the SSGI effect, including rendering parameters, pass dependencies, and enabling/disabling features. ```APIDOC ## SSGIPluginPass Properties ### _gbufferUnpackExtension * **Type**: undefined | MaterialExtension * **Description**: Extension for GBuffer unpacking. ### after * **Type**: string[] * **Description**: Passes that should run before this pass. ### autoRadius * **Type**: boolean * **Default**: true * **Description**: Automatically adjusts the radius for calculations. ### before * **Type**: string[] * **Description**: Passes that should run after this pass. ### bias * **Type**: number * **Default**: 0.001 * **Description**: Bias value for calculations. ### bilateralPass * **Type**: BilateralFilterPass (Readonly) * **Description**: The bilateral filter pass used internally. ### falloff * **Type**: number * **Default**: 0.7 * **Description**: Falloff value for the effect. ### giEnabled * **Type**: boolean * **Default**: true * **Description**: Whether Global Illumination is enabled. ### intensity * **Type**: number * **Default**: 2 * **Description**: Intensity of the GI effect. ### materialExtension * **Type**: MaterialExtension (Readonly) * **Description**: The material extension used by this pass. ### objectRadius * **Type**: number * **Default**: 1 * **Description**: Radius for object-related calculations. ### passId * **Type**: string (Readonly) * **Description**: Unique ID for the pass, used for ordering in the pipeline. ### power * **Type**: number * **Default**: 1.1 * **Description**: Power value for calculations. ### rayCount * **Type**: number * **Default**: 4 * **Description**: Number of rays to cast for GI calculations. ### renderWithCamera * **Type**: boolean * **Default**: true * **Description**: Whether to render with the camera. ### required * **Type**: string[] * **Description**: Passes required to be present in the pipeline for this pass to run. ### smoothEnabled * **Type**: boolean * **Default**: true * **Description**: Whether smoothing is enabled. ### split * **Type**: number * **Default**: 0 * **Description**: Split value for calculations. ### stepCount * **Type**: number * **Default**: 8 * **Description**: Number of steps for calculations. ### target * **Type**: ValOrFunc>> (Optional) * **Description**: The render target to use for rendering. ### tolerance * **Type**: number * **Default**: 1 * **Description**: Tolerance value for calculations. ``` -------------------------------- ### BloomPluginPass render Method Source: https://webgi.dev/docs/classes/BloomPluginPass Renders the bloom effect using the provided WebGL renderer and buffers. This method executes the core rendering logic for the bloom pass. ```APIDOC ## render * render(renderer: IWebGLRenderer, writeBuffer?: null | WebGLRenderTarget>, readBuffer?: WebGLRenderTarget>, deltaTime?: number, maskActive?: boolean): void ### Description Renders the bloom effect. ### Parameters * **renderer** (IWebGLRenderer) - The WebGL renderer instance. * **writeBuffer** (null | WebGLRenderTarget>) - Optional. The render target to write the output to. * **readBuffer** (WebGLRenderTarget>) - Optional. The render target to read from. * **deltaTime** (number) - Optional. The time elapsed since the last frame. * **maskActive** (boolean) - Optional. Indicates if a mask is active. ### Returns * void ``` -------------------------------- ### setDirty Method Source: https://webgi.dev/docs/classes/AnisotropyPlugin Marks the plugin as dirty, indicating that its state needs to be updated. ```APIDOC ## Method: setDirty setDirty(): void #### Returns void ``` -------------------------------- ### AdvancedGroundPlugin Accessors Source: https://webgi.dev/docs/classes/AdvancedGroundPlugin Provides access to the shadowBaker accessor for the AdvancedGroundPlugin. ```APIDOC ## Accessors ### shadowBaker Type: undefined | ShadowMapBaker Description: Gets the shadow baker instance. ### Returns undefined | ShadowMapBaker ``` -------------------------------- ### WebGi Plugin Types Source: https://webgi.dev/docs/variables/webgiPlugins This code defines the type for an array of WebGi plugins. It includes various plugins for rendering effects and features. ```typescript webgiPlugins: ( typeof TemporalAAPlugin | typeof VelocityBufferPlugin | typeof BloomPlugin | typeof DepthOfFieldPlugin | typeof SSContactShadowsPlugin | typeof SSReflectionPlugin | typeof OutlinePlugin | typeof SSGIPlugin | typeof AnisotropyPlugin | typeof AdvancedGroundPlugin | typeof WatchHandsPlugin )[] = ... ``` -------------------------------- ### SSContactShadowsPlugin Properties Source: https://webgi.dev/docs/classes/SSContactShadowsPlugin Provides details on the configurable properties of the SSContactShadowsPlugin, including its enabled state, intensity, and debugging options. ```APIDOC ## Properties ### `dependencies` * **Type**: `typeof GBufferPlugin[]` * **Description**: Specifies the plugin dependencies. ### `enabled` * **Type**: `boolean` * **Default**: `true` * **Description**: Indicates whether the plugin is currently active. ### `intensity` * **Type**: `number` * **Default**: `1` * **Description**: Controls the intensity of the contact shadows effect. ### `materialExtension` * **Type**: `MaterialExtension` * **Description**: Readonly. The material extension used for contact shadows. ### `onlySSCSDebug` * **Type**: `boolean` * **Default**: `false` * **Description**: Enables debug mode for screen space contact shadows only. ### `radius` * **Type**: `number` * **Default**: `0.015` * **Description**: The radius for calculating contact shadows. ### `stepCount` * **Type**: `number` * **Default**: `2` * **Description**: The number of steps used in the contact shadow calculation. ### `tolerance` * **Type**: `number` * **Default**: `1.5` * **Description**: The tolerance value for the contact shadow calculation. ### `OldPluginType` * **Type**: `"SSContactShadowsPlugin"` * **Description**: Static Readonly. The old type identifier for this plugin. ### `PluginType` * **Type**: `"SSContactShadows"` * **Description**: Static Readonly. The type identifier for this plugin. ``` -------------------------------- ### SSGIPluginPass Accessors Source: https://webgi.dev/docs/classes/SSGIPluginPass Provides access to update internal uniform states, ensuring rendering consistency. ```APIDOC ## uniformsNeedUpdate ### Description Sets the uniformsNeedUpdate flag to true, indicating that shader uniforms need to be updated. ### Method * **set**(value: true) ### Parameters * **value**: true - Must be set to true. ### Returns * void ``` -------------------------------- ### BloomPluginPass Constructor Source: https://webgi.dev/docs/classes/BloomPluginPass Initializes a new instance of the BloomPluginPass class. This constructor is used to create a bloom pass with a specified ID and an optional maximum intensity. ```APIDOC ## new BloomPluginPass(pid: Tid, maxIntensity?: number): BloomPluginPass ### Description Initializes a new instance of the BloomPluginPass class. ### Parameters * **pid** (Tid) - The unique identifier for the pass. * **maxIntensity** (number) - Optional. The maximum intensity for the bloom effect. Defaults to 16. ### Returns * BloomPluginPass - An instance of the BloomPluginPass. ``` -------------------------------- ### DepthOfFieldPlugin Properties Source: https://webgi.dev/docs/classes/DepthOfFieldPlugin Exposes various properties of the DepthOfFieldPlugin, including configuration, dependencies, and state. ```APIDOC ## DepthOfFieldPlugin Properties ### `_focalPointHit` * **Type:** Vector3 * **Description:** Protected property storing the focal point hit. ### `crossFadeTime` * **Type:** number * **Default:** 200 * **Description:** The time in milliseconds for cross-fading effects. ### `dependencies` * **Type:** typeof GBufferPlugin[] * **Description:** An array of plugin dependencies, typically GBufferPlugin. ### `enableEdit` * **Type:** boolean * **Default:** false * **Description:** Flag to enable or disable edit mode for the plugin. ### `passId` * **Type:** "depthOfField" * **Description:** Readonly identifier for the depth of field pass. ### `uiConfig` * **Type:** UiObjectConfig * **Description:** Configuration object for the plugin's UI elements. ### `OldPluginType` * **Type:** "DepthOfFieldPlugin" * **Description:** Static readonly property representing the old plugin type name. ### `PluginType` * **Type:** "DepthOfField" * **Description:** Static readonly property representing the plugin type name. ``` -------------------------------- ### TemporalAAPlugin._beforeRender Method Source: https://webgi.dev/docs/classes/TemporalAAPlugin A protected method called before the composer renders the scene. It's executed if the pass is part of the rendering pipeline. ```APIDOC ## _beforeRender ### Description This protected method is called every frame before the composer renders. It is executed if this pass is being used in the pipeline. ### Parameters * **scene** (IScene) - The current scene. * **camera** (ICamera) - The current camera. * **renderManager** (IRenderManager) - The render manager instance. ### Returns * boolean - Indicates if the rendering should proceed. ```