File: ReferenceNode.md | Updated: 11/15/2025
This type of node establishes a reference to a property of another object. In this way, the value of the node is automatically linked to the value of referenced object. Reference nodes internally represent the linked value as a uniform.
Constructs a new reference node.
property | The name of the property the node refers to.
---|---
uniformType | The uniform type that should be used to represent the property value.
object | The object the property belongs to. Default is null.
count | When the linked property is an array-like, this parameter defines its length. Default is null.
When the linked property is an array, this parameter defines its length.
Default is null.
The uniform group of the internal uniform.
Default is null.
An optional label of the internal uniform node.
Default is null.
Overrides: Node#name
The uniform node that holds the value of the reference node.
Default is null.
The object the property belongs to.
Default is null.
The property name might have dots so nested properties can be referred. The hierarchy of the names is stored inside this array.
The name of the property the node refers to.
Points to the current referred object. This property exists next to ReferenceNode#object since the final reference might be updated from calling code.
Default is null.
The uniform type that should be used to represent the property value.
Overwritten since reference nodes are updated per object.
Default is 'object'.
Overrides: Node#updateType
When the referred property is array-like, this method can be used to access elements via an index node.
indexNode | indexNode.
---|---
Returns: A reference to an element.
This method is overwritten since the node type is inferred from the type of the reference node.
builder | The current node builder.
---|---
Overrides: Node#getNodeType
Returns: The node type.
Returns the property value from the given referred object.
object | The object to retrieve the property value from. Default is this.reference.
---|---
Returns: The value.
Sets the label for the internal uniform.
name | The label to set.
---|---
Deprecated: Yes
Returns: A reference to this node.
Sets the uniform group for this reference node.
group | The uniform group to set.
---|---
Returns: A reference to this node.
Sets the name for the internal uniform.
name | The label to set.
---|---
Returns: A reference to this node.
Sets the node type which automatically defines the internal uniform type.
uniformType | The type to set.
---|---
The output of the reference node is the internal uniform node.
builder | The current node builder.
---|---
Overrides: Node#setup
Returns: The output node.
Overwritten to update the internal uniform value.
frame | A reference to the current node frame.
---|---
Overrides: Node#update
Allows to update the reference based on the given state. The state is only evaluated ReferenceNode#object is not set.
state | The current state.
---|---
Overrides: Node#updateReference
Returns: The updated reference.
Retrieves the value from the referred object property and uses it to updated the internal uniform.