Similar to BufferNode this module represents array-like data as
uniform buffers. Unlike BufferNode, it can handle more common
data types in the array (e.g three.js primitives) and automatically
manage buffer padding. It should be the first choice when working with
uniforms buffers.
const tintColors = uniformArray( [
new Color( 1, 0, 0 ),
new Color( 0, 1, 0 ),
new Color( 0, 0, 1 )
], 'color' );
const redColor = tintColors.element( 0 );
export {}Constructor
new UniformArrayNode(value, elementType?)| Parameter | Type | Default Value |
|---|---|---|
| value | Array<any> | — |
| elementType? | null | string | null |
Constructs a new uniform array node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| array | Array<any> | — | |
| elementType | string | — | |
| paddedType | string | — | |
| isArrayBufferNode | boolean | — | |
| Method | Type | |
|---|---|---|
| generateNodeType | () => string | |
| getElementType | () => string | |
| getPaddedType | () => string | |
| update | () => void | |
| setup | (builder: NodeBuilder) => null | |
| element | (indexNode: IndexNode) => UniformArrayElementNode | |
Extends
BufferNodeTSL function for creating an uniform array node.
| Parameter | Type | Default Value |
|---|---|---|
| values | Array<any> | — |
| nodeType? | null | string | — |
Returns
UniformArrayNode