IT lexicon › Programming › Fire effect

Fire effect

Programming På svenska → Updated: 2026-08-14

The flame that creeps up the screen — a cellular automaton in a couple of lines of code and a well-chosen fire palette.

A fire effect is seeded along the bottom row with random hot values. Every pixel above is computed as an average of its neighbours below minus a small cooling constant, so heat spreads upward and dies out. The result is mapped through a palette running from black through red and orange to yellow and white, and you get a living, rising flame almost for free.

The trick is purely two-dimensional and per-pixel, but it looked like magic in the early 1990s and turned up in countless intros and cracktros. The same idea — a tiny neighbourhood filter run over and over — is cousin to plasma and metaballs, and one variant lives on as the notorious "Doom fire".

← Back to the lexicon