Renderer · interface

BoltSegments

The arcs a batch draws, as plain arrays with a live count.

Explained in Hello world.

interface BoltSegments
import type { BoltSegments } from '@driftengine/core';

In depth

Fillable from outside, and that is the answer to wanting bolts without a pool. BoltPool advances rather than evaluates, so it cannot serve a consumer that renders one plan twice, once against a wall clock and once against a frame index, and expects the same pixels. Nothing here requires the pool: write from, to, along, fade, seed and brightness from any function of a seed and an absolute time, set count, and hand it to the batch. That is exactly the route a consumer already took with ParticleInstances, and it works for the same reason: the material is the valuable half and it is separable from whatever decides where things are.

Reported from outside, where the pool's own note that a stateless variant is not built read as "there is no way to do this" rather than "there is no second pool". There is no second pool and none is needed.

Properties

NameTypeDescription
fromFloat32Arrayfrom and to per segment, three floats each, live segments first.
toFloat32Array
alongFloat32ArrayPer segment: normalised distance along its arc, and the arc's own fade.
fadeFloat32Array
seedFloat32ArrayPer segment: the arc's seed, and how bright the caller asked for it.
brightnessFloat32Array
countnumberHow many segments of the above are live.
capacitynumber