Renderer · interface

GeometrySink

Where a scene's vertices and indices go, since it keeps no copy of them.

Explained in Hello world.

interface GeometrySink
import 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): void

count vertices of twelve floats each, from the start of rows, placed at firstVertex.

ParameterTypeDescription
firstVertexnumber
rowsFloat32Array
countnumber

writeIndices

writeIndices(firstIndex: number, values: Uint32Array, count: number): void

count indices from the start of values, already rebased onto the scene, at firstIndex.

ParameterTypeDescription
firstIndexnumber
valuesUint32Array
countnumber