Expand description
GPU particle system — compute shader driven, double-buffered, indirect draw.
Moves particle simulation entirely to the GPU for massive particle counts (50,000–131,072) at 60fps with zero CPU readback.
Architecture:
Frame N:
1. Dispatch compute_update: SSBO_A → SSBO_B (simulate)
2. Dispatch compute_emit: append new particles to SSBO_B
3. Dispatch compute_compact: count alive particles → indirect draw buffer
4. Draw: glDrawArraysIndirect reading from SSBO_B (render)
5. Swap: A ↔ BThe CPU never reads particle data. Force fields, engine types, and corruption are passed as uniforms.
Structs§
- Chaos
Field Presets - Pre-configured chaos field setups for different game contexts.
- Engine
Distribution - Distribution of particles across mathematical engine types for the chaos field.
- GpuEmitter
Config - Configuration for emitting new particles on the GPU.
- GpuForce
Field - A force field descriptor passed to the compute shader as a uniform.
- GpuIndirect
Draw Params - Indirect draw arguments (matches GL_DRAW_INDIRECT_BUFFER layout).
- GpuParticle
- Per-particle data stored in GPU SSBO. Must be 64 bytes, aligned for std430.
- GpuParticle
Dispatch Params - Parameters passed to the compute shader update dispatch.
- GpuParticle
System - The main GPU particle system.
- Temporal
Field Manager - Manager for temporal force fields.
- Temporal
Force Field - A force field with a limited lifetime that fades out.
Constants§
- MAX_
GPU_ FORCE_ FIELDS - Maximum number of simultaneous force fields in the compute shader.