A Sky in Eighty Columns

By Claude Fable 5, in the style of Gardner

In 1966 a firm called the Mathematical Applications Group, Inc. — MAGI — set up in Elmsford, New York, to calculate how nuclear radiation penetrates solid objects, which it did by tracing imaginary rays through geometry. In 1972 a group under Robert Goldstein pointed the same machinery the other way: if the rays were rays of light, the code would draw a picture. The resulting system, SynthaVision, made MAGI one of four companies hired to produce the computer imagery for Disney’s Tron (1982); for a fee of $1.2 million, MAGI modeled and animated the light cycles, the tanks, and the recognizers. About fifteen minutes of the finished film was computer-generated. When the Academy announced its visual-effects nominees the following spring, they were E.T., Blade Runner, and Poltergeist. Tron’s director, Steven Lisberger, explained the omission this way: “The Academy thought we cheated by using computers.” (Tron animator Bill Kroyer remembers it as less a formal disqualification than a plain failure to nominate. Either way, no statuette.)

Among the people who wrote software for Tron at MAGI was a young programmer named Ken Perlin, and what bothered him afterward was not the Academy but the pictures. Everything the computer drew looked machine-made: surfaces immaculate, edges exact. His remedy was a single small function, which he began building in 1983 and published at SIGGRAPH in 1985 in a paper titled “An Image Synthesizer.” The function, now called Perlin noise, takes any point in space and returns a value — the same value every time that point is asked about, which is the whole trick. It is randomness with a memory. The value drifts smoothly from place to place, hilly but never jagged, and by itself it looks like nothing much: a gray swell. The magic is in the layering. Add the function to a copy of itself at twice the frequency and half the strength, then again, and again, and the doubled-up wobble acquires the roughness of the physical world — big rolls carrying smaller curls carrying still smaller ones. Threshold it and you get islands in an ocean. Run it through a color band and you get marble. Ask it, at every point of a volume of air, “how much cloud is here?” and you get weather.

A cloud, on this view, is not a thing to be stored but a question to be asked. No artist places its billows; the formula answers for any point you name, at any resolution, forever.

To turn the answers into a picture you also need the light, and that problem was worked out in the same neighborhood of years. In 1984, James Kajiya and Brian Von Herzen at Caltech published “Ray Tracing Volume Densities,” which set out the scattering equations for rendering “clouds, fog, flames, dust, particle systems” — matter with no surface to bounce a ray off. And in the very same 1985 proceedings as Perlin’s paper, on pages 297–304, one Geoffrey Y. Gardner of the Grumman Corporate Research Center in Bethpage, New York — a flight-simulation concern, which needs skies the way a railroad needs track — presented “Visual Simulation of Clouds,” building his from ellipsoids shaded by a mathematical texturing function. (So far as I know, no relation to the Gardner of this column’s byline.) The rendering procedure that survives from this era, “ray marching,” is almost insultingly simple. From the eye, through each pixel, push a ray into the sky in small steps. At each step ask the noise how dense the cloud is there, and ask again along a short path toward the sun to learn how shadowed the spot is; accumulate color and opacity as you go; stop when the cloud has gone opaque or the ray has left the atmosphere. More steps, better sky. That is the entire method.

What followed is quickly told. Noise and the march went into feature films, then onto graphics cards, then into the skies of video games, and in 1997 the Academy — the same Academy — gave Ken Perlin a Technical Achievement Award for the function.

The machinery also got small. At Breakpoint, a demoscene gathering held each Easter in Bingen am Rhein, Germany, one competition category limits an entire program — visuals, camera, music, synthesizer — to 4,096 bytes. The 2009 winner, elevated, by the groups Rgba and TBC, ray-marches a sunlit mountain range under a hazy sky, the camera banking over ridges while its own music plays, all of it computed and none of it stored. Four kilobytes is less than the plain text of this column.

Which brings the story to a machine that was never meant to show pictures at all. The terminal — the classic 80-by-24 grid of characters, the screen that once glowed phosphor green — turns out to accept an escape sequence, ESC[38;2;R;G;Bm, that paints a single character in any of 16,777,216 colors. Eighty by twenty-four is 1,920 cells: a screen of fat pixels. A C program called clouds.c, orchestrated by Gabriel Korr, uses them to run the whole pipeline of 1984 and 1985 as a screensaver. It marches rays through a Perlin-noise density field — a --quality flag sets the march at anywhere from 10 to 512 steps — under presets named flat, below, thunder, sol, and nimbus; a flight mode puts the arrow keys on the camera, so you can bank through the cloud deck the way Grumman’s simulators once did; a WebAssembly build runs in a browser, so the reader can fly through it in the next minute without compiling anything. Korr says he built it in about two weeks, with an AI assistant writing most of the C.

The mode worth stopping in front of, though, is the humblest one. Deny the program its sixteen million colors and it falls back on a ramp of ten glyphs, ordered by how much ink they carry:

 .:;*oO#%@

The space is clear air. The period is a wisp; the colon and semicolon are the thin bright margins of the cloud; and the characters thicken through * and o and O to the @, which is the wet gray heart of the cumulus. Ten glyphs, and it still reads as weather — the towers billow, the deck slides on the wind, the sun side is airy and the shadowed base is dense. Nothing essential was lost in the reduction, because color was never what made a cloud a cloud. What the eye actually checks for is the roughness — big rolls carrying smaller curls, Perlin’s octaves — and the gradient of light that the march accumulates, and both of these survive being quantized to ten levels of punctuation. The physics of 1984, the noise of 1985, legible in typewriter characters.

MAGI itself folded in 1985, the year the noise paper appeared. The function has outlived it by four decades and counting, and the Academy’s 1997 citation reads, in full: “To Ken Perlin for the development of Perlin Noise, a technique used to produce natural appearing textures on computer generated surfaces for motion picture visual effects.” Let the Academy, which once found computers a form of cheating, have the last word.