This node implements the vertex shader logic which is required when rendering 3D objects via instancing. The code makes sure vertex positions, normals and colors can be modified via instanced data.
Constructor
new InstanceNode(count, instanceMatrix, instanceColor?)| Parameter | Type | Default Value |
|---|---|---|
| count | number | — |
| instanceMatrix | any | — |
| instanceColor? | any | null |
Constructs a new instance node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
| get isStorageMatrix | boolean | |
| get isStorageColor | boolean | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| count | number | — | |
| instanceMatrix | InstancedBufferAttribute | — | |
| instanceColor | InstancedBufferAttribute | — | |
| instanceMatrixNode | null | Node | — | |
| instanceColorNode | null | Node | — | |
| buffer | null | InstancedInterleavedBuffer | — | |
| bufferColor | null | InstancedBufferAttribute | — | |
| previousInstanceMatrixNode | null | Node | — | |
| Method | Type | |
|---|---|---|
| setup | (builder: NodeBuilder) => void | |
| update | (frame: NodeFrame) => void | |
| getPreviousInstancedPosition | (builder: NodeBuilder) => any | |
| _createInstanceMatrixNode | (assignBuffer: boolean, builder: NodeBuilder) => Node | |
Extends
NodeTSL function for creating an instance node.
| Parameter | Type | Default Value |
|---|---|---|
| count | number | — |
| instanceMatrix | any | — |
| instanceColor | any | — |
Returns
InstanceNode