SmoothLife: Conway's Game of Life on a Continuous Domain

webgpupdecellular-automata

SmoothLife: Conway's Game of Life on a Continuous Domain

Conway’s Game of Life lives on a grid of cells that are strictly on or off, updated in discrete ticks by counting integer neighbors. SmoothLife, introduced by Stephan Rafler in Generalization of Conway’s “Game of Life” to a continuous domain, asks what happens when you let all of that go continuous: the state becomes a real number in , the neighborhood becomes a smooth disc instead of eight discrete squares, and time advances in small increments rather than sudden ticks.

The result preserves some of the gliders, oscillators, and self-organizing structures which make the original game of life so interesting, but adds an organic feel to it. This page is a WebGPU rewrite of an old sketch of mine; the simulation below runs entirely in WebGPU.

Drag the birth and survival bands on the transition diagram to reshape the rule, and try the presets. The SmoothLifeL preset is Rafler’s glider ruleset from the 2011 paper — the one Tim Hutton rendered in the well-known SmoothLife video (outer radius 20, birth , survival , time stepping). It lives in a fairly narrow regime — if it fills in or dies out, nudge the initial density. The field wraps at the edges, so structures that drift off one side reappear on the other.

Implementation

Rafler’s original paper is the place to go for a brief and accessible description of the method, so I’ll only add a couple notes on my particular implementation.

Each update needs two disc averages, which are circular convolutions of the field with a filled disc (radius ) and a larger disc (radius ). The annulus average is a weighted difference of the two. The original sketch unrolled the convolution into WebGL by generating GLSL source with one texture tap per kernel pixel, which makes the cost grow as . This version borrows FFT machinery from the multi-scale Turing pattern notebook.

A convolution is a product in the frequency domain, and the Fourier transform of a normalized disc of radius is the analytical jinc function

where is a Bessel function of the first kind. Because this equals 1 at , multiplying the field’s spectrum by it computes a true average, with no kernel textures to store. The two discs are packed into a single complex convolution: multiplying the spectrum by and taking one inverse FFT recovers the -disc average in the real part and the -disc average in the imaginary part, since both convolutions are real. Each step is then one forward FFT, one spectral multiply, one inverse FFT, and a pointwise transition pass. The FFT itself is a Cooley–Tukey compute shader run as row-FFT, transpose, column-FFT, transpose.

References

See also

All notebooks →