Skip to main content

Module gpu_particle_system

Module gpu_particle_system 

Source
Expand description

GPU-accelerated particle system (CPU mock implementation).

Provides a particle emitter, Euler integrator, and depth-sort for alpha-blended rendering. All operations are implemented on the CPU as a reference / fallback backend.

Structs§

EmitterConfig
Configuration for a point-emitter.
GpuParticle
A single particle in the GPU particle system.
GpuParticleSystem
GPU particle system managing emission and integration of many particles.

Functions§

gpu_emit_particles
Spawn n particles from the emitter into the system.
gpu_integrate_particles
Advance all particles by dt seconds using symplectic Euler integration.
gpu_kill_dead_particles
Remove particles whose lifetime <= 0, compacting the particle list.
gpu_sort_by_depth
Sort active particles by depth along camera_dir (back-to-front) for correct alpha blending.
spawn_burst
Emit all n particles at once (burst emission).