Skip to main content

Module gpu_particles

Module gpu_particles 

Source
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§

BillboardVertex
Render-ready vertex data for a single billboard quad corner.
ColorOverLife
Lerps a particle’s color from birth_color to death_color over its life.
GpuParticle
A single GPU-style particle with position, velocity, life, color and size.
GravityForce
Constant downward gravitational acceleration applied to particles.
Lcg
Simple linear congruential random number generator for particle systems.
ParticleCollider
Particle-plane collision with restitution coefficient.
ParticleEmitter
Emits particles from a point with configurable velocity distribution and lifetime.
ParticleIntegrator
Explicit Euler integrator for particles: pos += vel * dt, life -= dt.
ParticlePool
Fixed-capacity particle pool with a free list for O(1) emit/recycle.
ParticleRenderer
Collects alive particles, depth-sorts them back-to-front, and generates billboard quad geometry aligned to the view plane.
RenderBatch
Output of the particle renderer: sorted vertices and indices.
SizeOverLife
Modulates a particle’s size along its lifetime via a simple quadratic curve.
TurbulenceForce
Pseudo-random turbulence force using a curl-noise-like field.

Functions§

tick
Convenience function: run one full simulation tick on a pool.