Optionalshape?: SpriteShapeOptionalrenderTarget?: "gbuffer" | "hdr"Optionalemit?: numberOptionalstretch?: numberVelocity-aligned billboard stretch factor: streak length grows by
1 + stretch * speed. Default 0.04 (subtle). Use ~0.3–1.0 for sparks.
Optionalthickness?: numberCross-axis width multiplier for velocity-aligned billboards. Lets
spark/ember configs tune line thickness independently of
initialSize (which also drives streak length via stretch).
Default 1.0 (no change). Use ~0.4 for fine wire-thin sparks,
~2.0 for chunky bolts.
Optionalsize?: numberUniform quad-scale multiplier for camera-aligned billboards
(pixel/soft/fire/smoke). Multiplies both quad axes so the
renderer can tune apparent size without touching initialSize.
Default 1.0 (no change). Useful for chunkier pixel debris or
oversize fire/smoke puffs without retuning the emitter.
OptionalsunDirection?: [number, number, number]Forward-mode sun direction (toward the sun, world-space, unit vector)
used by the 'smoke' shape for fake side-lighting. Defaults to
[0, 1, 0] (top-lit).
OptionalsunColor?: [number, number, number]Forward-mode sun color used by the 'smoke' shape's fake lighting.
Defaults to white [1, 1, 1].
Ribbon trail. Each live particle records a short history of its own past positions and is drawn as a variable-width line (a camera-facing ribbon) threaded through those points — comet tails, tracers, energy beams.
History is a per-particle ring buffer of at most segments committed
points plus the live head position. A new point is committed whenever
either timeInterval seconds have elapsed (a frame-rate-independent
global tick) or the particle has moved minDistance world units since
the last committed point — so the trail length is bounded by both time and
distance. The oldest point is dropped once segments is reached.
Renders forward into the HDR target with additive blend (glows / blooms).
Width tapers from width at the head to zero at the tail, and alpha fades
to zero along the same axis so the trail dissolves as it thins.
Maximum committed history points retained per particle (ring size).
Trail vertex cost is 2 * (segments + 1) per particle. Typical 16–48.
Ribbon width in world units at the head (the live particle position). Tapers linearly to zero at the tail.
OptionaltimeInterval?: numberCommit a new point at least every timeInterval seconds (frame-rate
independent). Default 0.03. Set large to rely purely on minDistance.
OptionalminDistance?: numberAlso commit a new point once the particle has moved this many world
units since the last committed point. Default 0.1. Set large (or 0 to
disable the distance test) to rely purely on timeInterval.
Optionalemit?: numberHDR emission multiplier applied in the fragment shader. Default 4.0; crank to ~12–24 for hot tracers that punch through bloom.
GPU "fountain of text": SDF glyphs typeset along each particle's trail,
computed and rendered entirely on the GPU. Reuses the same per-particle
position-history ring buffer as the ribbon trail mode (segments /
timeInterval / minDistance behave identically), but instead of a ribbon
each live particle is labeled with a word whose glyphs are distributed by
arc length along the trail, billboarded to face the camera with their
baseline on the local trail tangent.
Each particle is assigned a word by slotIndex % numWords. The atlas + the
glyphTable/wordTable/maxGlyphs/numWords/emPx fields come from
createSdfFontAtlas() + buildGlyphTrailTables() in src/text. Renders
forward into the HDR target with additive blend (glows / blooms).
Max committed history points per particle (trail ring size). 16–48 typical.
Glyph cap height in world units (scale = worldHeight / emPx).
OptionaltimeInterval?: numberCommit cadence in seconds (frame-rate independent). Default 0.03.
OptionalminDistance?: numberAlso commit once the particle has moved this many world units. Default 0.1.
Optionalemit?: numberHDR emission multiplier applied in the fragment shader. Default 4.0.
SDF font atlas texture from createSdfFontAtlas().
Per-glyph atlas metrics, from buildGlyphTrailTables().
Per-word glyph runs, from buildGlyphTrailTables().
Max glyph count across all words (drives per-particle vertex count).
Number of words (particles pick one by slot % numWords).
Em height in atlas px (ascent + descent), for the px → world scale.
HDR emission multiplier applied in the fragment shader (forward mode). Default 4.0 for legacy parity. Crank to ~12–24 for hot sparks/fire so they punch through bloom; drop to 1.0 for ordinary alpha sprites.