ContextNode

Last modified: Jun 30, 2024

This node can be used as a context management component for another node. NodeBuilder performs its node building process in a specific context and this node allows the modify the context. A typical use case is to overwrite getUV() e.g.:

node.context( { getUV: () => customCoord } );
\// or
material.contextNode = context( { getUV: () => customCoord } );
\// or
renderer.contextNode = context( { getUV: () => customCoord } );
\// or
scenePass.contextNode = context( { getUV: () => customCoord } );
export {}

Constructor

new ContextNode(node?, value?)
ParameterTypeDefault Value
node?Nodenull
value?Object{}

Constructs a new context node.

AccessorType

Properties

PropertyTypeDefault Value
isContextNodeboolean—
nodeNode—
valueObject—
MethodType

Extends

Node

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
N E W

builtinGIContext

TSL function for defining a built-in global illumination context for a given node. The AO node modulates the indirect lighting of the materials, the GI node is added to their irradiance without being modulated by the AO since it already accounts for occlusion.

ParameterTypeDefault Value
aoNodeNode<float>—
giNodeNode<vec3>—
node?Nodenull

Returns

ContextNode

label

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

ParameterTypeDefault Value
nodeNode—
namestring—

Returns

ContextNode