bufferAttribute

Last modified: Mar 5, 2026

TSL function for creating a buffer attribute node.

ParameterTypeDefault Value
arrayany
type?null | stringnull
stride?number0
offset?number0

Returns

Node | BufferAttributeNode

dynamicBufferAttribute

TSL function for creating a buffer attribute node but with dynamic draw usage. Use this function if attribute data are updated per frame.

ParameterTypeDefault Value
arrayany
type?null | stringnull
stride?number0
offset?number0

Returns

Node | BufferAttributeNode

instancedBufferAttribute

TSL function for creating a buffer attribute node but with enabled instancing

ParameterTypeDefault Value
arrayany
type?null | stringnull
stride?number0
offset?number0

Returns

Node | BufferAttributeNode

instancedDynamicBufferAttribute

TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing

ParameterTypeDefault Value
arrayany
type?null | stringnull
stride?number0
offset?number0

Returns

Node | BufferAttributeNode

expression

TSL function for creating an expression node.

ParameterTypeDefault Value
snippet?string
nodeType?string

Returns

ExpressionNode

call

ParameterTypeDefault Value
funcany
params...Array<any>

Returns

FunctionCallNode

array

TSL function for creating an array node.

ParameterTypeDefault Value
params...Array<any>

Returns

ArrayNode

assign

TSL function for creating an assign node.

ParameterTypeDefault Value
targetNodeNode
sourceNodeNode

Returns

AssignNode

bypass

TSL function for creating a bypass node.

ParameterTypeDefault Value
outputNodeNode
callNodeNode

Returns

BypassNode

context

TSL function for creating a context node.

ParameterTypeDefault Value
nodeOrValue?Object | Nodenull
value?Object{}

Returns

ContextNode

uniformFlow

TSL function for defining a uniformFlow context value for a given node.

ParameterTypeDefault Value
nodeNode

Returns

ContextNode

setName

TSL function for defining a name for the context value for a given node.

ParameterTypeDefault Value
nodeNode
namestring

Returns

ContextNode

builtinShadowContext

TSL function for defining a built-in shadow context for a given node.

ParameterTypeDefault Value
shadowNodeShadowNode
lightLight
node?Nodenull

Returns

ContextNode

builtinAOContext

TSL function for defining a built-in ambient occlusion context for a given node.

ParameterTypeDefault Value
aoNodeNode
node?Nodenull

Returns

ContextNode

label

TSL function for defining a label context value for a given node.

ParameterTypeDefault Value
nodeNode
namestring

Returns

ContextNode

inspector

Creates an inspector node to wrap around a given node for inspection purposes.

ParameterTypeDefault Value
nodeNode
name?string
callback?null | Functionnull

Returns

Node

isolate

TSL function for creating a cache node.

ParameterTypeDefault Value
nodeNode

Returns

IsolateNode

cache

TSL function for creating a cache node.

ParameterTypeDefault Value
nodeNode
parent?booleantrue

Returns

IsolateNode

property

TSL function for creating a property node.

ParameterTypeDefault Value
typestring
name?null | stringnull

Returns

PropertyNode

varyingProperty

TSL function for creating a varying property node.

ParameterTypeDefault Value
typestring
name?null | stringnull

Returns

PropertyNode

diffuseColor

TSL object that represents the shader variable DiffuseColor.

Type

PropertyNode<vec4>

diffuseContribution

TSL object that represents the shader variable DiffuseContribution.

Type

PropertyNode<vec3>

emissive

TSL object that represents the shader variable EmissiveColor.

Type

PropertyNode<vec3>

roughness

TSL object that represents the shader variable Roughness.

Type

PropertyNode<float>

metalness

TSL object that represents the shader variable Metalness.

Type

PropertyNode<float>

clearcoat

TSL object that represents the shader variable Clearcoat.

Type

PropertyNode<float>

clearcoatRoughness

TSL object that represents the shader variable ClearcoatRoughness.

Type

PropertyNode<float>

sheen

TSL object that represents the shader variable Sheen.

Type

PropertyNode<vec3>

sheenRoughness

TSL object that represents the shader variable SheenRoughness.

Type

PropertyNode<float>

iridescence

TSL object that represents the shader variable Iridescence.

Type

PropertyNode<float>

iridescenceIOR

TSL object that represents the shader variable IridescenceIOR.

Type

PropertyNode<float>

iridescenceThickness

TSL object that represents the shader variable IridescenceThickness.

Type

PropertyNode<float>

alphaT

TSL object that represents the shader variable AlphaT.

Type

PropertyNode<float>

anisotropy

TSL object that represents the shader variable Anisotropy.

Type

PropertyNode<float>

anisotropyT

TSL object that represents the shader variable AnisotropyT.

Type

PropertyNode<vec3>

anisotropyB

TSL object that represents the shader variable AnisotropyB.

Type

PropertyNode<vec3>

specularColor

TSL object that represents the shader variable SpecularColor.

Type

PropertyNode<color>

specularColorBlended

TSL object that represents the shader variable SpecularColorBlended.

Type

PropertyNode<color>

specularF90

TSL object that represents the shader variable SpecularF90.

Type

PropertyNode<float>

shininess

TSL object that represents the shader variable Shininess.

Type

PropertyNode<float>

output

TSL object that represents the shader variable Output.

Type

PropertyNode<vec4>

dashSize

TSL object that represents the shader variable dashSize.

Type

PropertyNode<float>

gapSize

TSL object that represents the shader variable gapSize.

Type

PropertyNode<float>

pointWidth

TSL object that represents the shader variable pointWidth.

Type

PropertyNode<float>

ior

TSL object that represents the shader variable IOR.

Type

PropertyNode<float>

transmission

TSL object that represents the shader variable Transmission.

Type

PropertyNode<float>

thickness

TSL object that represents the shader variable Thickness.

Type

PropertyNode<float>

attenuationDistance

TSL object that represents the shader variable AttenuationDistance.

Type

PropertyNode<float>

attenuationColor

TSL object that represents the shader variable AttenuationColor.

Type

PropertyNode<color>

dispersion

TSL object that represents the shader variable Dispersion.

Type

PropertyNode<float>

subBuild

Creates a new sub-build node.

ParameterTypeDefault Value
nodeNode
namestring
type?null | stringnull

Returns

Node

uniform

TSL function for creating a uniform node.

ParameterTypeDefault Value
valueany
type?string

Returns

UniformNode

Var

TSL function for creating a var node.

ParameterTypeDefault Value
nodeNode
name?null | stringnull

Returns

VarNode

Const

TSL function for creating a const node.

ParameterTypeDefault Value
nodeNode
name?null | stringnull

Returns

VarNode

VarIntent

TSL function for creating a var intent node.

Properties

Node

Returns

VarNode

varying

TSL function for creating a varying node.

ParameterTypeDefault Value
nodeNode
namestring

Returns

VaryingNode

vertexStage

Computes a node in the vertex stage.

ParameterTypeDefault Value
nodeNode

Returns

VaryingNode

workingToColorSpace

TSL function for converting a given color node from the current working color space to the given color space.

ParameterTypeDefault Value
nodeNode
targetColorSpacestring

Returns

ColorSpaceNode

colorSpaceToWorking

TSL function for converting a given color node from the given color space to the current working color space.

ParameterTypeDefault Value
nodeNode
sourceColorSpacestring

Returns

ColorSpaceNode

convertColorSpace

TSL function for converting a given color node from one color space to another one.

ParameterTypeDefault Value
nodeNode
sourceColorSpacestring
targetColorSpacestring

Returns

ColorSpaceNode

renderOutput

TSL function for creating a render output node.

ParameterTypeDefault Value
colorNode
toneMapping?null | numbernull
outputColorSpace?null | stringnull

Returns

RenderOutputNode

toneMapping

TSL function for creating a tone mapping node.

ParameterTypeDefault Value
mappingnumber
exposureany
colorany

Returns

ToneMappingNode<vec3>

toneMappingExposure

TSL object that represents the global tone mapping exposure of the renderer.

Type

RendererReferenceNode<vec3>

computeKernel

TSL function for creating a compute kernel node.

ParameterTypeDefault Value
nodeNode
workgroupSize?Array<number>[64]

Returns

ComputeNode

compute

TSL function for creating a compute node.

ParameterTypeDefault Value
nodeNode
countnumber | Array<number>
workgroupSize?Array<number>[64

Returns

ComputeNode

select

TSL function for creating a conditional node.

ParameterTypeDefault Value
condNodeNode
ifNodeNode
elseNode?Node

Returns

ConditionalNode

EPSILON

A small value used to handle floating-point precision errors.

Type

Node<float>

INFINITY

Represents infinity.

Type

Node<float>

PI

Represents PI.

Type

Node<float>

PI2

Represents PI * 2. Please use the non-deprecated version TWO_PI.

Type

Node<float>

TWO_PI

Represents PI * 2.

Type

Node<float>

HALF_PI

Represents PI / 2.

Type

Node<float>

all

Returns true if all components of x are true.

ParameterTypeDefault Value
xNode | number

Returns

Node<bool>

any

Returns true if any components of x are true.

ParameterTypeDefault Value
xNode | number

Returns

Node<bool>

radians

Converts a quantity in degrees to radians.

ParameterTypeDefault Value
xNode | number

Returns

Node

degrees

Convert a quantity in radians to degrees.

ParameterTypeDefault Value
xNode | number

Returns

Node

exp

Returns the natural exponentiation of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

exp2

Returns 2 raised to the power of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

log

Returns the natural logarithm of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

log2

Returns the base 2 logarithm of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

sqrt

Returns the square root of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

inverseSqrt

Returns the inverse of the square root of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

floor

Finds the nearest integer less than or equal to the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

ceil

Finds the nearest integer that is greater than or equal to the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

normalize

Calculates the unit vector in the same direction as the original vector.

ParameterTypeDefault Value
xNode

Returns

Node

fract

Computes the fractional part of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

sin

Returns the sine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

sinh

Returns the hyperbolic sine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

cos

Returns the cosine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

cosh

Returns the hyperbolic cosine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

tan

Returns the tangent of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

tanh

Returns the hyperbolic tangent of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

asin

Returns the arcsine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

asinh

Returns the inverse hyperbolic sine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

acos

Returns the arccosine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

acosh

Returns the inverse hyperbolic cosine of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

atan

Returns the arc-tangent of the parameter. If two parameters are provided, the result is atan2(y/x).

ParameterTypeDefault Value
yNode | number
xNode | number

Returns

Node

atanh

Returns the inverse hyperbolic tangent of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

abs

Returns the absolute value of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

sign

Extracts the sign of the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

length

Calculates the length of a vector.

ParameterTypeDefault Value
xNode

Returns

Node<float>

negate

Negates the value of the parameter (-x).

ParameterTypeDefault Value
xNode | number

Returns

Node

oneMinus

Return 1 minus the parameter.

ParameterTypeDefault Value
xNode | number

Returns

Node

dFdx

Returns the partial derivative of the parameter with respect to x.

ParameterTypeDefault Value
xNode | number

Returns

Node

dFdy

Returns the partial derivative of the parameter with respect to y.

ParameterTypeDefault Value
xNode | number

Returns

Node

round

Rounds the parameter to the nearest integer.

ParameterTypeDefault Value
xNode | number

Returns

Node

reciprocal

Returns the reciprocal of the parameter (1/x).

ParameterTypeDefault Value
xNode | number

Returns

Node

trunc

Truncates the parameter, removing the fractional part.

ParameterTypeDefault Value
xNode | number

Returns

Node

fwidth

Returns the sum of the absolute derivatives in x and y.

ParameterTypeDefault Value
xNode | number

Returns

Node

transpose

Returns the transpose of a matrix.

ParameterTypeDefault Value
xNode<mat2|mat3|mat4>

Returns

Node

determinant

Returns the determinant of a matrix.

ParameterTypeDefault Value
xNode<mat2|mat3|mat4>

Returns

Node<float>

inverse

Returns the inverse of a matrix.

ParameterTypeDefault Value
xNode<mat2|mat3|mat4>

Returns

Node<mat2|mat3|mat4>

min

Returns the least of the given values.

ParameterTypeDefault Value
values...Node | number

Returns

Node

max

Returns the greatest of the given values.

ParameterTypeDefault Value
values...Node | number

Returns

Node

step

Generate a step function by comparing two values.

ParameterTypeDefault Value
xNode | number
yNode | number

Returns

Node

reflect

Calculates the reflection direction for an incident vector.

ParameterTypeDefault Value
INode<vec2|vec3|vec4>
NNode<vec2|vec3|vec4>

Returns

Node<vec2|vec3|vec4>

distance

Calculates the distance between two points.

ParameterTypeDefault Value
xNode<vec2|vec3|vec4>
yNode<vec2|vec3|vec4>

Returns

Node<float>

difference

Calculates the absolute difference between two values.

ParameterTypeDefault Value
xNode | number
yNode | number

Returns

Node

dot

Calculates the dot product of two vectors.

ParameterTypeDefault Value
xNode<vec2|vec3|vec4>
yNode<vec2|vec3|vec4>

Returns

Node<float>

cross

Calculates the cross product of two vectors.

ParameterTypeDefault Value
xNode<vec2|vec3>
yNode<vec2|vec3>

Returns

Node<float|vec3>

pow

Return the value of the first parameter raised to the power of the second one.

ParameterTypeDefault Value
xNode | number
yNode | number

Returns

Node

pow2

Returns the square of the parameter.

ParameterTypeDefault Value
xnumber | Node

Returns

Node

pow3

Returns the cube of the parameter.

ParameterTypeDefault Value
xnumber | Node

Returns

Node

pow4

Returns the fourth power of the parameter.

ParameterTypeDefault Value
xnumber | Node

Returns

Node

transformDirection

Transforms the direction of a vector by a matrix and then normalizes the result.

ParameterTypeDefault Value
directionNode<vec2|vec3|vec4>
matrixNode<mat2|mat3|mat4>

Returns

Node

cbrt

Returns the cube root of a number.

ParameterTypeDefault Value
anumber | Node

Returns

Node

lengthSq

Calculate the squared length of a vector.

ParameterTypeDefault Value
aNode<vec2|vec3|vec4>

Returns

Node<float>

mix

Linearly interpolates between two values.

ParameterTypeDefault Value
aNode | number
bNode | number
tNode | number

Returns

Node

clamp

Constrains a value to lie between two further values.

ParameterTypeDefault Value
valuenumber | Node
low?number | Node0
high?number | Node1

Returns

Node

saturate

Constrains a value between 0 and 1.

ParameterTypeDefault Value
valuenumber | Node

Returns

Node

refract

Calculates the refraction direction for an incident vector.

ParameterTypeDefault Value
INode<vec2|vec3|vec4>
NNode<vec2|vec3|vec4>
etaNode<float>

Returns

Node<vec2|vec3|vec4>

smoothstep

Performs a Hermite interpolation between two values.

ParameterTypeDefault Value
lowNode | number
highNode | number
xNode | number

Returns

Node

faceForward

Returns a vector pointing in the same direction as another.

ParameterTypeDefault Value
NNode<vec2|vec3|vec4>
INode<vec2|vec3|vec4>
NrefNode<vec2|vec3|vec4>

Returns

Node<vec2|vec3|vec4>

rand

Returns a random value for the given uv.

ParameterTypeDefault Value
uvNode<vec2>

Returns

Node<float>

mixElement

Alias for mix() with a different parameter order.

ParameterTypeDefault Value
tnumber | Node
e1number | Node
e2number | Node

Returns

Node

smoothstepElement

Alias for smoothstep() with a different parameter order.

ParameterTypeDefault Value
xnumber | Node
lownumber | Node
highnumber | Node

Returns

Node

stepElement

Alias for step() with a different parameter order.

ParameterTypeDefault Value
xnumber | Node
edgenumber | Node

Returns

Node

faceforward

Type

any

inversesqrt

Type

any

add

Returns the addition of two or more value.

ParameterTypeDefault Value
aNode
bNode
params...Node

Returns

OperatorNode

sub

Returns the subtraction of two or more value.

ParameterTypeDefault Value
aNode
bNode
params...Node

Returns

OperatorNode

mul

Returns the multiplication of two or more value.

ParameterTypeDefault Value
aNode
bNode
params...Node

Returns

OperatorNode

div

Returns the division of two or more value.

ParameterTypeDefault Value
aNode
bNode
params...Node

Returns

OperatorNode

mod

Computes the remainder of dividing the first node by the second one.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

equal

Checks if two nodes are equal.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

notEqual

Checks if two nodes are not equal.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

lessThan

Checks if the first node is less than the second.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

greaterThan

Checks if the first node is greater than the second.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

lessThanEqual

Checks if the first node is less than or equal to the second.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

greaterThanEqual

Checks if the first node is greater than or equal to the second.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

and

Performs a logical AND operation on multiple nodes.

ParameterTypeDefault Value
nodes...Node

Returns

OperatorNode

or

Performs a logical OR operation on multiple nodes.

ParameterTypeDefault Value
nodes...Node

Returns

OperatorNode

not

Performs logical NOT on a node.

ParameterTypeDefault Value
valueNode

Returns

OperatorNode

xor

Performs logical XOR on two nodes.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

bitAnd

Performs bitwise AND on two nodes.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

bitNot

Performs bitwise NOT on a node.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

bitOr

Performs bitwise OR on two nodes.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

bitXor

Performs bitwise XOR on two nodes.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

shiftLeft

Shifts a node to the left.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

shiftRight

Shifts a node to the right.

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

incrementBefore

Increments a node by 1.

ParameterTypeDefault Value
aNode

Returns

OperatorNode

decrementBefore

Decrements a node by 1.

ParameterTypeDefault Value
aNode

Returns

OperatorNode

increment

Increments a node by 1 and returns the previous value.

ParameterTypeDefault Value
aNode

Returns

OperatorNode

decrement

Decrements a node by 1 and returns the previous value.

ParameterTypeDefault Value
aNode

Returns

OperatorNode

modInt

ParameterTypeDefault Value
aNode
bNode

Returns

OperatorNode

addNodeElement

ParameterTypeDefault Value
nameany

Returns

void

addMethodChaining

ParameterTypeDefault Value
nameany
nodeElementany

Returns

void

defined

ParameterTypeDefault Value
valueany

Returns

boolean

getConstNodeType

ParameterTypeDefault Value
valueany

Returns

any

ShaderNode

ParameterTypeDefault Value
jsFuncany
nodeTypeany

Returns

ShaderNodeInternal

nodeObject

ParameterTypeDefault Value
valany
altType?nullnull

Returns

any

nodeObjectIntent

ParameterTypeDefault Value
valany
altType?nullnull

Returns

any

nodeObjects

ParameterTypeDefault Value
valany
altType?nullnull

Returns

any

nodeArray

ParameterTypeDefault Value
valany
altType?nullnull

Returns

any

nodeProxy

ParameterTypeDefault Value
NodeClassany
scope?nullnull
factor?nullnull
settings?nullnull

Returns

any

nodeImmutable

ParameterTypeDefault Value
NodeClassany
params...Array<any>

Returns

any

nodeProxyIntent

ParameterTypeDefault Value
NodeClassany
scope?nullnull
factor?nullnull
settings?{}{}

Returns

any

Fn

ParameterTypeDefault Value
jsFuncany
layout?nullnull

Returns

() => void

setCurrentStack

ParameterTypeDefault Value
stackany

Returns

void

getCurrentStack

Returns

any

If

Represent a conditional node using if/else statements.

If( condition, function )
	.ElseIf( condition, function )
	.Else( function )
export {}
ParameterTypeDefault Value
params...any

Returns

StackNode

Switch

Represent a conditional node using switch/case statements.

Switch( value )
	.Case( 1, function )
	.Case( 2, 3, 4, function )
	.Default( function )
export {}
ParameterTypeDefault Value
params...any

Returns

StackNode

Stack

Add the given node to the current stack.

Properties

Node

Returns

Node

color

Type

any

float

Type

any

int

Type

any

uint

Type

any

bool

Type

any

vec2

Type

any

ivec2

Type

any

uvec2

Type

any

bvec2

Type

any

vec3

Type

any

ivec3

Type

any

uvec3

Type

any

bvec3

Type

any

vec4

Type

any

ivec4

Type

any

uvec4

Type

any

bvec4

Type

any

mat2

Type

any

mat3

Type

any

mat4

Type

any

string

ParameterTypeDefault Value
value?string

Returns

ConstNode

arrayBuffer

ParameterTypeDefault Value
valueany

Returns

ConstNode

element

Type

any

convert

ParameterTypeDefault Value
nodeany
typesany

Returns

ConvertNode

split

ParameterTypeDefault Value
nodeany
channelsany

Returns

SplitNode

append

ParameterTypeDefault Value
nodeNode

Returns

Function

debug

TSL function for creating a debug node.

ParameterTypeDefault Value
nodeNode
callback?null | Functionnull

Returns

DebugNode

Discard

Represents a discard shader operation in TSL.

ParameterTypeDefault Value
conditionalany

Returns

Node

Return

Represents a return shader operation in TSL.

Returns

ExpressionNode

remap

This 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.

ParameterTypeDefault Value
nodeNode
inLowNodeNode
inHighNodeNode
outLowNode?Node
outHighNode?Node

Returns

Node

remapClamp

This 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.

ParameterTypeDefault Value
nodeNode
inLowNodeNode
inHighNodeNode
outLowNode?null | Nodefloat( 0 )
outHighNode?null | Nodefloat( 1 )

Returns

Node