N E W
A specialized context node designed to override specific target nodes within a node sub-graph or flow. This allows replacing specific inputs (e.g., normal and position vectors) dynamically during compilation for a specific flow node, without having to reconstruct or duplicate the source nodes.
// Method chaining example:
node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
// Context assignment example:
material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
export {}Constructor
new OverrideContextNode(overrideNodes, flowNode?)| Parameter | Type | Default Value |
|---|---|---|
| overrideNodes | Map<Node, Function> | — |
| flowNode? | null | Node | null |
Constructs a new override context node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| isOverrideContextNode | boolean | — | |
| Method | Type | |
|---|---|---|
| getFlowContextData | () => Object | |
Extends
ContextNodeN E W
TSL function for creating an OverrideContextNode to override a single target node.
material.contextNode = overrideNode( positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) );
export {}| Parameter | Type | Default Value |
|---|---|---|
| targetNode | Node | — |
| callback? | null | Function | Node | null |
| flowNode? | null | Node | null |
Returns
OverrideContextNodeN E W
TSL function for creating an OverrideContextNode to override multiple target nodes.
material.contextNode = overrideNodes( [
[ positionView, customPositionView ],
[ positionViewDirection, ( builder ) => customPositionViewDirection ]
] );
export {}| Parameter | Type | Default Value |
|---|---|---|
| overrides | Map<Node, Function | Node> | Array<Array<Function | Node>> | — |
| flowNode? | null | Node | null |
Returns
OverrideContextNode