A special type of uniform node which represents array-like data
as uniform buffers. The access usually happens via element()
which returns an instance of ArrayElementNode. For example:
const bufferNode = buffer( array, 'mat4', count );
const matrixNode = bufferNode.element( index ); // access a matrix from the buffer
export {}In general, it is recommended to use the more managed UniformArrayNode since it handles more input types and automatically cares about buffer paddings.
Constructor
new BufferNode(value, bufferType, bufferCount?)| Parameter | Type | Default Value |
|---|---|---|
| value | Array<number> | — |
| bufferType | string | — |
| bufferCount? | number | 0 |
Constructs a new buffer node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| isBufferNode | boolean | — | |
| bufferType | string | — | |
| bufferCount | number | — | |
| updateRanges | Array<{ start: number; count: number; }> | — | |
| Method | Type | |
|---|---|---|
| addUpdateRange | (start: number, count: number) => void | |
| clearUpdateRanges | () => void | |
| getElementType | (builder: NodeBuilder) => string | |
| getInputType | () => string | |
Extends
UniformNodeTSL function for creating a buffer node.
| Parameter | Type | Default Value |
|---|---|---|
| value | Array<number> | — |
| type | string | — |
| count | number | — |
Returns
BufferNode