API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classParticleRenderMode
Turns a particle system's SoA storage into drawable vertex data. A mode owns the whole "how": the vertex layout, the shader pair, the draw model, and the loop that fills the buffer. The backend renderers only upload what it produces and issue the draw it declares, so a new primitive is a new mode rather than a renderer change. Implementations are fixed at system construction (see `ParticleSystemOptions.render`) and default to `QuadParticles`. **Limits of the seam.** The executors are deliberately thin, so a new mode has to stay inside what they can express: - The geometry's `stride` must be a multiple of 4. WebGPU's `queue.writeBuffer` validates its copy size against that alignment and rejects anything else, so a mode with, say, a 38-byte stride draws on WebGL2 and fails validation on WebGPU. - An **indexed, non-instanced** mode always draws the geometry's fixed `indexCount` and ignores count on both backends. That is right for a fixed-topology mode and wrong for one whose element count varies per frame; such a mode needs the executors taught to derive an index count from count first. No mode ships in that shape today. - An **instanced** mode that declares no vertexGeometry has to derive its vertices in the shader from the vertex index, and its dataLayout must carry the indices that address them. Without either there is nothing to tell the executors how many vertices one instance spans.
import { ParticleRenderMode } from '@codexo/exojs-particles'Turns a particle system's SoA storage into drawable vertex data.
A mode owns the whole "how": the vertex layout, the shader pair, the draw model, and the loop that fills the buffer. The backend renderers only upload what it produces and issue the draw it declares, so a new primitive is a new mode rather than a renderer change.
Implementations are fixed at system construction (see `ParticleSystemOptions.render`) and default to `QuadParticles`.
**Limits of the seam.** The executors are deliberately thin, so a new mode has to stay inside what they can express:
- The geometry's `stride` must be a multiple of 4. WebGPU's `queue.writeBuffer` validates its copy size against that alignment and rejects anything else, so a mode with, say, a 38-byte stride draws on WebGL2 and fails validation on WebGPU. - An **indexed, non-instanced** mode always draws the geometry's fixed `indexCount` and ignores count on both backends. That is right for a fixed-topology mode and wrong for one whose element count varies per frame; such a mode needs the executors taught to derive an index count from count first. No mode ships in that shape today. - An **instanced** mode that declares no vertexGeometry has to derive its vertices in the shader from the vertex index, and its dataLayout must carry the indices that address them. Without either there is nothing to tell the executors how many vertices one instance spans.
new(): ParticleRenderMode_ensureCapacity(byteLength: number): void_onBufferGrown(_data: ArrayBuffer): void_setCount(count: number): voidbuild(system: ParticleSystemThe central coordinator of the particle pipeline. `ParticleSystem` is a Drawable that owns: - **Particle storage** - one channel per attribute (position, veloc…, particles: ParticleBatchThe live particles of one system, addressed by semantic channel. This is the bulk surface an UpdateModule and a ParticleRenderMode operate on. Channels are nam…): voiddestroy(): voidgpuEligible: booleaninstanced: booleancount: numberdata: ArrayBuffer