Renderer · interface
ParticlePoolOptions
A pool of short-lived particles, simulated on the CPU and drawn as instances.
Explained in Hello world.
interface ParticlePoolOptionsimport type { ParticlePoolOptions } from '@driftengine/core';In depth
Deliberately not a new GPU path: InstancedMesh already uploads instance
data per frame and already knows how to draw thousands of copies of one mesh
in a single call, so a particle system is only the simulation. That keeps
the whole thing testable — none of what follows needs a GL context — and
keeps WebGL where the standing rule says it lives.
A ring buffer, not a free list. Emission is continuous and the oldest particle is always the right one to reuse, so the bookkeeping a free list exists for is bookkeeping nobody needs; and overrunning it degrades by dropping the oldest, which is invisible, rather than by refusing to emit, which is visible exactly when the effect matters most.
Properties
| Name | Type | Description |
|---|---|---|
capacity | number | |
lifeSec | number | Seconds a particle lives. |
sizeStart | number | Size at birth and at death: metres from the centre to an edge, so the quad is twice as wide. |
sizeEnd | number | |
colorStart | Vec3 | Colour at birth and at death. |
colorEnd | Vec3 | |
gravity | number | Downward acceleration. Smoke wants a little; grit wants a lot. |
drag | number | How fast motion decays, per second. |
rise | number | Constant upward push, for anything that behaves like smoke. |
alphaStartoptional | number | Opacity at birth and at death. Omitted means the old behaviour exactly — fully opaque, fading by colour — so no existing pool changes by a bit. |
alphaEndoptional | number |