TSL object that represents the TBN matrix in view space.
Type
Node<mat3>TSL object that represents the parallax direction.
Type
Node<mat3>TSL function for computing parallax uv coordinates.
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
| scale | Node<vec2> | — |
Returns
Node<vec2>TSL function for computing bent normals.
Returns
Node<vec3>TSL function for creating a storage buffer node with a configured StorageBufferAttribute.
| Parameter | Type | Default Value |
|---|---|---|
| count | any | — |
| type? | any | — |
Returns
StorageBufferNodeTSL function for creating a storage buffer node with a configured StorageInstancedBufferAttribute.
| Parameter | Type | Default Value |
|---|---|---|
| count | any | — |
| type? | any | — |
Returns
StorageBufferNodeTSL function for creating a batch node.
| Parameter | Type | Default Value |
|---|---|---|
| batchMesh | BatchedMesh | — |
Returns
BatchNodeTSL object that represents the bitangent attribute of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex bitangent in local space of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex bitangent in view space of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex bitangent in world space of the current rendered object.
Type
Node<vec3>TSL function for creating a buffer attribute node.
| Parameter | Type | Default Value |
|---|---|---|
| array | any | — |
| type? | null | string | null |
| stride? | number | 0 |
| offset? | number | 0 |
Returns
Node | BufferAttributeNodeTSL function for creating a buffer attribute node but with dynamic draw usage. Use this function if attribute data are updated per frame.
| Parameter | Type | Default Value |
|---|---|---|
| array | any | — |
| type? | null | string | null |
| stride? | number | 0 |
| offset? | number | 0 |
Returns
Node | BufferAttributeNodeTSL function for creating a buffer attribute node but with enabled instancing
| Parameter | Type | Default Value |
|---|---|---|
| array | any | — |
| type? | null | string | null |
| stride? | number | 0 |
| offset? | number | 0 |
Returns
Node | BufferAttributeNodeTSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
| Parameter | Type | Default Value |
|---|---|---|
| array | any | — |
| type? | null | string | null |
| stride? | number | 0 |
| offset? | number | 0 |
Returns
Node | BufferAttributeNodeTSL function for creating a buffer node.
| Parameter | Type | Default Value |
|---|---|---|
| value | Array<number> | — |
| type | string | — |
| count | number | — |
Returns
BufferNodeTSL function for creating a builtin node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
Returns
BuiltinNodeTSL object that represents the current index value of the camera if used ArrayCamera.
Type
UniformNode<uint>TSL object that represents the near value of the camera used for the current render.
Type
UniformNode<float>TSL object that represents the far value of the camera used for the current render.
Type
UniformNode<float>TSL object that represents the projection matrix of the camera used for the current render.
Type
UniformNode<mat4>TSL object that represents the inverse projection matrix of the camera used for the current render.
Type
UniformNode<mat4>TSL object that represents the view matrix of the camera used for the current render.
Type
UniformNode<mat4>TSL object that represents the world matrix of the camera used for the current render.
Type
UniformNode<mat4>TSL object that represents the normal matrix of the camera used for the current render.
Type
UniformNode<mat3>TSL object that represents the position in world space of the camera used for the current render.
Type
UniformNode<vec3>TSL object that represents the viewport of the camera used for the current render.
Type
UniformNode<vec4>TSL function for creating a cube texture node.
| Parameter | Type | Default Value |
|---|---|---|
| value | CubeTexture | — |
| uvNode? | Node<vec3> | — |
| levelNode? | Node<int> | — |
| biasNode? | Node<float> | — |
Returns
CubeTextureNodeTSL function for creating a cube texture uniform node.
| Parameter | Type | Default Value |
|---|---|---|
| value? | null | CubeTextureNode | CubeTexture | EmptyTexture |
| uvNode? | any | null |
| levelNode? | any | null |
| biasNode? | any | null |
Returns
CubeTextureNodeTSL function for creating a uniform cube texture node.
| Parameter | Type | Default Value |
|---|---|---|
| value? | null | CubeTexture | EmptyTexture |
Returns
CubeTextureNodeTSL function for creating an instanced mesh node.
| Parameter | Type | Default Value |
|---|---|---|
| instancedMesh | InstancedMesh | — |
Returns
InstancedMeshNodeTSL function for creating an instance node.
| Parameter | Type | Default Value |
|---|---|---|
| count | number | — |
| instanceMatrix | any | — |
| instanceColor | any | — |
Returns
InstanceNodeTSL function for getting a shadow matrix uniform node for the given light.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
UniformNode<mat4>TSL function for getting projected uv coordinates for the given light. Relevant when using maps with spot lights.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
| position? | Node<vec3> | positionWorld |
Returns
anyTSL function for getting the position in world space for the given light.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
UniformNode<vec3>TSL function for getting the light target position in world space for the given light.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
UniformNode<vec3>TSL function for getting the position in view space for the given light.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
UniformNode<vec3>TSL function for getting the light target direction for the given light.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
Node<vec3>TSL object that represents alpha test of the current material.
Type
Node<float>TSL object that represents the diffuse color of the current material.
The value is composed via color * map.
Type
Node<vec3>TSL object that represents the shininess of the current material.
Type
Node<float>TSL object that represents the emissive color of the current material.
The value is composed via emissive * emissiveIntensity * emissiveMap.
Type
Node<vec3>TSL object that represents the opacity of the current material.
The value is composed via opacity * alphaMap.
Type
Node<float>TSL object that represents the specular of the current material.
Type
Node<vec3>TSL object that represents the specular intensity of the current material.
The value is composed via specularIntensity * specularMap.a.
Type
Node<float>TSL object that represents the specular color of the current material.
The value is composed via specularColor * specularMap.rgb.
Type
Node<vec3>TSL object that represents the specular strength of the current material.
The value is composed via specularMap.r.
Type
Node<float>TSL object that represents the reflectivity of the current material.
Type
Node<float>TSL object that represents the roughness of the current material.
The value is composed via roughness * roughnessMap.g.
Type
Node<float>TSL object that represents the metalness of the current material.
The value is composed via metalness * metalnessMap.b.
Type
Node<float>TSL object that represents the normal of the current material.
The value will be either normalMap * normalScale, bumpMap * bumpScale or normalView.
Type
Node<vec3>TSL object that represents the clearcoat of the current material.
The value is composed via clearcoat * clearcoatMap.r
Type
Node<float>TSL object that represents the clearcoat roughness of the current material.
The value is composed via clearcoatRoughness * clearcoatRoughnessMap.r.
Type
Node<float>TSL object that represents the clearcoat normal of the current material.
The value will be either clearcoatNormalMap or normalView.
Type
Node<vec3>TSL object that represents the rotation of the current sprite material.
Type
Node<float>TSL object that represents the sheen color of the current material.
The value is composed via sheen * sheenColor * sheenColorMap.
Type
Node<vec3>TSL object that represents the sheen roughness of the current material.
The value is composed via sheenRoughness * sheenRoughnessMap.a.
Type
Node<float>TSL object that represents the anisotropy of the current material.
Type
Node<vec2>TSL object that represents the iridescence of the current material.
Type
Node<float>TSL object that represents the iridescence IOR of the current material.
Type
Node<float>TSL object that represents the iridescence thickness of the current material.
Type
Node<float>TSL object that represents the transmission of the current material.
The value is composed via transmission * transmissionMap.r.
Type
Node<float>TSL object that represents the thickness of the current material.
The value is composed via thickness * thicknessMap.g.
Type
Node<float>TSL object that represents the IOR of the current material.
Type
Node<float>TSL object that represents the attenuation distance of the current material.
Type
Node<float>TSL object that represents the attenuation color of the current material.
Type
Node<vec3>TSL object that represents the scale of the current dashed line material.
Type
Node<float>TSL object that represents the dash size of the current dashed line material.
Type
Node<float>TSL object that represents the gap size of the current dashed line material.
Type
Node<float>TSL object that represents the line width of the current line material.
Type
Node<float>TSL object that represents the dash offset of the current line material.
Type
Node<float>TSL object that represents the point size of the current points material.
Type
Node<float>TSL object that represents the dispersion of the current material.
Type
Node<float>TSL object that represents the light map of the current material.
The value is composed via lightMapIntensity * lightMap.rgb.
Type
Node<vec3>TSL object that represents the ambient occlusion map of the current material.
The value is composed via aoMap.r - 1 * aoMapIntensity + 1.
Type
Node<float>TSL object that represents the anisotropy vector of the current material.
Type
Node<vec2>TSL object that represents the refraction ratio of the material used for rendering the current object.
Type
UniformNode<float>TSL object that represents the intensity of environment maps of PBR materials.
When material.envMap is set, the value is material.envMapIntensity otherwise scene.environmentIntensity.
Type
Node<float>TSL object that represents the rotation of environment maps.
When material.envMap is set, the value is material.envMapRotation. scene.environmentRotation controls the
rotation of scene.environment instead.
Type
Node<mat4>TSL function for creating a material reference node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| type | string | — |
| material? | any | null |
Returns
MaterialReferenceNodeTSL object that represents the object’s direction in world space.
Type
ModelNode<vec3>TSL object that represents the object’s world matrix.
Type
ModelNode<mat4>TSL object that represents the object’s position in world space.
Type
ModelNode<vec3>TSL object that represents the object’s scale in world space.
Type
ModelNode<vec3>TSL object that represents the object’s position in view/camera space.
Type
ModelNode<vec3>TSL object that represents the object’s radius.
Type
ModelNode<float>TSL object that represents the object’s normal matrix.
Type
UniformNode<mat3>TSL object that represents the object’s inverse world matrix.
Type
UniformNode<mat4>TSL object that represents the object’s model view matrix.
Type
Node<mat4>TSL object that represents the object’s model view in mediump precision.
Type
Node<mat4>TSL object that represents the object’s model view in highp precision
which is achieved by computing the matrix in JS and not in the shader.
Type
Node<mat4>TSL object that represents the object’s model normal view in highp precision
which is achieved by computing the matrix in JS and not in the shader.
Type
Node<mat3>TSL object that represents the position in clip space after the model-view-projection transform of the current rendered object.
Type
VaryingNode<vec4>TSL function for creating a morph node.
| Parameter | Type | Default Value |
|---|---|---|
| mesh | Mesh | — |
Returns
MorphNodeTSL object that represents the normal attribute of the current rendered object in local space.
Type
Node<vec3>TSL object that represents the vertex normal of the current rendered object in local space.
Type
Node<vec3>TSL object that represents the flat vertex normal of the current rendered object in view space.
Type
Node<vec3>TSL object that represents the vertex normal of the current rendered object in view space.
Type
Node<vec3>TSL object that represents the vertex normal of the current rendered object in world space.
Type
Node<vec3>TSL object that represents the vertex normal of the current rendered object in view space.
Type
Node<vec3>TSL object that represents the vertex normal of the current rendered object in world space.
Type
Node<vec3>TSL object that represents the clearcoat vertex normal of the current rendered object in view space.
Type
Node<vec3>Transforms the normal with the given matrix.
| Parameter | Type | Default Value |
|---|---|---|
| normal | Node<vec3> | — |
| matrix? | Node<mat3> | — |
Returns
Node<vec3>Transforms the given normal from local to view space.
| Parameter | Type | Default Value |
|---|---|---|
| normal | Node<vec3> | — |
| builder | NodeBuilder | — |
Returns
Node<vec3>TSL object that represents the transformed vertex normal of the current rendered object in view space.
Type
Node<vec3>TSL object that represents the transformed vertex normal of the current rendered object in world space.
Type
Node<vec3>TSL object that represents the transformed clearcoat vertex normal of the current rendered object in view space.
Type
Node<vec3>TSL function for creating an object 3D node that represents the object’s direction in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s world matrix.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<mat4>TSL function for creating an object 3D node that represents the object’s position in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s scale in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s position in view/camera space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s radius.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<float>TSL object that represents the uv coordinates of points.
Type
PointUVNodeTSL object that represents the clip space position of the current rendered object.
Type
VaryingNode<vec4>TSL object that represents the position attribute of the current rendered object.
Type
AttributeNode<vec3>TSL object that represents the vertex position in local space of the current rendered object.
Type
AttributeNode<vec3>TSL object that represents the previous vertex position in local space of the current rendered object. Used in context of VelocityNode for rendering motion vectors.
Type
AttributeNode<vec3>TSL object that represents the vertex position in world space of the current rendered object.
Type
VaryingNode<vec3>TSL object that represents the position world direction of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex position in view space of the current rendered object.
Type
VaryingNode<vec3>TSL object that represents the position view direction of the current rendered object.
Type
VaryingNode<vec3>TSL function for creating a reference node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| type | string | — |
| object? | null | Object | — |
Returns
ReferenceNodeTSL function for creating a reference node. Use this function if you want need a reference to an array-like property that should be represented as a uniform buffer.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| type | string | — |
| count | number | — |
| object | Object | — |
Returns
ReferenceNodeThe reflect vector in view space.
Type
Node<vec3>The refract vector in view space.
Type
Node<vec3>Used for sampling cube maps when using cube reflection mapping.
Type
Node<vec3>Used for sampling cube maps when using cube refraction mapping.
Type
Node<vec3>TSL function for creating a renderer reference node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| type | string | — |
| renderer? | any | null |
Returns
RendererReferenceNodeTSL object that represents the scene’s background blurriness.
Type
Node<float>TSL object that represents the scene’s background intensity.
Type
Node<float>TSL object that represents the scene’s background rotation.
Type
Node<mat4>TSL function for creating a skinning node.
| Parameter | Type | Default Value |
|---|---|---|
| skinnedMesh | SkinnedMesh | — |
Returns
SkinningNodeTSL function for computing skinning.
| Parameter | Type | Default Value |
|---|---|---|
| skinnedMesh | SkinnedMesh | — |
| toPosition? | Node<vec3> | null |
Returns
SkinningNodeTSL function for creating a storage buffer node.
| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
| type? | any | null |
| count? | number | 0 |
Returns
StorageBufferNodeTSL function for creating a storage texture node.
| Parameter | Type | Default Value |
|---|---|---|
| value | StorageTexture | — |
| uvNode | Node<vec2|vec3> | — |
| storeNode? | Node | — |
Returns
StorageTextureNodeTODO: Explain difference to storageTexture().
| Parameter | Type | Default Value |
|---|---|---|
| value | StorageTexture | — |
| uvNode | Node<vec2|vec3> | — |
| storeNode? | null | Node | null |
Returns
StorageTextureNodeTSL object that represents the tangent attribute of the current rendered object.
Type
Node<vec4>TSL object that represents the vertex tangent in local space of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex tangent in view space of the current rendered object.
Type
Node<vec3>TSL object that represents the vertex tangent in world space of the current rendered object.
Type
Node<vec3>TSL function for creating a 3D texture node.
| Parameter | Type | Default Value |
|---|---|---|
| value | Data3DTexture | — |
| uvNode? | Node<vec3> | — |
| levelNode? | Node<int> | — |
Returns
Texture3DNodeTSL function for creating a texture node that fetches/loads texels without interpolation.
| Parameter | Type | Default Value |
|---|---|---|
| params | ...Array<any> | — |
Returns
TextureNodeTSL function for creating a texture node that fetches/loads texels without interpolation.
| Parameter | Type | Default Value |
|---|---|---|
| value? | any | EmptyTexture |
| uvNode? | any | null |
| levelNode? | any | null |
Returns
TextureNodeApplies mipped bicubic texture filtering to the given texture node.
| Parameter | Type | Default Value |
|---|---|---|
| textureNode | TextureNode | — |
| lodNode | Node<float> | — |
Returns
NodeApplies mipped bicubic texture filtering to the given texture node.
| Parameter | Type | Default Value |
|---|---|---|
| textureNode | TextureNode | — |
| strength? | Node<float> | — |
Returns
NodeTSL function for creating a texture node or sample a texture node already existing.
| Parameter | Type | Default Value |
|---|---|---|
| value? | null | TextureNode | Texture | EmptyTexture |
| uvNode? | any | null |
| levelNode? | any | null |
| biasNode? | any | null |
Returns
TextureNodeTSL function for creating a uniform texture node.
| Parameter | Type | Default Value |
|---|---|---|
| value? | null | Texture | EmptyTexture |
Returns
TextureNodeTSL function for creating a texture node that fetches/loads texels without interpolation.
| Parameter | Type | Default Value |
|---|---|---|
| params | ...Array<any> | — |
Returns
TextureNode| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
| uv | any | — |
| level | any | — |
Returns
TextureNodeConverts a texture or texture node to a sampler.
| Parameter | Type | Default Value |
|---|---|---|
| value | TextureNode | Texture | — |
Returns
NodeConverts a texture or texture node to a sampler comparison.
| Parameter | Type | Default Value |
|---|---|---|
| value | TextureNode | Texture | — |
Returns
NodeTSL function for creating a texture size node.
| Parameter | Type | Default Value |
|---|---|---|
| textureNode | TextureNode | — |
| levelNode? | Node<int> | — |
Returns
TextureSizeNodeTSL function for creating an uniform array node.
| Parameter | Type | Default Value |
|---|---|---|
| values | Array<any> | — |
| nodeType? | null | string | — |
Returns
UniformArrayNodeTSL function for creating a user data node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| inputType | string | — |
| userData | null | Object | — |
Returns
UserDataNodeTSL function for creating an uv attribute node with the given index.
| Parameter | Type | Default Value |
|---|---|---|
| index? | number | — |
Returns
AttributeNode<vec2>TSL object that represents the velocity of a render pass.
Type
VelocityNodeTSL function for creating a reference node.
| Parameter | Type | Default Value |
|---|---|---|
| index? | number | 0 |
Returns
VertexColorNodeTSL function for creating a code node.
| Parameter | Type | Default Value |
|---|---|---|
| code? | string | — |
| includes? | Array<Node> | — |
| language? | "js" | "wgsl" | "glsl" | — |
Returns
CodeNodeTSL function for creating a JS code node.
| Parameter | Type | Default Value |
|---|---|---|
| src | string | — |
| includes | Array<Node> | — |
Returns
CodeNodeTSL function for creating a WGSL code node.
| Parameter | Type | Default Value |
|---|---|---|
| src | string | — |
| includes | Array<Node> | — |
Returns
CodeNodeTSL function for creating a GLSL code node.
| Parameter | Type | Default Value |
|---|---|---|
| src | string | — |
| includes | Array<Node> | — |
Returns
CodeNodeTSL function for creating an expression node.
| Parameter | Type | Default Value |
|---|---|---|
| snippet? | string | — |
| nodeType? | string | — |
Returns
ExpressionNode| Parameter | Type | Default Value |
|---|---|---|
| func | any | — |
| params | ...Array<any> | — |
Returns
FunctionCallNode| Parameter | Type | Default Value |
|---|---|---|
| code | any | — |
| includes | any | — |
Returns
{ (...params: Array<any>): any; functionNode: FunctionNode; }| Parameter | Type | Default Value |
|---|---|---|
| code | any | — |
| includes | any | — |
Returns
{ (...params: Array<any>): any; functionNode: FunctionNode; }TSL function for creating an array node.
| Parameter | Type | Default Value |
|---|---|---|
| params | ...Array<any> | — |
Returns
ArrayNodeTSL function for creating an assign node.
| Parameter | Type | Default Value |
|---|---|---|
| targetNode | Node | — |
| sourceNode | Node | — |
Returns
AssignNodeTSL function for creating an attribute node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| nodeType? | null | string | null |
Returns
AttributeNodeTSL function for creating a bypass node.
| Parameter | Type | Default Value |
|---|---|---|
| outputNode | Node | — |
| callNode | Node | — |
Returns
BypassNodePossible shader stages.
Type
{ VERTEX: string; FRAGMENT: string; }Update types of a node.
Type
{ NONE: string; FRAME: string; RENDER: string; OBJECT: string; }Data types of a node.
Type
{ BOOLEAN: string; INTEGER: string; FLOAT: string; VECTOR2: string; VECTOR3: string; VECTOR4: string; MATRIX2: string; MATRIX3: string; MATRIX4: string; }Access types of a node. These are relevant for compute and storage usage.
Type
{ READ_ONLY: string; WRITE_ONLY: string; READ_WRITE: string; }Type
Array<string>Type
Array<string>Type
Array<string>Type
Array<string>TSL function for creating a context node.
| Parameter | Type | Default Value |
|---|---|---|
| nodeOrValue? | Object | Node | null |
| value? | Object | {} |
Returns
ContextNodeTSL function for defining a uniformFlow context value for a given node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
Returns
ContextNodeTSL function for defining a name for the context value for a given node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name | string | — |
Returns
ContextNodeTSL function for defining a built-in shadow context for a given node.
| Parameter | Type | Default Value |
|---|---|---|
| shadowNode | ShadowNode | — |
| light | Light | — |
| node? | Node | null |
Returns
ContextNodeTSL function for defining a built-in ambient occlusion context for a given node.
| Parameter | Type | Default Value |
|---|---|---|
| aoNode | Node | — |
| node? | Node | null |
Returns
ContextNodeTSL function for defining a label context value for a given node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name | string | — |
Returns
ContextNodeTSL object that represents the index of a vertex within a mesh.
Type
IndexNodeTSL object that represents the index of either a mesh instance or an invocation of a compute shader.
Type
IndexNodeTSL object that represents the index of the subgroup the current compute invocation belongs to.
Type
IndexNodeTSL object that represents the index of a compute invocation within the scope of a subgroup.
Type
IndexNodeTSL object that represents the index of a compute invocation within the scope of a workgroup load.
Type
IndexNodeTSL object that represents the index of a draw call.
Type
IndexNodeCreates an inspector node to wrap around a given node for inspection purposes.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name? | string | |
| callback? | null | Function | null |
Returns
NodeTSL function for creating a cache node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
Returns
IsolateNodeTSL function for creating a cache node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| parent? | boolean | true |
Returns
IsolateNodeReturns the MRT texture index for the given name.
| Parameter | Type | Default Value |
|---|---|---|
| textures | Array<Texture> | — |
| name | string | — |
Returns
numberTSL function for creating a MRT node.
| Parameter | Type | Default Value |
|---|---|---|
| outputNodes | Object<string, Node> | — |
Returns
MRTNodeTSL function for creating an output struct node.
| Parameter | Type | Default Value |
|---|---|---|
| members | ...Node | — |
Returns
OutputStructNodeTSL function for creating a parameter node.
| Parameter | Type | Default Value |
|---|---|---|
| type | string | — |
| name | null | string | — |
Returns
ParameterNodeTSL function for creating a property node.
| Parameter | Type | Default Value |
|---|---|---|
| type | string | — |
| name? | null | string | null |
Returns
PropertyNodeTSL function for creating a varying property node.
| Parameter | Type | Default Value |
|---|---|---|
| type | string | — |
| name? | null | string | null |
Returns
PropertyNodeTSL object that represents the shader variable DiffuseColor.
Type
PropertyNode<vec4>TSL object that represents the shader variable DiffuseContribution.
Type
PropertyNode<vec3>TSL object that represents the shader variable EmissiveColor.
Type
PropertyNode<vec3>TSL object that represents the shader variable Roughness.
Type
PropertyNode<float>TSL object that represents the shader variable Metalness.
Type
PropertyNode<float>TSL object that represents the shader variable Clearcoat.
Type
PropertyNode<float>TSL object that represents the shader variable ClearcoatRoughness.
Type
PropertyNode<float>TSL object that represents the shader variable Sheen.
Type
PropertyNode<vec3>TSL object that represents the shader variable SheenRoughness.
Type
PropertyNode<float>TSL object that represents the shader variable Iridescence.
Type
PropertyNode<float>TSL object that represents the shader variable IridescenceIOR.
Type
PropertyNode<float>TSL object that represents the shader variable IridescenceThickness.
Type
PropertyNode<float>TSL object that represents the shader variable AlphaT.
Type
PropertyNode<float>TSL object that represents the shader variable Anisotropy.
Type
PropertyNode<float>TSL object that represents the shader variable AnisotropyT.
Type
PropertyNode<vec3>TSL object that represents the shader variable AnisotropyB.
Type
PropertyNode<vec3>TSL object that represents the shader variable SpecularColor.
Type
PropertyNode<color>TSL object that represents the shader variable SpecularColorBlended.
Type
PropertyNode<color>TSL object that represents the shader variable SpecularF90.
Type
PropertyNode<float>TSL object that represents the shader variable Shininess.
Type
PropertyNode<float>TSL object that represents the shader variable Output.
Type
PropertyNode<vec4>TSL object that represents the shader variable dashSize.
Type
PropertyNode<float>TSL object that represents the shader variable gapSize.
Type
PropertyNode<float>TSL object that represents the shader variable pointWidth.
Type
PropertyNode<float>TSL object that represents the shader variable IOR.
Type
PropertyNode<float>TSL object that represents the shader variable Transmission.
Type
PropertyNode<float>TSL object that represents the shader variable Thickness.
Type
PropertyNode<float>TSL object that represents the shader variable AttenuationDistance.
Type
PropertyNode<float>TSL object that represents the shader variable AttenuationColor.
Type
PropertyNode<color>TSL object that represents the shader variable Dispersion.
Type
PropertyNode<float>TSL function for creating a stack node.
| Parameter | Type | Default Value |
|---|---|---|
| parent? | StackNode | — |
Returns
StackNodeTSL function for creating a struct node.
| Parameter | Type | Default Value |
|---|---|---|
| membersLayout | Object | — |
| name? | null | string | null |
Returns
FunctionCreates a new sub-build node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name | string | — |
| type? | null | string | null |
Returns
NodeTSL function for creating a uniform group node with the given name.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| order? | number | 1 |
| updateType? | null | null |
Returns
UniformGroupNodeTSL object that represents a shared uniform group node which is updated once per frame.
Type
UniformGroupNodeTSL object that represents a shared uniform group node which is updated once per render.
Type
UniformGroupNodeTSL object that represents a uniform group node which is updated once per object.
Type
UniformGroupNodeTSL function for creating a uniform node.
| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
| type? | string | — |
Returns
UniformNodeTSL function for creating a var node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name? | null | string | null |
Returns
VarNodeTSL function for creating a const node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name? | null | string | null |
Returns
VarNodeTSL function for creating a var intent node.
Properties
NodeReturns
VarNodeTSL function for creating a varying node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| name | string | — |
Returns
VaryingNodeComputes a node in the vertex stage.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
Returns
VaryingNodeRepresents a “Color Burn” blend mode.
It’s designed to darken the base layer’s colors based on the color of the blend layer. It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer.
| Parameter | Type | Default Value |
|---|---|---|
| base | Node<vec3> | — |
| blend | Node<vec3> | — |
Returns
Node<vec3>Represents a “Color Dodge” blend mode.
It’s designed to lighten the base layer’s colors based on the color of the blend layer. It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer.
| Parameter | Type | Default Value |
|---|---|---|
| base | Node<vec3> | — |
| blend | Node<vec3> | — |
Returns
Node<vec3>Represents a “Screen” blend mode.
Similar to blendDodge(), this mode also lightens the base layer’s colors based on the color of the blend layer.
The “Screen” blend mode is better for general brightening whereas the “Dodge” results in more subtle and nuanced
effects.
| Parameter | Type | Default Value |
|---|---|---|
| base | Node<vec3> | — |
| blend | Node<vec3> | — |
Returns
Node<vec3>Represents a “Overlay” blend mode.
It’s designed to increase the contrast of the base layer based on the color of the blend layer. It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. The color of the blend layer significantly influences the resulting contrast and color shift in the base layer.
| Parameter | Type | Default Value |
|---|---|---|
| base | Node<vec3> | — |
| blend | Node<vec3> | — |
Returns
Node<vec3>This function blends two color based on their alpha values by replicating the behavior of THREE.NormalBlending.
It assumes both input colors have non-premultiplied alpha.
| Parameter | Type | Default Value |
|---|---|---|
| base | Node<vec4> | — |
| blend | Node<vec4> | — |
Returns
Node<vec4>Premultiplies the RGB channels of a color by its alpha channel.
This function is useful for converting a non-premultiplied alpha color into a premultiplied alpha format, where the RGB values are scaled by the alpha value. Premultiplied alpha is often used in graphics rendering for certain operations, such as compositing and image processing.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec4> | — |
Returns
Node<vec4>Unpremultiplies the RGB channels of a color by its alpha channel.
This function is useful for converting a premultiplied alpha color back into a non-premultiplied alpha format, where the RGB values are divided by the alpha value. Unpremultiplied alpha is often used in graphics rendering for certain operations, such as compositing and image processing.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec4> | — |
Returns
Node<vec4>TSL function for creating a bump map node.
| Parameter | Type | Default Value |
|---|---|---|
| textureNode | Node<float> | — |
| scaleNode? | Node<float> | — |
Returns
BumpMapNodeComputes a grayscale value for the given RGB color value.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
Returns
Node<vec3>Super-saturates or desaturates the given RGB color.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| adjustment? | Node<float> | — |
Returns
Node<vec3>Selectively enhance the intensity of less saturated RGB colors. Can result in a more natural and visually appealing image with enhanced color depth compared to ColorAdjustment#saturation.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| adjustment? | Node<float> | — |
Returns
Node<vec3>Updates the hue component of the given RGB color while preserving its luminance and saturation.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| adjustment? | Node<float> | — |
Returns
Node<vec3>Computes the luminance for the given RGB color value.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| luminanceCoefficients | Node<vec3> | — |
Returns
Node<float>Color Decision List (CDL) v1.2
Compact representation of color grading information, defined by slope, offset, power, and saturation. The CDL should be typically be given input in a log space (such as LogC, ACEScc, or AgX Log), and will return output in the same space. Output may require clamping >=0.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec4> | — |
| slope | Node<vec3> | — |
| offset | Node<vec3> | — |
| power | Node<vec3> | — |
| saturation | Node<float> | — |
| luminanceCoefficients | Node<vec3> | — |
Returns
Node<vec4>TSL function for creating a posterize effect which reduces the number of colors in an image, resulting in a more blocky and stylized appearance.
| Parameter | Type | Default Value |
|---|---|---|
| sourceNode | Node | — |
| stepsNode | Node | — |
Returns
NodeConverts the given color value from sRGB to linear-sRGB color space.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
Returns
Node<vec3>Converts the given color value from linear-sRGB to sRGB color space.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
Returns
Node<vec3>TSL function for converting a given color node from the current working color space to the given color space.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| targetColorSpace | string | — |
Returns
ColorSpaceNodeTSL function for converting a given color node from the given color space to the current working color space.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| sourceColorSpace | string | — |
Returns
ColorSpaceNodeTSL function for converting a given color node from one color space to another one.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| sourceColorSpace | string | — |
| targetColorSpace | string | — |
Returns
ColorSpaceNodeTSL object that represents whether a primitive is front or back facing
Type
FrontFacingNode<bool>TSL object that represents the front facing status as a number instead of a bool.
1 means front facing, -1 means back facing.
Type
Node<float>Converts a direction vector to a face direction vector based on the material’s side.
If the material is set to BackSide, the direction is inverted.
If the material is set to DoubleSide, the direction is multiplied by faceDirection.
| Parameter | Type | Default Value |
|---|---|---|
| direction | Node<vec3> | — |
Returns
Node<vec3>TSL function for creating a normal map node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node<vec3> | — |
| scaleNode? | Node<vec2> | — |
Returns
NormalMapNodeTSL function for creating a pass node.
| Parameter | Type | Default Value |
|---|---|---|
| scene | Scene | — |
| camera | Camera | — |
| options | Object | — |
Returns
PassNodeTSL function for creating a pass texture node.
| Parameter | Type | Default Value |
|---|---|---|
| pass | PassNode | — |
| texture | Texture | — |
Returns
PassTextureNodeTSL function for creating a depth pass node.
| Parameter | Type | Default Value |
|---|---|---|
| scene | Scene | — |
| camera | Camera | — |
| options | Object | — |
Returns
PassNodeTSL function for creating a render output node.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node | — |
| toneMapping? | null | number | null |
| outputColorSpace? | null | string | null |
Returns
RenderOutputNodeTSL object that represents the current DPR.
Type
ScreenNode<float>TSL object that represents normalized screen coordinates, unitless in [0, 1].
Type
ScreenNode<vec2>TSL object that represents the screen resolution in physical pixel units.
Type
ScreenNode<vec2>TSL object that represents the current x/y pixel position on the screen in physical pixel units.
Type
ScreenNode<vec2>TSL object that represents the viewport rectangle as x, y, width and height in physical pixel units.
Type
ScreenNode<vec4>TSL object that represents the viewport resolution in physical pixel units.
Type
ScreenNode<vec2>TSL object that represents the current x/y pixel position on the viewport in physical pixel units.
Type
ScreenNode<vec2>TSL object that represents normalized viewport coordinates, unitless in [0, 1].
Type
ScreenNode<vec2>Type
anyLinear tone mapping, exposure only.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>Reinhard tone mapping.
Reference: {@link https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf}
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>Cineon tone mapping.
Reference: {@link http://filmicworlds.com/blog/filmic-tonemapping-operators/}
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>ACESFilmic tone mapping.
Reference: {@link https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs}
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>AgX tone mapping.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>Neutral tone mapping.
Reference: {@link https://modelviewer.dev/examples/tone-mapping}
| Parameter | Type | Default Value |
|---|---|---|
| color | Node<vec3> | — |
| exposure | Node<float> | — |
Returns
Node<vec3>TSL function for creating a tone mapping node.
| Parameter | Type | Default Value |
|---|---|---|
| mapping | number | — |
| exposure | any | — |
| color | any | — |
Returns
ToneMappingNode<vec3>TSL object that represents the global tone mapping exposure of the renderer.
Type
RendererReferenceNode<vec3>TSL function for creating a toon outline pass node.
| Parameter | Type | Default Value |
|---|---|---|
| scene | Scene | — |
| camera | Camera | — |
| color? | Color | new Color( 0, 0, 0 ) |
| thickness? | number | 0.003 |
| alpha? | number | 1 |
Returns
ToonOutlinePassNodeTSL function for converting a viewZ value to an orthographic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a reversed orthographic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting an orthographic depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a perspective depth value.
Note: {link https://twitter.com/gonnavis/status/1377183786949959682}.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a reversed perspective depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a perspective depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a logarithmic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a logarithmic depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL object that represents the depth value for the current fragment.
Type
ViewportDepthNodeTSL function for converting a perspective depth value to linear depth.
| Parameter | Type | Default Value |
|---|---|---|
| value? | Node<float> | — |
Returns
ViewportDepthNode<float>TSL object that represents the linear (orthographic) depth value of the current fragment
Type
ViewportDepthNodeTSL function for a viewport depth texture node.
| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | — |
| levelNode? | Node | — |
| depthTexture? | DepthTexture | — |
Returns
ViewportDepthTextureNodeTSL function for creating a viewport texture node.
| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | — |
| levelNode? | Node | — |
| framebufferTexture? | Texture | — |
Returns
ViewportTextureNodeTSL function for creating a viewport texture node with enabled mipmap generation.
| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | — |
| levelNode? | Node | — |
| framebufferTexture? | Texture | — |
Returns
ViewportTextureNodeTSL function for creating a viewport texture node with enabled mipmap generation. The texture should only contain the opaque rendering objects.
This should be used just in transparent or transmissive materials.
| Parameter | Type | Default Value |
|---|---|---|
| uv? | null | Node | screenUV |
| level? | null | Node | null |
Returns
ViewportTextureNodeConstructs a new range factor node.
| Parameter | Type | Default Value |
|---|---|---|
| near | Node | — |
| far | Node | — |
Returns
anyRepresents an exponential squared fog. This type of fog gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.
| Parameter | Type | Default Value |
|---|---|---|
| density | Node | — |
Returns
anyConstructs a new height fog factor node. This fog factor requires a Y-up coordinate system.
| Parameter | Type | Default Value |
|---|---|---|
| density | Node | — |
| height | Node | — |
Returns
anyThis class can be used to configure a fog for the scene.
Nodes of this type are assigned to Scene.fogNode.
| Parameter | Type | Default Value |
|---|---|---|
| color | Node | — |
| factor | Node | — |
Returns
anyReturns
voidReturns
voidType
anyReturns
voidReturns
voidType
anyReturns
voidThis computes a parallax corrected normal which is used for box-projected cube mapping (BPCEM).
Reference: {@link https://devlog-martinsh.blogspot.com/2011/09/box-projected-cube-environment-mapping.html}
const uvNode = getParallaxCorrectNormal( reflectVector, vec3( 200, 100, 100 ), vec3( 0, - 50, 0 ) );
material.envNode = pmremTexture( renderTarget.texture, uvNode );
export {}| Parameter | Type | Default Value |
|---|---|---|
| normal | Node<vec3> | — |
| cubeSize | Node<vec3> | — |
| cubePos | Node<vec3> | — |
Returns
Node<vec3>Returns
voidReturns
voidTSL function for creating a range node.
| Parameter | Type | Default Value |
|---|---|---|
| minNode? | Node<any> | — |
| maxNode? | Node<any> | — |
Returns
RangeNodeTSL function for appending an atomic function call into the programmatic flow of a compute shader.
| Parameter | Type | Default Value |
|---|---|---|
| method | string | — |
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeLoads the value stored in the atomic variable.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
Returns
AtomicFunctionNodeStores a value in the atomic variable.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeIncrements the value stored in the atomic variable.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeDecrements the value stored in the atomic variable.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeStores in an atomic variable the maximum between its current value and a parameter.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeStores in an atomic variable the minimum between its current value and a parameter.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeStores in an atomic variable the bitwise AND of its value with a parameter.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeStores in an atomic variable the bitwise OR of its value with a parameter.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeStores in an atomic variable the bitwise XOR of its value with a parameter.
| Parameter | Type | Default Value |
|---|---|---|
| pointerNode | Node | — |
| valueNode | Node | — |
Returns
AtomicFunctionNodeTSL function for creating a workgroup barrier. All compute shader invocations must wait for each invocation within a workgroup to complete before the barrier can be surpassed.
Returns
BarrierNodeTSL function for creating a storage barrier. All invocations must wait for each access to variables within the ‘storage’ address space to complete before the barrier can be passed.
Returns
BarrierNodeTSL function for creating a texture barrier. All invocations must wait for each access to variables within the ‘texture’ address space to complete before the barrier can be passed.
Returns
BarrierNodeRepresents the number of workgroups dispatched by the compute shader.
// Run 512 invocations/threads with a workgroup size of 128.
const computeFn = Fn(() => {
Cannot redeclare block-scoped variable 'computeFn'. (2451)
// numWorkgroups.x = 4
storageBuffer.element(0).assign(numWorkgroups.x)
})().compute(512, [128]);
// Run 512 invocations/threads with the default workgroup size of 64.
const computeFn = Fn(() => {
Cannot redeclare block-scoped variable 'computeFn'. (2451)
// numWorkgroups.x = 8
storageBuffer.element(0).assign(numWorkgroups.x)
})().compute(512);
export {}Type
ComputeBuiltinNode<uvec3>Represents the 3-dimensional index of the workgroup the current compute invocation belongs to.
// Execute 12 compute threads with a workgroup size of 3.
const computeFn = Fn( () => {
If( workgroupId.x.mod( 2 ).equal( 0 ), () => {
storageBuffer.element( instanceIndex ).assign( instanceIndex );
} ).Else( () => {
storageBuffer.element( instanceIndex ).assign( 0 );
} );
} )().compute( 12, [ 3 ] );
// workgroupId.x = [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3];
// Buffer Output = [0, 1, 2, 0, 0, 0, 6, 7, 8, 0, 0, 0];
export {}Type
ComputeBuiltinNode<uvec3>A non-linearized 3-dimensional representation of the current invocation’s position within a 3D global grid.
Type
ComputeBuiltinNode<uvec3>A non-linearized 3-dimensional representation of the current invocation’s position within a 3D workgroup grid.
Type
ComputeBuiltinNode<uvec3>A device dependent variable that exposes the size of the current invocation’s subgroup.
Type
ComputeBuiltinNode<uint>TSL function for creating a compute kernel node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| workgroupSize? | Array<number> | [64] |
Returns
ComputeNodeTSL function for creating a compute node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| count | number | Array<number> | — |
| workgroupSize? | Array<number> | [64 |
Returns
ComputeNodeReturns true if this invocation has the lowest subgroup_invocation_id among active invocations in the subgroup.
Returns
boolReturns a set of bitfields where the bit corresponding to subgroup_invocation_id is 1 if pred is true for that active invocation and 0 otherwise.
| Parameter | Type | Default Value |
|---|---|---|
| pred | bool | — |
Returns
vec4<u32>A reduction that adds e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn inclusive scan returning the sum of e for all active invocations with subgroup_invocation_id less than or equal to this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn exclusive scan that returns the sum of e for all active invocations with subgroup_invocation_id less than this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that multiplies e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn inclusive scan returning the product of e for all active invocations with subgroup_invocation_id less than or equal to this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn exclusive scan that returns the product of e for all active invocations with subgroup_invocation_id less than this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise and of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise or of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise xor of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a min of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a max of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberReturns true if e is true for all active invocations in the subgroup.
Returns
boolReturns true if e is true for any active invocation in the subgroup
Returns
boolBroadcasts e from the active invocation with the lowest subgroup_invocation_id in the subgroup to all other active invocations.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
| id | number | — |
Returns
numberSwaps e between invocations in the quad in the X direction.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberSwaps e between invocations in the quad in the Y direction.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberSwaps e between invocations in the quad diagonally.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberBroadcasts e from the invocation whose subgroup_invocation_id matches id, to all active invocations.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
| id | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches id
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| id | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id ^ mask.
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| mask | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id - delta
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| delta | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id + delta
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| delta | number | — |
Returns
numberBroadcasts e from the quad invocation with id equal to id.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberTSL function for creating a workgroup info node. Creates a new ‘workgroup’ scoped array buffer.
| Parameter | Type | Default Value |
|---|---|---|
| type | string | — |
| count? | number | 0 |
Returns
WorkgroupInfoNodeType
anyTSL function for creating an instance of LightsNode and configuring
it with the given array of lights.
| Parameter | Type | Default Value |
|---|---|---|
| lights? | Array<Light> | [] |
Returns
LightsNodeRepresents a discard shader operation in TSL.
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.lightDistance | Node<float> | — |
| inputs.cutoffDistance | Node<float> | — |
| inputs.decayExponent | Node<float> | — |
Returns
Node<float>| Parameter | Type | Default Value |
|---|---|---|
| { color, lightVector, cutoffDistance, decayExponent } | { color: any; lightVector: any; cutoffDistance: any; decayExponent: any; } | — |
Returns
| Property | Type | Modifiers |
|---|---|---|
| lightDirection | any | — |
| lightColor | any | — |
Returns
voidA shadow filtering function for point lights using Vogel disk sampling and IGN.
Uses 5 samples distributed via Vogel disk pattern in tangent space around the sample direction, rotated per-pixel using Interleaved Gradient Noise (IGN).
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.depthTexture | CubeDepthTexture | — |
| inputs.bd3D | Node<vec3> | — |
| inputs.dp | Node<float> | — |
| inputs.shadow | LightShadow | — |
Returns
Node<float>TSL function for creating an instance of PointShadowNode.
| Parameter | Type | Default Value |
|---|---|---|
| light | PointLight | — |
| shadow? | any | null |
Returns
PointShadowNodeTSL object that represents the vertex position in world space during the shadow pass.
Type
Node<vec3>A shadow filtering function performing basic filtering. This is in fact an unfiltered version of the shadow map
with a binary [0,1] result.
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.depthTexture | DepthTexture | — |
| inputs.shadowCoord | Node<vec3> | — |
Returns
Node<float>A shadow filtering function performing PCF filtering with Vogel disk sampling and IGN.
Uses 5 samples distributed via Vogel disk pattern, rotated per-pixel using Interleaved Gradient Noise (IGN) to break up banding artifacts. Combined with hardware PCF (4-tap filtering per sample), this effectively provides 20 filtered taps with better distribution.
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.depthTexture | DepthTexture | — |
| inputs.shadowCoord | Node<vec3> | — |
| inputs.shadow | LightShadow | — |
Returns
Node<float>A shadow filtering function performing PCF soft filtering.
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.depthTexture | DepthTexture | — |
| inputs.shadowCoord | Node<vec3> | — |
| inputs.shadow | LightShadow | — |
Returns
Node<float>A shadow filtering function performing VSM filtering.
| Parameter | Type | Default Value |
|---|---|---|
| inputs | Object | — |
| inputs.depthTexture | DepthTexture | — |
| inputs.shadowCoord | Node<vec3> | — |
Returns
Node<float>Retrieves or creates a shadow material for the given light source.
This function checks if a shadow material already exists for the provided light.
If not, it creates a new NodeMaterial configured for shadow rendering and stores it
in the shadowMaterialLib for future use.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
NodeMaterialDisposes the shadow material for the given light source.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
Returns
anyCreates a function to render shadow objects in a scene.
| Parameter | Type | Default Value |
|---|---|---|
| renderer | Renderer | — |
| shadow | LightShadow | — |
| shadowType | number | — |
| useVelocity | boolean | — |
Returns
shadowRenderObjectFunctionShadow Render Object Function.
TSL function for creating an instance of ShadowNode.
| Parameter | Type | Default Value |
|---|---|---|
| light | Light | — |
| shadow? | any | — |
Returns
ShadowNode| Parameter | Type | Default Value |
|---|---|---|
| threshold | any | — |
| value | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| valuel | any | — |
| valuer | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| valuet | any | — |
| valueb | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| valuetl | any | — |
| valuetr | any | — |
| valuebl | any | — |
| valuebr | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| valuel | any | — |
| valuer | any | — |
| center | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| valuet | any | — |
| valueb | any | — |
| center | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| uv_scale? | number | 1 |
| uv_offset? | number | 0 |
| uv_geo? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| input | any | — |
| amount? | number | 1 |
| pivot? | number | 0.5 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| amplitude? | number | 1 |
| pivot? | number | 0 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| amplitude? | number | 1 |
| pivot? | number | 0 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| amplitude? | number | 1 |
| pivot? | number | 0 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| noiseType | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
| freq? | any | vec2( 1, 1 ) |
| offset? | any | vec2( 0, 0 ) |
| jitter? | number | 1 |
| outmin? | number | 0 |
| outmax? | number | 1 |
| clampoutput? | boolean | false |
| octaves? | number | 1 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| noiseType | any | — |
| texcoord? | AttributeNode<vec2> | uv() |
| freq? | any | vec2( 1, 1 ) |
| offset? | any | vec2( 0, 0 ) |
| jitter? | number | 1 |
| outmin? | number | 0 |
| outmax? | number | 1 |
| clampoutput? | boolean | false |
| octaves? | number | 1 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| jitter? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| jitter? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
| jitter? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord? | AttributeNode<vec2> | uv() |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| position? | AttributeNode<vec2> | uv() |
| octaves? | number | 3 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
| amplitude? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| position? | AttributeNode<vec2> | uv() |
| octaves? | number | 3 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
| amplitude? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| position? | AttributeNode<vec2> | uv() |
| octaves? | number | 3 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
| amplitude? | number | 1 |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| position? | AttributeNode<vec2> | uv() |
| octaves? | number | 3 |
| lacunarity? | number | 2 |
| diminish? | number | 0.5 |
| amplitude? | number | 1 |
Returns
anyType
anyType
anyType
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 0 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 0 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 1 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 1 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 1 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| in2? | any | float( 1 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1? | any | float( 0 ) |
| in2? | any | float( 1 ) |
Returns
anyReturns
UniformNode<float>Returns
UniformNode<uint>| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| amount? | any | float( 1 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| value1 | any | — |
| value2 | any | — |
| in1 | any | — |
| in2 | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| value1 | any | — |
| value2 | any | — |
| in1 | any | — |
| in2 | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| value1 | any | — |
| value2 | any | — |
| in1 | any | — |
| in2 | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| in1 | any | — |
| channelOrOut? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| texcoord | any | — |
| pivot? | any | vec2( 0.5, 0.5 ) |
| scale? | any | vec2( 1, 1 ) |
| rotate? | any | float( 0 ) |
| offset? | any | vec2( 0, 0 ) |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| input | any | — |
| amount | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| input | any | — |
| amount | any | — |
| axis | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| input | any | — |
| scale | any | — |
Returns
anyReinterpret the bit representation of a value in one type as a value in another type.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
| y | string | — |
Returns
NodeBitcasts a float or a vector of floats to a corresponding integer type with the same element size.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<float> | — |
Returns
BitcastNodeBitcasts a float or a vector of floats to a corresponding unsigned integer type with the same element size.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<float> | — |
Returns
BitcastNodeBitcasts an integer or a vector of integers to a corresponding float type with the same element size.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<int> | — |
Returns
BitcastNodeBitcast an unsigned integer or a vector of unsigned integers to a corresponding float type with the same element size.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<uint> | — |
Returns
BitcastNodeFinds the number of consecutive 0 bits from the least significant bit of the input value, which is also the index of the least significant bit of the input value.
Can only be used with WebGPURenderer and a WebGPU backend.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds the number of consecutive 0 bits starting from the most significant bit of the input value.
Can only be used with WebGPURenderer and a WebGPU backend.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds the number of ’1’ bits set in the input value
Can only be used with WebGPURenderer and a WebGPU backend.
Returns
NodeTSL function for creating a conditional node.
| Parameter | Type | Default Value |
|---|---|---|
| condNode | Node | — |
| ifNode | Node | — |
| elseNode? | Node | — |
Returns
ConditionalNodeGenerates a hash value in the range [0, 1] from the given seed.
| Parameter | Type | Default Value |
|---|---|---|
| seed | Node<float> | — |
Returns
Node<float>A small value used to handle floating-point precision errors.
Type
Node<float>Represents infinity.
Type
Node<float>Represents PI.
Type
Node<float>Represents PI * 2. Please use the non-deprecated version TWO_PI.
Type
Node<float>Represents PI * 2.
Type
Node<float>Represents PI / 2.
Type
Node<float>Returns true if all components of x are true.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
Node<bool>Returns true if any components of x are true.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
Node<bool>Converts a quantity in degrees to radians.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeConvert a quantity in radians to degrees.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the natural exponentiation of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns 2 raised to the power of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the natural logarithm of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the base 2 logarithm of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the square root of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the inverse of the square root of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds the nearest integer less than or equal to the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds the nearest integer that is greater than or equal to the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeCalculates the unit vector in the same direction as the original vector.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | — |
Returns
NodeComputes the fractional part of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the sine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the hyperbolic sine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the cosine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the hyperbolic cosine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the tangent of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the hyperbolic tangent of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the arcsine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the inverse hyperbolic sine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the arccosine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the inverse hyperbolic cosine of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the arc-tangent of the parameter.
If two parameters are provided, the result is atan2(y/x).
| Parameter | Type | Default Value |
|---|---|---|
| y | Node | number | — |
| x | Node | number | — |
Returns
NodeReturns the inverse hyperbolic tangent of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the absolute value of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeExtracts the sign of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeCalculates the length of a vector.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | — |
Returns
Node<float>Negates the value of the parameter (-x).
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturn 1 minus the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the partial derivative of the parameter with respect to x.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the partial derivative of the parameter with respect to y.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeRounds the parameter to the nearest integer.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the reciprocal of the parameter (1/x).
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeTruncates the parameter, removing the fractional part.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the sum of the absolute derivatives in x and y.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeReturns the transpose of a matrix.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<mat2|mat3|mat4> | — |
Returns
NodeReturns the determinant of a matrix.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<mat2|mat3|mat4> | — |
Returns
Node<float>Returns the inverse of a matrix.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<mat2|mat3|mat4> | — |
Returns
Node<mat2|mat3|mat4>Returns the least of the given values.
| Parameter | Type | Default Value |
|---|---|---|
| values | ...Node | number | — |
Returns
NodeReturns the greatest of the given values.
| Parameter | Type | Default Value |
|---|---|---|
| values | ...Node | number | — |
Returns
NodeGenerate a step function by comparing two values.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
| y | Node | number | — |
Returns
NodeCalculates the reflection direction for an incident vector.
| Parameter | Type | Default Value |
|---|---|---|
| I | Node<vec2|vec3|vec4> | — |
| N | Node<vec2|vec3|vec4> | — |
Returns
Node<vec2|vec3|vec4>Calculates the distance between two points.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<vec2|vec3|vec4> | — |
| y | Node<vec2|vec3|vec4> | — |
Returns
Node<float>Calculates the absolute difference between two values.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
| y | Node | number | — |
Returns
NodeCalculates the dot product of two vectors.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<vec2|vec3|vec4> | — |
| y | Node<vec2|vec3|vec4> | — |
Returns
Node<float>Calculates the cross product of two vectors.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<vec2|vec3> | — |
| y | Node<vec2|vec3> | — |
Returns
Node<float|vec3>Return the value of the first parameter raised to the power of the second one.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
| y | Node | number | — |
Returns
NodeReturns the square of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | number | Node | — |
Returns
NodeReturns the cube of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | number | Node | — |
Returns
NodeReturns the fourth power of the parameter.
| Parameter | Type | Default Value |
|---|---|---|
| x | number | Node | — |
Returns
NodeTransforms the direction of a vector by a matrix and then normalizes the result.
| Parameter | Type | Default Value |
|---|---|---|
| direction | Node<vec2|vec3|vec4> | — |
| matrix | Node<mat2|mat3|mat4> | — |
Returns
NodeReturns the cube root of a number.
| Parameter | Type | Default Value |
|---|---|---|
| a | number | Node | — |
Returns
NodeCalculate the squared length of a vector.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node<vec2|vec3|vec4> | — |
Returns
Node<float>Linearly interpolates between two values.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | number | — |
| b | Node | number | — |
| t | Node | number | — |
Returns
NodeConstrains a value to lie between two further values.
| Parameter | Type | Default Value |
|---|---|---|
| value | number | Node | — |
| low? | number | Node | 0 |
| high? | number | Node | 1 |
Returns
NodeConstrains a value between 0 and 1.
| Parameter | Type | Default Value |
|---|---|---|
| value | number | Node | — |
Returns
NodeCalculates the refraction direction for an incident vector.
| Parameter | Type | Default Value |
|---|---|---|
| I | Node<vec2|vec3|vec4> | — |
| N | Node<vec2|vec3|vec4> | — |
| eta | Node<float> | — |
Returns
Node<vec2|vec3|vec4>Performs a Hermite interpolation between two values.
| Parameter | Type | Default Value |
|---|---|---|
| low | Node | number | — |
| high | Node | number | — |
| x | Node | number | — |
Returns
NodeReturns a vector pointing in the same direction as another.
| Parameter | Type | Default Value |
|---|---|---|
| N | Node<vec2|vec3|vec4> | — |
| I | Node<vec2|vec3|vec4> | — |
| Nref | Node<vec2|vec3|vec4> | — |
Returns
Node<vec2|vec3|vec4>Returns a random value for the given uv.
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
Returns
Node<float>Alias for mix() with a different parameter order.
| Parameter | Type | Default Value |
|---|---|---|
| t | number | Node | — |
| e1 | number | Node | — |
| e2 | number | Node | — |
Returns
NodeAlias for smoothstep() with a different parameter order.
| Parameter | Type | Default Value |
|---|---|---|
| x | number | Node | — |
| low | number | Node | — |
| high | number | Node | — |
Returns
NodeAlias for step() with a different parameter order.
| Parameter | Type | Default Value |
|---|---|---|
| x | number | Node | — |
| edge | number | Node | — |
Returns
NodeType
anyType
anyA function that remaps the [0,1] interval into the [0,1] interval.
The corners are mapped to 0 and the center to 1.
Reference: {@link https://iquilezles.org/articles/functions/}.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<float> | — |
| k | Node<float> | — |
Returns
Node<float>A function that remaps the [0,1] interval into the [0,1] interval.
Expands the sides and compresses the center, and keeps 0.5 mapped to 0.5.
Reference: {@link https://iquilezles.org/articles/functions/}.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<float> | — |
| k | Node<float> | — |
Returns
Node<float>A function that remaps the [0,1] interval into the [0,1] interval.
A generalization of the parabola(). Keeps the corners mapped to 0 but allows the control of the shape one either side of the curve.
Reference: {@link https://iquilezles.org/articles/functions/}.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<float> | — |
| a | Node<float> | — |
| b | Node<float> | — |
Returns
Node<float>A phase shifted sinus curve that starts at zero and ends at zero, with bouncing behavior. Reference: {@link https://iquilezles.org/articles/functions/}.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node<float> | — |
| k | Node<float> | — |
Returns
Node<float>Returns the addition of two or more value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
| params | ...Node | — |
Returns
OperatorNodeReturns the subtraction of two or more value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
| params | ...Node | — |
Returns
OperatorNodeReturns the multiplication of two or more value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
| params | ...Node | — |
Returns
OperatorNodeReturns the division of two or more value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
| params | ...Node | — |
Returns
OperatorNodeComputes the remainder of dividing the first node by the second one.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if two nodes are equal.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if two nodes are not equal.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if the first node is less than the second.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if the first node is greater than the second.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if the first node is less than or equal to the second.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeChecks if the first node is greater than or equal to the second.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodePerforms a logical AND operation on multiple nodes.
| Parameter | Type | Default Value |
|---|---|---|
| nodes | ...Node | — |
Returns
OperatorNodePerforms a logical OR operation on multiple nodes.
| Parameter | Type | Default Value |
|---|---|---|
| nodes | ...Node | — |
Returns
OperatorNodePerforms logical NOT on a node.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node | — |
Returns
OperatorNodePerforms logical XOR on two nodes.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodePerforms bitwise AND on two nodes.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodePerforms bitwise NOT on a node.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodePerforms bitwise OR on two nodes.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodePerforms bitwise XOR on two nodes.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeShifts a node to the left.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeShifts a node to the right.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeIncrements a node by 1.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
Returns
OperatorNodeDecrements a node by 1.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
Returns
OperatorNodeIncrements a node by 1 and returns the previous value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
Returns
OperatorNodeDecrements a node by 1 and returns the previous value.
| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
Returns
OperatorNode| Parameter | Type | Default Value |
|---|---|---|
| a | Node | — |
| b | Node | — |
Returns
OperatorNodeConverts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. round(clamp(c, -1, +1) * 32767.0)
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<vec2> | — |
Returns
NodeConverts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. round(clamp(c, 0, +1) * 65535.0)
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<vec2> | — |
Returns
NodeConverts each component of the vec2 to 16-bit floating-point values. The results are packed into a single unsigned integer.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<vec2> | — |
Returns
NodeGenerates a noise value from the given position, speed and time parameters.
| Parameter | Type | Default Value |
|---|---|---|
| position | Node<vec3> | — |
| speed | Node<float> | — |
| time | Node<float> | — |
Returns
Node<float>Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized signed integers. Returns a vec2 with both values.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<uint> | — |
Returns
NodeUnpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized unsigned integers. Returns a vec2 with both values.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<uint> | — |
Returns
NodeUnpacks a 32-bit unsigned integer into two 16-bit values, interpreted as 16-bit floating-point numbers. Returns a vec2 with both values.
| Parameter | Type | Default Value |
|---|---|---|
| value | Node<uint> | — |
Returns
NodeTSL function for creating a PMREM node.
| Parameter | Type | Default Value |
|---|---|---|
| value | Texture | — |
| uvNode? | Node<vec2> | — |
| levelNode? | Node<float> | — |
Returns
PMREMNodeType
anyReturns
voidReturns
voidReturns
voidCreates a 2x2 checkerboard pattern that can be used as procedural texture data.
| Parameter | Type | Default Value |
|---|---|---|
| coord | Node<vec2> | — |
Returns
Node<float>Generates a circle based on the uv coordinates.
| Parameter | Type | Default Value |
|---|---|---|
| coord | Node<vec2> | — |
Returns
Node<float>| Parameter | Type | Default Value |
|---|---|---|
| name | any | — |
Returns
void| Parameter | Type | Default Value |
|---|---|---|
| name | any | — |
| nodeElement | any | — |
Returns
void| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
Returns
boolean| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| jsFunc | any | — |
| nodeType | any | — |
Returns
ShaderNodeInternal| Parameter | Type | Default Value |
|---|---|---|
| val | any | — |
| altType? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| val | any | — |
| altType? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| val | any | — |
| altType? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| val | any | — |
| altType? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| NodeClass | any | — |
| scope? | null | null |
| factor? | null | null |
| settings? | null | null |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| NodeClass | any | — |
| params | ...Array<any> | — |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| NodeClass | any | — |
| scope? | null | null |
| factor? | null | null |
| settings? | {} | {} |
Returns
any| Parameter | Type | Default Value |
|---|---|---|
| jsFunc | any | — |
| layout? | null | null |
Returns
() => void| Parameter | Type | Default Value |
|---|---|---|
| stack | any | — |
Returns
voidReturns
anyRepresent a conditional node using if/else statements.
If( condition, function )
.ElseIf( condition, function )
.Else( function )
export {}| Parameter | Type | Default Value |
|---|---|---|
| params | ...any | — |
Returns
StackNodeRepresent a conditional node using switch/case statements.
Switch( value )
.Case( 1, function )
.Case( 2, 3, 4, function )
.Default( function )
export {}| Parameter | Type | Default Value |
|---|---|---|
| params | ...any | — |
Returns
StackNodeAdd the given node to the current stack.
Properties
NodeReturns
NodeType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
anyType
any| Parameter | Type | Default Value |
|---|---|---|
| value? | string | |
Returns
ConstNode| Parameter | Type | Default Value |
|---|---|---|
| value | any | — |
Returns
ConstNodeType
any| Parameter | Type | Default Value |
|---|---|---|
| node | any | — |
| types | any | — |
Returns
ConvertNode| Parameter | Type | Default Value |
|---|---|---|
| node | any | — |
| channels | any | — |
Returns
SplitNode| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
Returns
FunctionTSL function for creating a debug node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| callback? | null | Function | null |
Returns
DebugNodeRepresents a discard shader operation in TSL.
| Parameter | Type | Default Value |
|---|---|---|
| conditional | any | — |
Returns
NodeRepresents a return shader operation in TSL.
Returns
ExpressionNodeTSL function for creating an equirect uv node.
Can be used to compute texture coordinates for projecting an equirectangular texture onto a mesh for using it as the scene’s background.
scene.backgroundNode = texture( equirectTexture, equirectUV() );
export {}| Parameter | Type | Default Value |
|---|---|---|
| dirNode? | Node<vec3> | — |
Returns
Node<vec2>Creates an event that triggers a function every time an object (Mesh|Sprite) is rendered.
The event will be bound to the declared TSL function Fn(); it must be declared within a Fn() or the JS function call must be inherited from one.
Properties
FunctionReturns
EventNodeCreates an event that triggers a function when the first object that uses the material is rendered.
The event will be bound to the declared TSL function Fn(); it must be declared within a Fn() or the JS function call must be inherited from one.
Properties
FunctionReturns
EventNodeCreates an event that triggers a function before an object (Mesh|Sprite) is updated.
The event will be bound to the declared TSL function Fn(); it must be declared within a Fn() or the JS function call must be inherited from one.
Properties
FunctionReturns
EventNodeCreates an event that triggers a function before the material is updated.
The event will be bound to the declared TSL function Fn(); it must be declared within a Fn() or the JS function call must be inherited from one.
Properties
FunctionReturns
EventNodeTSL function for creating a function overloading node.
| Parameter | Type | Default Value |
|---|---|---|
| functionNodes | Array<Function> | — |
Returns
FunctionOverloadingNodeTSL function for creating a loop node.
Properties
...Array<any>Returns
LoopNodeTSL function for creating a Continue() expression.
Returns
ExpressionNodeTSL function for creating a Break() expression.
Returns
ExpressionNodeTSL function for creating a matcap uv node.
Can be used to compute texture coordinates for projecting a matcap onto a mesh. Used by MeshMatcapNodeMaterial.
Returns
Node<vec2>TSL function for creating a max mip level node.
| Parameter | Type | Default Value |
|---|---|---|
| textureNode | TextureNode | — |
Returns
MaxMipLevelNodeGenerates a sine wave oscillation based on a timer.
| Parameter | Type | Default Value |
|---|---|---|
| t | Node<float> | — |
Returns
Node<float>Generates a square wave oscillation based on a timer.
| Parameter | Type | Default Value |
|---|---|---|
| t | Node<float> | — |
Returns
Node<float>Generates a triangle wave oscillation based on a timer.
| Parameter | Type | Default Value |
|---|---|---|
| t | Node<float> | — |
Returns
Node<float>Generates a sawtooth wave oscillation based on a timer.
| Parameter | Type | Default Value |
|---|---|---|
| t | Node<float> | — |
Returns
Node<float>Packs a direction vector into a color value.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node<vec3> | — |
Returns
Node<vec3>Unpacks a color value into a direction vector.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node<vec3> | — |
Returns
Node<vec3>Unpacks a tangent space normal, reconstructing the Z component by projecting the X,Y coordinates onto the hemisphere. The X,Y coordinates are expected to be in the [-1, 1] range.
| Parameter | Type | Default Value |
|---|---|---|
| xy | Node<vec2> | — |
Returns
Node<vec3>Computes a position in view space based on a fragment’s screen position expressed as uv coordinates, the fragments depth value and the camera’s inverse projection matrix.
| Parameter | Type | Default Value |
|---|---|---|
| screenPosition | Node<vec2> | — |
| depth | Node<float> | — |
| projectionMatrixInverse | Node<mat4> | — |
Returns
Node<vec3>Computes a screen position expressed as uv coordinates based on a fragment’s position in view space and the camera’s projection matrix
| Parameter | Type | Default Value |
|---|---|---|
| viewPosition | Node<vec3> | — |
| projectionMatrix | Node<mat4> | — |
Returns
Node<vec2>Computes a normal vector based on depth data. Can be used as a fallback when no normal render target is available or if flat surface normals are required.
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
| depthTexture | DepthTexture | — |
| projectionMatrixInverse | Node<mat4> | — |
Returns
Node<vec3>Interleaved Gradient Noise (IGN) from Jimenez 2014.
IGN has “low discrepancy” resulting in evenly distributed samples. It’s superior compared to default white noise, blue noise or Bayer.
References:
| Parameter | Type | Default Value |
|---|---|---|
| position | Node<vec2> | — |
Returns
Node<float>Vogel disk sampling for uniform circular distribution.
This function generates sample points distributed uniformly on a disk using the golden angle, resulting in an efficient low-discrepancy sequence for sampling. The rotation parameter (phi) allows randomizing the pattern per-pixel when combined with IGN.
| Parameter | Type | Default Value |
|---|---|---|
| sampleIndex | Node<int> | — |
| samplesCount | Node<int> | — |
| phi | Node<float> | — |
Returns
Node<vec2>TSL function for creating a reflector node.
| Parameter | Type | Default Value |
|---|---|---|
| parameters? | { target?: Object3D | undefined; resolution?: number | undefined; generateMipmaps?: boolean | undefined; bounces?: boolean | undefined; depth?: boolean | undefined; samples?: number | undefined; defaultTexture?: TextureNode | undefined; reflector?: ReflectorBaseNode | undefined; } | {} |
Returns
ReflectorNodeThis node allows to remap a node value from one range into another. E.g a value of
0.4 in the range [ 0.3, 0.5 ] should be remapped into the normalized range [ 0, 1 ].
remap takes care of that and converts the original value of 0.4 to 0.5.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| inLowNode | Node | — |
| inHighNode | Node | — |
| outLowNode? | Node | — |
| outHighNode? | Node | — |
Returns
NodeThis node allows to remap a node value from one range into another but with enabled clamping. E.g a value of
0.4 in the range [ 0.3, 0.5 ] should be remapped into the normalized range [ 0, 1 ].
remapClamp takes care of that and converts the original value of 0.4 to 0.5.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| inLowNode | Node | — |
| inHighNode | Node | — |
| outLowNode? | null | Node | float( 0 ) |
| outHighNode? | null | Node | float( 1 ) |
Returns
NodeTSL function for creating a rotate node.
| Parameter | Type | Default Value |
|---|---|---|
| positionNode | Node | — |
| rotationNode | Node | — |
Returns
RotateNodeTSL function for creating a RTT node.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| params | ...Array<any> | — |
Returns
RTTNodeTSL function for converting nodes to textures nodes.
| Parameter | Type | Default Value |
|---|---|---|
| node | Node | — |
| params | ...Array<any> | — |
Returns
RTTNodeHelper function to create a SampleNode wrapped as a node object.
| Parameter | Type | Default Value |
|---|---|---|
| callback | Function | — |
| uv? | any | null |
Returns
SampleNodeTSL function for computing texture coordinates for animated sprite sheets.
const uvNode = spritesheetUV( vec2( 6, 6 ), uv(), time.mul( animationSpeed ) );
material.colorNode = texture( spriteSheet, uvNode );
export {}| Parameter | Type | Default Value |
|---|---|---|
| countNode | Node<vec2> | — |
| uvNode? | Node<vec2> | — |
| frameNode? | Node<float> | — |
Returns
Node<vec2>This can be used to achieve a billboarding behavior for flat meshes. That means they are oriented always towards the camera.
material.vertexNode = billboarding();
export {}| Parameter | Type | Default Value |
|---|---|---|
| config | Object | — |
| config.position? | Node<vec3> | null | null |
| config.horizontal? | boolean | true |
| config.vertical? | boolean | false |
Returns
Node<vec3>Represents the elapsed time in seconds.
Type
UniformNode<float>Represents the delta time in seconds.
Type
UniformNode<float>Represents the current frame ID.
Type
UniformNode<uint>TSL function for creating a triplanar textures node.
Can be used for triplanar texture mapping.
material.colorNode = triplanarTexture( texture( diffuseMap ) );
export {}| Parameter | Type | Default Value |
|---|---|---|
| textureXNode | Node | — |
| textureYNode? | Node | — |
| textureZNode? | Node | — |
| scaleNode? | Node<float> | — |
| positionNode? | Node<vec3> | — |
| normalNode? | Node<vec3> | — |
Returns
Node<vec4>TSL function for creating a triplanar textures node.
| Parameter | Type | Default Value |
|---|---|---|
| textureXNode | Node | — |
| textureYNode? | Node | — |
| textureZNode? | Node | — |
| scaleNode? | Node<float> | — |
| positionNode? | Node<vec3> | — |
| normalNode? | Node<vec3> | — |
Returns
Node<vec4>Replaces the default UV coordinates used in texture lookups.
material.contextNode = replaceDefaultUV( ( textureNode ) => {
// ...
return customUVCoordinates;
} );
export {}| Parameter | Type | Default Value |
|---|---|---|
| callback | (arg0: Node) => Node<any> | Node<any> | — |
| node? | Node | null |
Returns
ContextNodeRotates the given uv coordinates around a center point
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
| rotation | Node<float> | — |
| center | Node<vec2> | — |
Returns
Node<vec2>Applies a spherical warping effect to the given uv coordinates.
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
| strength | Node<float> | — |
| center | Node<vec2> | — |
Returns
Node<vec2>A special version of a screen uv function that involves a depth comparison when computing the final uvs. The function mitigates visual errors when using viewport texture nodes for refraction purposes. Without this function objects in front of a refractive surface might appear on the refractive surface which is incorrect.
| Parameter | Type | Default Value |
|---|---|---|
| uv | Node<vec2> | — |
Returns
Node<vec2>