Particle Effects: Fire, Smoke, and Sparks in Real-Time

simulator intermediate ~10 min
Loading simulation...
Fire effect — 100 particles/sec with 1.5s lifetime = ~150 active particles

A fire particle system emitting 100 particles per second with 1.5-second lifetime. Particles spawn at the base, rise with turbulence, and fade from bright yellow through orange to transparent smoke — the classic campfire effect.

Formula

Steady-state count = emit_rate × average_lifetime
Position update: p(t+dt) = p(t) + v(t)×dt + 0.5×a×dt²

The Building Blocks of Visual Effects

In 1983, William Reeves at Lucasfilm invented particle systems to create the Genesis effect in Star Trek II: The Wrath of Khan — a wall of fire sweeping across a planet. The technique was revolutionary: instead of modeling complex shapes, spawn thousands of simple points and let statistical variation create organic-looking fire, smoke, water, and explosions. Four decades later, particle systems remain the foundation of real-time visual effects.

Anatomy of a Particle

Each particle is surprisingly simple: a position, velocity, color, size, opacity, and remaining lifetime. The emitter spawns particles with randomized initial values within configured ranges. Each frame, physics (gravity, wind, drag) updates the velocity, velocity updates the position, and age-based curves modify color and opacity. When lifetime reaches zero, the particle dies and its slot is recycled.

Fire, Smoke, and Sparks

Different effects emerge from different parameter combinations. Fire uses fast upward velocity, short lifetime, warm-to-black color ramp, and growing size. Smoke uses slow velocity, long lifetime, gray tones, and large final size. Sparks use high initial speed, gravity, point rendering, and bright white-to-orange colors. This simulation lets you switch between presets and tweak parameters to see how each effect is built from the same underlying system.

From Points to Production

Modern particle systems go far beyond simple points. Mesh particles emit geometry instead of quads. Ribbon particles connect consecutive positions for trails. Vector fields guide particles along artist-authored flow patterns. Collision modules let particles bounce off scenery. The humble particle — born as a single pixel in a 1983 film — has evolved into one of the most versatile tools in the graphics programmer's arsenal.

FAQ

How do particle systems work in games?

A particle emitter spawns lightweight objects (particles) with randomized position, velocity, color, and lifetime. Each frame, particles are updated (gravity, wind, drag), aged, and rendered as textured quads or points. Dead particles are recycled for new emissions.

How is fire simulated with particles?

Fire particles spawn at a source, move upward with turbulence, and transition color from bright yellow/white (hot core) through orange and red to black/transparent (smoke). Size increases and opacity decreases over the particle's short lifetime.

What is the difference between CPU and GPU particles?

CPU particles are updated on the processor and are flexible but limited to thousands. GPU particles use compute shaders to update millions of particles in parallel, enabling dense effects like volumetric smoke, rain, and debris fields.

How do particle systems handle performance?

Fixed-size particle pools prevent allocation overhead. LOD systems reduce emission rates at distance. Billboard rendering faces quads toward the camera. Soft particles blend with scene depth to avoid hard edges against geometry.

Sources

Embed

<iframe src="https://homo-deus.com/lab/animation-physics/particle-effects/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub