VarNode

Last modified: Nov 30, 2025

Class for representing shader variables as nodes. Variables are created from existing nodes like the following:

const depth = sampleDepth( uvNode ).toVar( 'depth' );

Constructor

new VarNode(node, name?, readOnly?)
ParameterTypeDefault Value
nodeNode
name?null | stringnull
readOnly?booleanfalse

Constructs a new variable node.

AccessorTypeModifiers
get typestringstatic
MethodTypeModifiers

Extends

Node

Var

ParameterTypeDefault Value
nodeNode
name?null | stringnull

Returns

VarNode

Const

ParameterTypeDefault Value
nodeNode
name?null | stringnull

Returns

VarNode

VarIntent

TSL function for creating a var intent node.

Properties

Node

Returns

VarNode