N E W
This node binds a buffer attribute that is a property of the rendered object, like the matrices of an instanced mesh. Unlike BufferAttributeNode, the attribute isn’t part of the program: each object binds its own attribute, so objects can share a program.
const matrix = referenceAttribute( 'instanceMatrix', 'mat4' );
const color = referenceAttribute( 'instanceColor' );
export {}Matrices are bound as columns. Storage buffer attributes are bound as storage buffers.
Constructor
new ReferenceAttributeNode(property, nodeType?, object?)| Parameter | Type | Default Value |
|---|---|---|
| property | string | — |
| nodeType? | null | string | null |
| object? | null | Object | null |
Constructs a new reference attribute node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| property | string | — | |
| properties | Array<string> | — | |
| object | null | Object | — | |
| Method | Type | |
|---|---|---|
| getValueFromReference | (object: Object) => any | |
| getAttribute | (object: Object3D) => any | |
| generateNodeType | (builder: NodeBuilder) => string | |
| setup | (builder: NodeBuilder) => Node | |
Extends
NodeN E W
TSL function for creating a reference attribute node.
| Parameter | Type | Default Value |
|---|---|---|
| name | string | — |
| type? | null | string | null |
| object? | null | Object | null |
Returns
ReferenceAttributeNode