### Import FocusShader Source: https://threejs.org/docs/pages/module-FocusShader.html Import the FocusShader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { FocusShader } from 'three/addons/shaders/FocusShader.js'; ``` -------------------------------- ### Import HalftoneShader Source: https://threejs.org/docs/pages/module-HalftoneShader.html Import the HalftoneShader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { HalftoneShader } from 'three/addons/shaders/HalftoneShader.js'; ``` -------------------------------- ### Basic Render Pipeline Setup Source: https://threejs.org/docs/TSL.html Demonstrates the basic setup of a RenderPipeline, including creating the pipeline, a scene pass, and setting the output. This is the foundation for building custom rendering workflows. ```javascript import * as THREE from 'three/webgpu'; import { pass } from 'three/tsl'; // Create the render pipeline const renderPipeline = new THREE.RenderPipeline( renderer ); // Create a scene pass const scenePass = pass( scene, camera ); // Set the output renderPipeline.outputNode = scenePass; // In the animation loop function animate() { renderPipeline.render(); } ``` -------------------------------- ### setupHardwareClipping Source: https://threejs.org/docs/pages/ClippingNode.html Setups hardware clipping. ```APIDOC ## .setupHardwareClipping( unionPlanes: Array., builder: NodeBuilder ) : Node ### Description Setups hardware clipping. ### Parameters * **unionPlanes** (Array.) - The union planes. * **builder** (NodeBuilder) - The current node builder. ### Returns The result node. ``` -------------------------------- ### Import ExposureShader Source: https://threejs.org/docs/pages/module-ExposureShader.html Import the ExposureShader addon explicitly. Refer to the installation guide for addon setup. ```js import { ExposureShader } from 'three/addons/shaders/ExposureShader.js'; ``` -------------------------------- ### Import BasicShader Source: https://threejs.org/docs/pages/module-BasicShader.html Import the BasicShader addon explicitly. Refer to the installation guide for more details. ```js import { BasicShader } from 'three/addons/shaders/BasicShader.js'; ``` -------------------------------- ### setupDefault Source: https://threejs.org/docs/pages/ClippingNode.html Setups the default clipping. ```APIDOC ## .setupDefault( intersectionPlanes: Array., unionPlanes: Array. ) : Node ### Description Setups the default clipping. ### Parameters * **intersectionPlanes** (Array.) - The intersection planes. * **unionPlanes** (Array.) - The union planes. ### Returns The result node. ``` -------------------------------- ### DotScreenNode.setup Method Source: https://threejs.org/docs/pages/DotScreenNode.html The setup method is responsible for preparing the node's TSL code for rendering. It overrides the base TempNode's setup method. ```APIDOC ## Methods ### .setup( builder : NodeBuilder ) : ShaderCallNodeInternal This method is used to setup the effect's TSL code. **builder** The current node builder. **Overrides:** [TempNode#setup](TempNode.html#setup) ``` -------------------------------- ### setup Source: https://threejs.org/docs/pages/ClippingNode.html Setups the node depending on the selected scope. ```APIDOC ## .setup( builder: NodeBuilder ) : Node ### Description Setups the node depending on the selected scope. ### Parameters * **builder** (NodeBuilder) - The current node builder. ### Overrides [Node#setup](Node.html#setup) ### Returns The result node. ``` -------------------------------- ### .setupPremultipliedAlpha Source: https://threejs.org/docs/pages/NodeMaterial.html Setups premultiplied alpha for the material. ```APIDOC ## .setupPremultipliedAlpha( builder : NodeBuilder, outputNode : Node. ) : Node. ### Description Setups premultiplied alpha. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. - **outputNode** (Node.) - The existing output node. ### Returns - **Node.** - The output node. ``` -------------------------------- ### .setup Source: https://threejs.org/docs/pages/TextureNode.html Setups texture node by preparing the internal nodes for code generation. This method is part of the node setup process. ```APIDOC ## .setup( builder : NodeBuilder ) ### Description Setups texture node by preparing the internal nodes for code generation. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - Required - The current node builder. ### Overrides [UniformNode#setup](UniformNode.html#setup) ``` -------------------------------- ### .setupVertex Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the logic for the vertex stage of the material. ```APIDOC ## .setupVertex( builder : NodeBuilder ) : Node. ### Description Setups the logic for the vertex stage. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns - **Node.** - The position in clip space. ``` -------------------------------- ### Import RapierPhysics Addon Source: https://threejs.org/docs/pages/RapierPhysics.html Explicitly import the RapierPhysics addon. Refer to the installation guide for addons. ```javascript import { RapierPhysics } from 'three/addons/physics/RapierPhysics.js'; ``` -------------------------------- ### TRAANode setup() Method Source: https://threejs.org/docs/pages/TRAANode.html Sets up the effect's render targets and TSL code. This method is part of the node's internal setup process. ```javascript setup( builder ) ``` -------------------------------- ### Import SepiaShader Source: https://threejs.org/docs/pages/module-SepiaShader.html Import the SepiaShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { SepiaShader } from 'three/addons/shaders/SepiaShader.js'; ``` -------------------------------- ### Import MirrorShader Source: https://threejs.org/docs/pages/module-MirrorShader.html Import the MirrorShader addon explicitly. Refer to the installation guide for addon import instructions. ```js import { MirrorShader } from 'three/addons/shaders/MirrorShader.js'; ``` -------------------------------- ### Example Usage Source: https://threejs.org/docs/TSL.html Demonstrates how to use the `.add()` operator. ```APIDOC ```javascript const a = float( 1 ); const b = float( 2 ); const result = a.add( b ); // output: 3 ``` ``` -------------------------------- ### .setupClipping( builder : NodeBuilder ) : ClippingNode Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the clipping node. ```APIDOC ## .setupClipping( builder : NodeBuilder ) : ClippingNode ### Description Setups the clipping node. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The clipping node. ``` -------------------------------- ### .setupFog( builder : NodeBuilder, outputNode : Node. ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setup the fog. ```APIDOC ## .setupFog( builder : NodeBuilder, outputNode : Node. ) : Node. ### Description Setup the fog. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. - **outputNode** (Node.) - The existing output node. ### Returns The output node. ``` -------------------------------- ### Import VerticalTiltShiftShader Source: https://threejs.org/docs/pages/module-VerticalTiltShiftShader.html Import the VerticalTiltShiftShader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { VerticalTiltShiftShader } from 'three/addons/shaders/VerticalTiltShiftShader.js'; ``` -------------------------------- ### .setupHardwareClipping( builder : NodeBuilder ) Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the hardware clipping if available on the current device. ```APIDOC ## .setupHardwareClipping( builder : NodeBuilder ) ### Description Setups the hardware clipping if available on the current device. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ``` -------------------------------- ### LightsNode.setupLights Source: https://threejs.org/docs/pages/LightsNode.html Setups the internal lights by building all respective light nodes. This method orchestrates the setup of multiple lights. ```APIDOC ## LightsNode.setupLights( builder : NodeBuilder, lightNodes : Array. ) ### Description Setups the internal lights by building all respective light nodes. ### Method `setupLights( builder, lightNodes )` ### Parameters #### Path Parameters - **builder** (NodeBuilder) - Required - A reference to the current node builder. - **lightNodes** (Array.) - Required - An array of lighting nodes. ``` -------------------------------- ### .setupDepth( builder : NodeBuilder ) Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the depth of this material. ```APIDOC ## .setupDepth( builder : NodeBuilder ) ### Description Setups the depth of this material. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ``` -------------------------------- ### Import GTAOShader Source: https://threejs.org/docs/pages/module-GTAOShader.html Import the GTAOShader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { GTAOShader } from 'three/addons/shaders/GTAOShader.js'; ``` -------------------------------- ### .setup(builder) Source: https://threejs.org/docs/pages/Node.html Prepares the node for the build process, often used to set up the node's output. ```APIDOC ## .setup( builder : NodeBuilder ) : Node ### Description Represents the setup stage which is the first step of the build process, see [Node#build](Node.html#build) method. This method is often overwritten in derived modules to prepare the node which is used as a node's output/result. If an output node is prepared, then it must be returned in the `return` statement of the derived module's setup function. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The output node. ``` -------------------------------- ### Import FreiChenShader Source: https://threejs.org/docs/pages/module-FreiChenShader.html Import the FreiChenShader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { FreiChenShader } from 'three/addons/shaders/FreiChenShader.js'; ``` -------------------------------- ### Methods Source: https://threejs.org/docs/pages/SampleNode.html Provides methods for sampling and setup. ```APIDOC ## .sample( uv : Node. ) : Node ### Description Calls the callback function with the provided UV node. ### Parameters #### Parameters - **uv** (Node.) - The UV node or value to be passed to the callback. ### Returns - Node - The result of the callback function. ``` ```APIDOC ## .setup() : Node ### Description Sets up the node by sampling with the default UV accessor. ### Overrides [Node#setup](Node.html#setup) ### Returns - Node - The result of the callback function when called with the UV node. ``` -------------------------------- ### Import DynamicLighting Addon Source: https://threejs.org/docs/pages/DynamicLighting.html Import the DynamicLighting addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { DynamicLighting } from 'three/addons/lighting/DynamicLighting.js'; ``` -------------------------------- ### LUTPass Usage Example Source: https://threejs.org/docs/pages/LUTPass.html Example demonstrating how to create and use a LUTPass with the composer. ```APIDOC ## Code Example ```js const lutPass = new LUTPass( { lut: lut.texture3D } ); composer.addPass( lutPass ); ``` ``` -------------------------------- ### start Source: https://threejs.org/docs/pages/LightingModel.html Abstract method intended for setting up the lighting model and context data, which are later used during the light evaluation process. ```APIDOC ## start( builder : NodeBuilder ) ### Description This method is intended for setting up lighting model and context data which are later used in the evaluation process. ### Method start ### Parameters #### Path Parameters - **builder** (NodeBuilder) - Description: The current node builder. ``` -------------------------------- ### .setup( builder : NodeBuilder ) Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the vertex and fragment stage of this node material. ```APIDOC ## .setup( builder : NodeBuilder ) ### Description Setups the vertex and fragment stage of this node material. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ``` -------------------------------- ### Import BlendShader Source: https://threejs.org/docs/pages/module-BlendShader.html Import the BlendShader addon explicitly. Refer to the installation guide for addon setup. ```js import { BlendShader } from 'three/addons/shaders/BlendShader.js'; ``` -------------------------------- ### setupAlphaToCoverage Source: https://threejs.org/docs/pages/ClippingNode.html Setups alpha to coverage clipping. ```APIDOC ## .setupAlphaToCoverage( intersectionPlanes: Array., unionPlanes: Array. ) : Node ### Description Setups alpha to coverage. ### Parameters * **intersectionPlanes** (Array.) - The intersection planes. * **unionPlanes** (Array.) - The union planes. ### Returns The result node. ``` -------------------------------- ### Import VRMLLoader Source: https://threejs.org/docs/pages/VRMLLoader.html Import the VRMLLoader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { VRMLLoader } from 'three/addons/loaders/VRMLLoader.js'; ``` -------------------------------- ### .setupWebGLXRFallback( renderer : WebGPURenderer, createFallbackRenderer : function, onFallback : function ) Source: https://threejs.org/docs/pages/global.html Sets up a construction-time WebGL fallback for WebGPU XR examples. ```APIDOC ## .setupWebGLXRFallback( renderer : WebGPURenderer, createFallbackRenderer : function, onFallback : function ) ### Description Sets up a construction-time WebGL fallback for WebGPU XR examples. ### Parameters #### Path Parameters - **renderer** (WebGPURenderer) - Required - The initial renderer. - **createFallbackRenderer** (function) - Required - A function that returns a new renderer with a WebGL backend. - **onFallback** (function) - Required - A function that installs the new renderer in the app. ``` -------------------------------- ### setup Source: https://threejs.org/docs/pages/ReferenceNode.html Configures the reference node, returning the internal uniform node as its output. ```APIDOC ## .setup( builder : NodeBuilder ) : UniformNode ### Description The output of the reference node is the internal uniform node. ### Parameters #### Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns - UniformNode - The output node. ### Overrides [Node#setup](Node.html#setup) ``` -------------------------------- ### Import MD2Loader Source: https://threejs.org/docs/pages/MD2Loader.html Import the MD2Loader addon explicitly. Refer to the installation guide for addon setup. ```javascript import { MD2Loader } from 'three/addons/loaders/MD2Loader.js'; ``` -------------------------------- ### Import KaleidoShader Source: https://threejs.org/docs/pages/module-KaleidoShader.html Import the KaleidoShader addon explicitly before use. Refer to the installation guide for addon setup. ```javascript import { KaleidoShader } from 'three/addons/shaders/KaleidoShader.js'; ``` -------------------------------- ### Import BokehShader Addon Source: https://threejs.org/docs/pages/module-BokehShader.html Import the BokehShader addon explicitly. Refer to the installation guide for addon setup. ```js import { BokehShader } from 'three/addons/shaders/BokehShader.js'; ``` -------------------------------- ### Import TTFLoader Source: https://threejs.org/docs/pages/TTFLoader.html Import the TTFLoader addon explicitly. Refer to the Three.js installation guide for addon setup. ```javascript import { TTFLoader } from 'three/addons/loaders/TTFLoader.js'; ``` -------------------------------- ### Import MaterialXLoader Source: https://threejs.org/docs/pages/MaterialXLoader.html Import the MaterialXLoader addon explicitly before use. Refer to the installation guide for addon setup. ```javascript import { MaterialXLoader } from 'three/addons/loaders/MaterialXLoader.js'; ``` -------------------------------- ### Create and Play Positional Audio - JavaScript Source: https://threejs.org/docs/pages/PositionalAudio.html This example demonstrates how to set up an AudioListener, create a PositionalAudio object, load a sound buffer, and play it from a specific mesh in the scene. Ensure the AudioListener is added to the camera and the PositionalAudio is attached to a scene object. ```javascript const listener = new THREE.AudioListener(); camera.add( listener ); const sound = new THREE.PositionalAudio( listener ); const audioLoader = new THREE.AudioLoader(); audioLoader.load( 'sounds/song.ogg', function( buffer ) { sound.setBuffer( buffer ); sound.setRefDistance( 20 ); ssound.play(); }); const sphere = new THREE.SphereGeometry( 20, 32, 16 ); const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } ); const mesh = new THREE.Mesh( sphere, material ); scene.add( mesh ); mesh.add( sound ); ``` -------------------------------- ### Import UVsDebug Addon Source: https://threejs.org/docs/pages/module-UVsDebug.html Import the UVsDebug addon explicitly before use. Refer to the installation guide for addon setup. ```js import { UVsDebug } from 'three/addons/utils/UVsDebug.js'; ``` -------------------------------- ### .init Source: https://threejs.org/docs/pages/Backend.html Initializes the backend so it is ready for usage. Concrete backends are supposed to implement their rendering context creation and related operations in this method. This is an async method. ```APIDOC ## .init( renderer : Renderer ) : Promise (async) ### Description Initializes the backend so it is ready for usage. Concrete backends are supposed to implement their rendering context creation and related operations in this method. ### Parameters #### Path Parameters - **renderer** (Renderer) - Required - The renderer. ### Returns - **Promise** - A Promise that resolves when the backend has been initialized. ``` -------------------------------- ### Import TeapotGeometry Addon Source: https://threejs.org/docs/pages/TeapotGeometry.html TeapotGeometry is an addon and must be imported explicitly. Refer to the installation guide for addon setup. ```javascript import { TeapotGeometry } from 'three/addons/geometries/TeapotGeometry.js'; ``` -------------------------------- ### .setup( builder : NodeBuilder ) Source: https://threejs.org/docs/pages/AnaglyphPassNode.html This method is used to setup the effect's TSL code. ```APIDOC ## .setup( builder : NodeBuilder ) : PassTextureNode **builder** The current node builder. **Overrides:** [StereoCompositePassNode#setup](StereoCompositePassNode.html#setup) ``` -------------------------------- ### Setup Method for SobelOperatorNode Source: https://threejs.org/docs/pages/SobelOperatorNode.html This method is used to setup the effect's TSL code. The builder parameter is the current node builder. ```javascript .setup( builder : NodeBuilder ) : ShaderCallNodeInternal ``` -------------------------------- ### .setupLighting( builder : NodeBuilder ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the outgoing light node. ```APIDOC ## .setupLighting( builder : NodeBuilder ) : Node. ### Description Setups the outgoing light node. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The outgoing light node. ``` -------------------------------- ### Import EXRLoader Source: https://threejs.org/docs/pages/EXRLoader.html Import the EXRLoader addon explicitly from the three/addons path. Refer to the installation guide for addon setup. ```javascript import { EXRLoader } from 'three/addons/loaders/EXRLoader.js'; ``` -------------------------------- ### Method: setup(builder) Source: https://threejs.org/docs/pages/AfterImageNode.html Sets up the TSL code for the after-image effect using the provided node builder. ```APIDOC ### .setup( builder : NodeBuilder ) : PassTextureNode This method is used to setup the effect's TSL code. **builder** The current node builder. **Overrides:** [TempNode#setup](TempNode.html#setup) ``` -------------------------------- ### Import HTMLMesh Addon Source: https://threejs.org/docs/pages/HTMLMesh.html Explicitly import the HTMLMesh class from the three/addons/interactive/HTMLMesh.js module. Refer to the Three.js installation guide for addon setup. ```javascript import { HTMLMesh } from 'three/addons/interactive/HTMLMesh.js'; ``` -------------------------------- ### setupVariants Source: https://threejs.org/docs/pages/LineDashedNodeMaterial.html Setups the dash specific node variables for the material. ```APIDOC ## .setupVariants( builder : NodeBuilder ) ### Description Setups the dash specific node variables. ### Parameters * **builder** (NodeBuilder) - The current node builder. **Overrides:** [NodeMaterial#setupVariants](NodeMaterial.html#setupVariants) ``` -------------------------------- ### Import BleachBypassShader Source: https://threejs.org/docs/pages/module-BleachBypassShader.html Import the BleachBypassShader addon explicitly. Refer to the installation guide for addons. ```js import { BleachBypassShader } from 'three/addons/shaders/BleachBypassShader.js'; ``` -------------------------------- ### .setupLightingModel( builder : NodeBuilder ) : LightingModel (abstract) Source: https://threejs.org/docs/pages/NodeMaterial.html This method should be implemented by most derived materials since it defines the material's lighting model. ```APIDOC ## .setupLightingModel( builder : NodeBuilder ) : LightingModel (abstract) ### Description This method should be implemented by most derived materials since it defines the material's lighting model. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The lighting model. ``` -------------------------------- ### Import PVRLoader Source: https://threejs.org/docs/pages/PVRLoader.html Import the PVRLoader addon explicitly. Refer to the installation guide for addons. ```javascript import { PVRLoader } from 'three/addons/loaders/PVRLoader.js'; ``` -------------------------------- ### Import WaterRefractionShader Source: https://threejs.org/docs/pages/module-WaterRefractionShader.html Import the WaterRefractionShader addon explicitly. Refer to the Installation#Addons guide for more details. ```javascript import { WaterRefractionShader } from 'three/addons/shaders/WaterRefractionShader.js'; ``` -------------------------------- ### Import TriangleBlurShader Source: https://threejs.org/docs/pages/module-TriangleBlurShader.html TriangleBlurShader is an addon and must be imported explicitly. Refer to the installation guide for addons. ```javascript import { TriangleBlurShader } from 'three/addons/shaders/TriangleBlurShader.js'; ``` -------------------------------- ### setupUV Source: https://threejs.org/docs/pages/CubeTextureNode.html Setups the UV node, potentially modifying it for correct sampling based on the backend and texture type. ```APIDOC ## .setupUV( builder : NodeBuilder, uvNode : Node ) : Node ### Description Setups the uv node. Depending on the backend as well as the texture type, it might be necessary to modify the uv node for correct sampling. ### Parameters * **builder** (NodeBuilder) - The current node builder. * **uvNode** (Node) - The uv node to setup. ### Returns * Node - The updated uv node. ### Overrides * [TextureNode#setupUV](TextureNode.html#setupUV) ``` -------------------------------- ### .setupUV Source: https://threejs.org/docs/pages/TextureNode.html Setups the uv node, potentially modifying it for correct sampling based on backend, image, and texture type. Returns the updated uv node. ```APIDOC ## .setupUV( builder : NodeBuilder, uvNode : Node ) : Node ### Description Setups the uv node. Depending on the backend as well as texture's image and type, it might be necessary to modify the uv node for correct sampling. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - Required - The current node builder. - **uvNode** (Node) - Required - The uv node to setup. ### Returns - **Node** - The updated uv node. ``` -------------------------------- ### Import FilmShader Source: https://threejs.org/docs/pages/module-FilmShader.html Import the FilmShader addon explicitly. Refer to the installation guide for more details on addons. ```javascript import { FilmShader } from 'three/addons/shaders/FilmShader.js'; ``` -------------------------------- ### Import ColorifyShader Source: https://threejs.org/docs/pages/module-ColorifyShader.html Import the ColorifyShader addon explicitly. Refer to the installation guide for more details on addons. ```javascript import { ColorifyShader } from 'three/addons/shaders/ColorifyShader.js'; ``` -------------------------------- ### .setupEnvironment( builder : NodeBuilder ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the environment node from the material. ```APIDOC ## .setupEnvironment( builder : NodeBuilder ) : Node. ### Description Setups the environment node from the material. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The environment node. ``` -------------------------------- ### Import ThreeMFLoader Source: https://threejs.org/docs/pages/ThreeMFLoader.html Explicitly import the ThreeMFLoader addon. Refer to the Installation#Addons guide for more details. ```javascript import { ThreeMFLoader } from 'three/addons/loaders/3MFLoader.js'; ``` -------------------------------- ### Methods Source: https://threejs.org/docs/pages/MeshStandardNodeMaterial.html Methods for MeshStandardNodeMaterial, including setupEnvironment, setupLightingModel, setupSpecular, and setupVariants. ```APIDOC ## Methods ### .setupEnvironment( builder : NodeBuilder ) : EnvironmentNode. Overwritten since this type of material uses [EnvironmentNode](EnvironmentNode.html) to implement the PBR (PMREM based) environment mapping. Besides, the method honors `Scene.environment`. **builder** The current node builder. **Overrides:** [NodeMaterial#setupEnvironment](NodeMaterial.html#setupEnvironment) **Returns:** The environment node. ### .setupLightingModel() : PhysicalLightingModel Setups the lighting model. **Overrides:** [NodeMaterial#setupLightingModel](NodeMaterial.html#setupLightingModel) **Returns:** The lighting model. ### .setupSpecular() Setups the specular related node variables. ### .setupVariants( builder : NodeBuilder ) Setups the standard specific node variables. **builder** The current node builder. **Overrides:** [NodeMaterial#setupVariants](NodeMaterial.html#setupVariants) ``` -------------------------------- ### Import TGALoader Source: https://threejs.org/docs/pages/TGALoader.html Import the TGALoader addon explicitly. Refer to the Three.js installation guide for addons. ```javascript import { TGALoader } from 'three/addons/loaders/TGALoader.js'; ``` -------------------------------- ### Usage Example Source: https://threejs.org/docs/pages/ColorEnvironment.html Shows how to create a ColorEnvironment, generate an environment map using PMREMGenerator, and apply it to a scene. ```APIDOC ```js const environment = new ColorEnvironment( 0x00ff00 ); const pmremGenerator = new THREE.PMREMGenerator( renderer ); const envMap = pmremGenerator.fromScene( environment ).texture; scene.environment = envMap; ``` ``` -------------------------------- ### Import SMAAPass Source: https://threejs.org/docs/pages/SMAAPass.html SMAAPass is an addon and must be imported explicitly. Refer to the installation guide for more details. ```javascript import { SMAAPass } from 'three/addons/postprocessing/SMAAPass.js'; ``` -------------------------------- ### Constructor Source: https://threejs.org/docs/pages/SpotLightDataNode.html Initializes a new instance of SpotLightDataNode. ```APIDOC ## new SpotLightDataNode() ### Description Creates a new SpotLightDataNode. ### Method constructor ### Parameters None ``` -------------------------------- ### Initialize and Play Global Audio in Three.js Source: https://threejs.org/docs/pages/Audio.html Set up an AudioListener, create a global audio source, load an audio buffer, and play it with looping and volume control. Ensure the AudioListener is added to the camera. ```javascript const listener = new THREE.AudioListener(); camera.add( listener ); const sound = new THREE.Audio( listener ); const audioLoader = new THREE.AudioLoader(); audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { ssound.setBuffer( buffer ); sound.setLoop( true ); sound.setVolume( 0.5 ); sound.play(); }); ``` -------------------------------- ### Import OBJLoader Source: https://threejs.org/docs/pages/OBJLoader.html OBJLoader is an addon and requires explicit import. Refer to the installation guide for more details. ```javascript import { OBJLoader } from 'three/addons/loaders/OBJLoader.js'; ``` -------------------------------- ### .init() Source: https://threejs.org/docs/pages/Renderer.html Initializes the renderer, preparing it for use. Returns a Promise that resolves upon completion. ```APIDOC ## .init() ### Description Initializes the renderer so it is ready for usage. ### Returns - A Promise that resolves when the renderer has been initialized (Promise.). ``` -------------------------------- ### Create and Configure a SpotLight Source: https://threejs.org/docs/pages/SpotLight.html Initializes a white spotlight with specified position, shadow properties, and texture mapping. Ensure the map property is used only when castShadow is true. ```javascript const spotLight = new THREE.SpotLight( 0xffffff ); spotLight.position.set( 100, 1000, 100 ); spotLight.map = new THREE.TextureLoader().load( url ); spotLight.castShadow = true; spotLight.shadow.mapSize.width = 1024; spotLight.shadow.mapSize.height = 1024; spotLight.shadow.camera.near = 500; spotLight.shadow.camera.far = 4000; spotLight.shadow.camera.fov = 30;s ``` -------------------------------- ### Import VerticalBlurShader Source: https://threejs.org/docs/pages/module-VerticalBlurShader.html Import the VerticalBlurShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { VerticalBlurShader } from 'three/addons/shaders/VerticalBlurShader.js'; ``` -------------------------------- ### Import VelocityShader Source: https://threejs.org/docs/pages/module-VelocityShader.html Import the VelocityShader addon explicitly. Refer to the installation guide for addon import instructions. ```javascript import { VelocityShader } from 'three/addons/shaders/VelocityShader.js'; ``` -------------------------------- ### beginCompute Source: https://threejs.org/docs/pages/Backend.html Prepares the backend state for upcoming compute tasks. This is an abstract method. ```APIDOC ## beginCompute ### .beginCompute( computeGroup : Node | Array. ) (abstract) This method is executed at the beginning of a compute call and can be used by the backend to prepare the state for upcoming compute tasks. **computeGroup** The compute node(s). ``` -------------------------------- ### Import SMAAShader Source: https://threejs.org/docs/pages/module-SMAAShader.html Import the SMAAShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { SMAAShader } from 'three/addons/shaders/SMAAShader.js'; ``` -------------------------------- ### Initialize and Use AudioAnalyser Source: https://threejs.org/docs/pages/AudioAnalyser.html Sets up an AudioListener, loads a sound, and then creates an AudioAnalyser to get the average frequency. Ensure an AudioListener is added to the camera and the Audio object is properly configured before creating the analyser. ```javascript const listener = new THREE.AudioListener(); camera.add( listener ); const sound = new THREE.Audio( listener ); const audioLoader = new THREE.AudioLoader(); audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { sound.setBuffer( buffer ); sound.setLoop(true); sound.setVolume(0.5); sound.play(); }); const analyser = new THREE.AudioAnalyser( sound, 32 ); const data = analyser.getAverageFrequency(); ``` -------------------------------- ### .setupModelViewProjection( builder : NodeBuilder ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the position in clip space. ```APIDOC ## .setupModelViewProjection( builder : NodeBuilder ) : Node. ### Description Setups the position in clip space. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The position in view space. ``` -------------------------------- ### Import LuminosityShader Source: https://threejs.org/docs/pages/module-LuminosityShader.html Import the LuminosityShader addon explicitly. Refer to the installation guide for addon import instructions. ```javascript import { LuminosityShader } from 'three/addons/shaders/LuminosityShader.js'; ``` -------------------------------- ### Import HueSaturationShader Source: https://threejs.org/docs/pages/module-HueSaturationShader.html Import the HueSaturationShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { HueSaturationShader } from 'three/addons/shaders/HueSaturationShader.js'; ``` -------------------------------- ### Import GammaCorrectionShader Source: https://threejs.org/docs/pages/module-GammaCorrectionShader.html Import the GammaCorrectionShader addon explicitly. Refer to the installation guide for details on importing addons. ```javascript import { GammaCorrectionShader } from 'three/addons/shaders/GammaCorrectionShader.js'; ``` -------------------------------- ### .setupOutput( builder : NodeBuilder, outputNode : Node. ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the output node. This method can be implemented by derived materials to extend the functionality of the material's output or replace it altogether. ```APIDOC ## .setupOutput( builder : NodeBuilder, outputNode : Node. ) : Node. ### Description Setups the output node. This method can be implemented by derived materials to extend the functionality of the material's output or replace it altogether. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. - **outputNode** (Node.) - The existing output node. ### Returns The output node. ### Request Example ```js class ColoredShadowMaterial extends MeshPhongNodeMaterial { constructor( parameters ) { super( parameters ); this._shadeColor = uniform( new Color( parameters.shadeColor ?? 0xff0000 ) ); } setupOutput( builder, outputNode ) { // Modify the native output of the MeshPhongNodeMaterial fragment shader const brightness = min( outputNode.r, 1.0 ); const mixedColor = mix( this._shadeColor, diffuseColor.rgb, brightness ); // Return new output back into NodeMaterial flow return super.setupOutput( builder, vec4( mixedColor, outputNode.a ) ); } } ``` ``` -------------------------------- ### Import ConvolutionShader Source: https://threejs.org/docs/pages/module-ConvolutionShader.html Import the ConvolutionShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { ConvolutionShader } from 'three/addons/shaders/ConvolutionShader.js'; ``` -------------------------------- ### Constructor Source: https://threejs.org/docs/pages/TileShadowNodeHelper.html Initializes a new instance of TileShadowNodeHelper. ```APIDOC ## Constructor ### new TileShadowNodeHelper( tileShadowNode : TileShadowNode ) **tileShadowNode** The TileShadowNode instance to debug. ``` -------------------------------- ### Import ColorCorrectionShader Source: https://threejs.org/docs/pages/module-ColorCorrectionShader.html Import the ColorCorrectionShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { ColorCorrectionShader } from 'three/addons/shaders/ColorCorrectionShader.js'; ``` -------------------------------- ### .setupLightMap( builder : NodeBuilder ) : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the light map node from the material. ```APIDOC ## .setupLightMap( builder : NodeBuilder ) : Node. ### Description Setups the light map node from the material. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - The current node builder. ### Returns The light map node. ``` -------------------------------- ### Import AfterimageShader Source: https://threejs.org/docs/pages/module-AfterimageShader.html Import the AfterimageShader addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { AfterimageShader } from 'three/addons/shaders/AfterimageShader.js'; ``` -------------------------------- ### setup Source: https://threejs.org/docs/pages/VelocityNode.html Implements the velocity computation based on previous and current vertex data. ```APIDOC ## .setup( builder : NodeBuilder ) : Node. ### Description Implements the velocity computation based on the previous and current vertex data. ### Method .setup( builder : NodeBuilder ) : Node. ### Parameters #### Path Parameters - **builder** (NodeBuilder) - A reference to the current node builder. ### Returns The motion vector. ``` -------------------------------- ### Import TIFFLoader Addon Source: https://threejs.org/docs/pages/TIFFLoader.html TIFFLoader is an addon and must be imported explicitly. Refer to the installation guide for more details. ```javascript import { TIFFLoader } from 'three/addons/loaders/TIFFLoader.js'; ``` -------------------------------- ### setup Source: https://threejs.org/docs/pages/ReferenceBaseNode.html Configures the reference node, returning the internal uniform node that holds the referenced value. ```APIDOC ## .setup() : UniformNode ### Description The output of the reference node is the internal uniform node. ### Overrides [Node#setup](Node.html#setup) ### Returns The output node. ``` -------------------------------- ### .setupOutgoingLight() : Node. Source: https://threejs.org/docs/pages/NodeMaterial.html Setups the outgoing light node variable. ```APIDOC ## .setupOutgoingLight() : Node. ### Description Setups the outgoing light node variable. ### Returns The outgoing light node. ``` -------------------------------- ### Import SelectionBox Source: https://threejs.org/docs/pages/SelectionBox.html SelectionBox is an addon and needs to be imported explicitly. Refer to the installation guide for more details on addons. ```javascript import { SelectionBox } from 'three/addons/interactive/SelectionBox.js'; ``` -------------------------------- ### Import MarchingCubes Addon Source: https://threejs.org/docs/pages/MarchingCubes.html Import the MarchingCubes addon explicitly. Ensure you have followed the installation guide for addons. ```javascript import { MarchingCubes } from 'three/addons/objects/MarchingCubes.js'; ``` -------------------------------- ### Import LUTCubeLoader Source: https://threejs.org/docs/pages/LUTCubeLoader.html LUTCubeLoader is an addon and requires explicit import. Ensure you follow the installation guide for addons. ```javascript import { LUTCubeLoader } from 'three/addons/loaders/LUTCubeLoader.js'; ``` -------------------------------- ### Constructor Source: https://threejs.org/docs/pages/SpotLightHelper.html Constructs a new spot light helper. The helper visualizes the provided light and can optionally take a color. ```APIDOC ## new SpotLightHelper( light : HemisphereLight, color : number | Color | string ) ### Description Constructs a new spot light helper. ### Parameters * **light** (HemisphereLight) - The light to be visualized. * **color** (number | Color | string) - The helper's color. If not set, the helper will take the color of the light. ``` -------------------------------- ### Create and Add PointLightHelper Source: https://threejs.org/docs/pages/PointLightHelper.html Instantiate a PointLight and then create a PointLightHelper to visualize it. Add both to the scene. ```javascript const pointLight = new THREE.PointLight( 0xff0000, 1, 100 ); pointLight.position.set( 10, 10, 10 ); scene.add( pointLight ); const sphereSize = 1; const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize ); scene.add( pointLightHelper ); ``` -------------------------------- ### Import GodraysNode Source: https://threejs.org/docs/pages/GodraysNode.html Import the GodraysNode addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import { godrays } from 'three/addons/tsl/display/GodraysNode.js'; ``` -------------------------------- ### Constructor Source: https://threejs.org/docs/pages/Backend.html Initializes a new backend instance. This is an abstract method and must be implemented by derived classes. ```APIDOC ## Constructor ### new Backend( parameters : Object ) (abstract) Constructs a new backend. **parameters** An object holding parameters for the backend. ``` -------------------------------- ### Import ClearPass Source: https://threejs.org/docs/pages/ClearPass.html ClearPass is an addon and must be imported explicitly. Refer to the installation guide for more details on addons. ```javascript import { ClearPass } from 'three/addons/postprocessing/ClearPass.js'; ``` -------------------------------- ### Import CameraUtils Addon Source: https://threejs.org/docs/pages/module-CameraUtils.html Import the CameraUtils addon explicitly. Refer to the installation guide for addon import procedures. ```javascript import * as CameraUtils from 'three/addons/utils/CameraUtils.js'; ``` -------------------------------- ### Import CSMShader Addon Source: https://threejs.org/docs/pages/module-CSMShader.html CSMShader is an addon and requires explicit import. Refer to the installation guide for more details on addons. ```javascript import { CSMShader } from 'three/addons/csm/CSMShader.js'; ``` -------------------------------- ### .setupPBO Source: https://threejs.org/docs/pages/GLSLNodeBuilder.html Sets up the Pixel Buffer Object (PBO) for a given storage buffer node. ```APIDOC ## .setupPBO( storageBufferNode : StorageBufferNode ) ### Description Setups the Pixel Buffer Object (PBO) for the given storage buffer node. ### Parameters - **storageBufferNode** (StorageBufferNode) - The storage buffer node. ``` -------------------------------- ### Import WireframeGeometry2 Source: https://threejs.org/docs/pages/WireframeGeometry2.html WireframeGeometry2 is an addon and must be imported explicitly. Refer to the installation guide for addon import procedures. ```javascript import { WireframeGeometry2 } from 'three/addons/lines/WireframeGeometry2.js'; ``` -------------------------------- ### LightsNode.setup Source: https://threejs.org/docs/pages/LightsNode.html The implementation makes sure that for each light in the scene there is a corresponding light node. By building the light nodes and evaluating the lighting model the outgoing light is computed. ```APIDOC ## LightsNode.setup( builder : NodeBuilder ) ### Description The implementation makes sure that for each light in the scene there is a corresponding light node. By building the light nodes and evaluating the lighting model the outgoing light is computed. ### Method `setup( builder )` ### Parameters #### Path Parameters - **builder** (NodeBuilder) - Required - A reference to the current node builder. ### Overrides [Node#setup](Node.html#setup) ### Returns - Node. - A node representing the outgoing light. ```