Renderer · interface
GeometrySink
Where a scene's vertices and indices go, since it keeps no copy of them.
Explained in Hello world.
interface GeometrySinkimport type { GeometrySink } from '@driftengine/core';In depth
Handed a scratch array, and a sink must copy it before returning. rows and values may be
longer than count records: the scene interleaves every mesh into the same two arrays and
reuses them on the next add, which is what keeps add from allocating in a frame loop.
queue.writeBuffer copies when it is called, so GpuDrivenPass hands them straight on.
Methods
writeVertices
writeVertices(firstVertex: number, rows: Float32Array, count: number): voidcount vertices of twelve floats each, from the start of rows, placed at firstVertex.
| Parameter | Type | Description |
|---|---|---|
firstVertex | number | |
rows | Float32Array | |
count | number |
writeIndices
writeIndices(firstIndex: number, values: Uint32Array, count: number): voidcount indices from the start of values, already rebased onto the scene, at firstIndex.
| Parameter | Type | Description |
|---|---|---|
firstIndex | number | |
values | Uint32Array | |
count | number |