Expand description
GPU-style particle system simulated on the CPU.
Provides a complete particle simulation pipeline including emission, integration, forces (gravity, turbulence), collision response, pooling, and render-data collection for billboard quads.
Structs§
- Billboard
Vertex - Render-ready vertex data for a single billboard quad corner.
- Color
Over Life - Lerps a particle’s color from
birth_colortodeath_colorover its life. - GpuParticle
- A single GPU-style particle with position, velocity, life, color and size.
- Gravity
Force - Constant downward gravitational acceleration applied to particles.
- Lcg
- Simple linear congruential random number generator for particle systems.
- Particle
Collider - Particle-plane collision with restitution coefficient.
- Particle
Emitter - Emits particles from a point with configurable velocity distribution and lifetime.
- Particle
Integrator - Explicit Euler integrator for particles:
pos += vel * dt,life -= dt. - Particle
Pool - Fixed-capacity particle pool with a free list for O(1) emit/recycle.
- Particle
Renderer - Collects alive particles, depth-sorts them back-to-front, and generates billboard quad geometry aligned to the view plane.
- Render
Batch - Output of the particle renderer: sorted vertices and indices.
- Size
Over Life - Modulates a particle’s size along its lifetime via a simple quadratic curve.
- Turbulence
Force - Pseudo-random turbulence force using a curl-noise-like field.
Functions§
- tick
- Convenience function: run one full simulation tick on a pool.