The Arrow of Time: the history and future of everything in six minutes, made entirely in code (WebGL2 shaders and a Python-synthesized score).
TypeScript
0
74 commits
updated Sep 28, 2026
The history and future of everything, from the first instant to the last.
A six-minute film made entirely in code: every frame is rendered by shaders in a small WebGL2 engine, and every note of the score is synthesized in Python.

Watch the film (1080p, a 720p preview and a poster, on the Releases page)
Time has one direction. The film follows it from the Big Bang to the heat death of the universe, paced by a ticking clock: it falls silent in the Big Bang, accelerates through human history, stops dead at Now, then resumes and slows as the stars die, until its last tick.
| Time | Chapter | |
|---|---|---|
| 0:00 | Prologue | "Everything that has ever happened…", a single point of light gathering energy |
| 0:20 | The Universe | the Big Bang, inflation, the first elements, first light |
| 0:50 | Cosmic Dawn | the dark ages, the first stars, galaxies, the Milky Way |
| 1:20 | The Sun and Earth | a collapsing nebula, the young Sun, a molten Earth, the impact that makes the Moon, the first oceans |
| 2:00 | Life | the first cells, the Great Oxidation, Snowball Earth, the Cambrian seas, onto land, the dinosaurs, the asteroid |
| 2:46 | Humanity | mammals at dawn, the first people at dusk on the savanna, hand stencils in a cave |
| 3:06 | Civilization | twelve thousand years as one day: the first harvest, Uruk, cuneiform, Giza, Athens, Gutenberg's press, the railway, the Wright Flyer, Trinity |
| 3:31 | The Space Race | the R-7 lifting Sputnik through the clouds into an orbital sunrise; Apollo 11 on the Sea of Tranquility, and Armstrong's own voice; the Earth at night |
| 4:12 | Now | the pale blue dot, and silence |
| 4:20 | The Future | new worlds, drifting constellations, the oceans boil away, the red giant, the white dwarf, the Milky Way and Andromeda |
| 5:06 | The End | the last stars, the black hole era, evaporation, the end of time |
| 5:40 | Epilogue | "That moment is now." |
film/timeline.json holds the script, the
captions and every cue. The shots, the captions and the score all read it, so moving a beat moves
the picture, the text and the music together.The making-of goes scene by scene, and the score explains the music.
You need Node 20+, Python 3.10+ and ffmpeg (details per platform).
git clone https://github.com/abhishekpradhan/the-arrow-of-time.git
cd the-arrow-of-time
npm install
npm run setup # Python venv for the score, Playwright's Chromium, ffmpeg check
npm run dev # interactive preview at http://localhost:5173
npm run audio # synthesize the score -> out/audio/score.wav
npm run render # render the film -> out/renders/the-arrow-of-time-final-latest.mp4
With a GPU the final 1080p render takes about half an hour; on a CPU alone it takes several hours, which is what Modal is for.
| Command | What it does |
|---|---|
npm run dev | Preview player: scrub, play with sound, step frames (Space, ←/→, [/] between shots). ?s=1 renders at full resolution, ?mb=1 adds motion blur. |
npm run still -- --t 12.5 [--t 30 ...] [--grid] | Still frames as PNGs. --sheet --from 0 --to 80 --n 40 makes a contact sheet, --bench --scale 1 measures the cost of a frame, --textonly shows the captions over black. |
npm run render [-- --preset draft] | Render the film (resumable with --resume; --from/--to or --frames a:b render a range). |
npm run audio [-- --from s --to s] | Synthesize the score (a window renders in seconds). |
npm run release | Distribution encodes of the latest render: 1080p, a 720p preview, a poster and checksums. |
npm run typecheck | Type-check the engine, the film and the tools. |
film/ the film: timeline.json (script, captions, cues), project.ts, shots/, shaders/,
text.ts (captions), score.py (the score)
engine/ the WebGL2 film engine it runs on (TypeScript): renderer, camera, post, text,
components (planets, galaxies, an atmosphere) and a GLSL library
audio/ the Python synthesizer, mastering and analysis the score is written with
tools/ render, still, audio and release CLIs; the Modal pipeline; asset builders
assets/ data the film loads: Earth maps, the giant-impact simulation, NASA's Apollo 11 audio
docs/ the making-of, the score, and guides to working on, rendering and releasing the film
out/ renders, stills and audio (git-ignored)
timeline.json ──► project.ts ──► shots (GLSL, sprites, ray marching) ──► HDR composite ──► post ──► frame
│ └──────► captions (glyph cache, per-beat layout) ─────────────────────┘
└──────────────► score.py ──► audio/studio synth ──► mix ──► master ──► score.wav ──┐
▼
headless Chromium ──► raw RGBA ──► ffmpeg (x264) ──────────────► film.mp4
| Guide | What it covers |
|---|---|
| Getting started | Install, preview, render, troubleshooting |
| The making of | How each scene is made, and the science and history behind it |
| The score | The music's design and its cue sheet |
| Working on the film | The timeline, shots, captions, look and score, and the review loop |
| The engine | Shots, camera, sprites, planets, galaxies, the atmosphere, shader includes, post, text |
| Audio | The synthesizer, mixing, mastering, and verifying a score without listening |
| Rendering | Presets, GPU and CPU rendering, performance, 4K |
| Rendering on Modal | Parallel cloud renders, caching, costs, the GitHub workflow |
| Releasing | Distribution encodes and GitHub Releases |
| AGENTS.md | Conventions and hard-won pitfalls, for people and coding agents alike (CLAUDE.md links to it) |
Notes on the film are as welcome as code: a shot that could be better, a caption that reads wrong, a scientific or historical detail (with a source, ideally). Use the issue forms. Fixes and improvements to the engine, the tools and the synthesizer are welcome too, and so are re-cuts, translations and remixes of the film under its license. See CONTRIBUTING.md, the Code of Conduct and SECURITY.md. Changes are listed in the CHANGELOG.
The Arrow of Time is by Abhishek Pradhan. If it moved you, you can buy me a coffee.
TypeScript
39.1%
Python
34.3%
GLSL
26.2%
The Arrow of Time: the history and future of everything in six minutes, made entirely in code (WebGL2 shaders and a Python-synthesized score).
TypeScript
0
74 commits
updated Sep 28, 2026
The history and future of everything, from the first instant to the last.
A six-minute film made entirely in code: every frame is rendered by shaders in a small WebGL2 engine, and every note of the score is synthesized in Python.

Watch the film (1080p, a 720p preview and a poster, on the Releases page)
Time has one direction. The film follows it from the Big Bang to the heat death of the universe, paced by a ticking clock: it falls silent in the Big Bang, accelerates through human history, stops dead at Now, then resumes and slows as the stars die, until its last tick.
| Time | Chapter | |
|---|---|---|
| 0:00 | Prologue | "Everything that has ever happened…", a single point of light gathering energy |
| 0:20 | The Universe | the Big Bang, inflation, the first elements, first light |
| 0:50 | Cosmic Dawn | the dark ages, the first stars, galaxies, the Milky Way |
| 1:20 | The Sun and Earth | a collapsing nebula, the young Sun, a molten Earth, the impact that makes the Moon, the first oceans |
| 2:00 | Life | the first cells, the Great Oxidation, Snowball Earth, the Cambrian seas, onto land, the dinosaurs, the asteroid |
| 2:46 | Humanity | mammals at dawn, the first people at dusk on the savanna, hand stencils in a cave |
| 3:06 | Civilization | twelve thousand years as one day: the first harvest, Uruk, cuneiform, Giza, Athens, Gutenberg's press, the railway, the Wright Flyer, Trinity |
| 3:31 | The Space Race | the R-7 lifting Sputnik through the clouds into an orbital sunrise; Apollo 11 on the Sea of Tranquility, and Armstrong's own voice; the Earth at night |
| 4:12 | Now | the pale blue dot, and silence |
| 4:20 | The Future | new worlds, drifting constellations, the oceans boil away, the red giant, the white dwarf, the Milky Way and Andromeda |
| 5:06 | The End | the last stars, the black hole era, evaporation, the end of time |
| 5:40 | Epilogue | "That moment is now." |
film/timeline.json holds the script, the
captions and every cue. The shots, the captions and the score all read it, so moving a beat moves
the picture, the text and the music together.The making-of goes scene by scene, and the score explains the music.
You need Node 20+, Python 3.10+ and ffmpeg (details per platform).
git clone https://github.com/abhishekpradhan/the-arrow-of-time.git
cd the-arrow-of-time
npm install
npm run setup # Python venv for the score, Playwright's Chromium, ffmpeg check
npm run dev # interactive preview at http://localhost:5173
npm run audio # synthesize the score -> out/audio/score.wav
npm run render # render the film -> out/renders/the-arrow-of-time-final-latest.mp4
With a GPU the final 1080p render takes about half an hour; on a CPU alone it takes several hours, which is what Modal is for.
| Command | What it does |
|---|---|
npm run dev | Preview player: scrub, play with sound, step frames (Space, ←/→, [/] between shots). ?s=1 renders at full resolution, ?mb=1 adds motion blur. |
npm run still -- --t 12.5 [--t 30 ...] [--grid] | Still frames as PNGs. --sheet --from 0 --to 80 --n 40 makes a contact sheet, --bench --scale 1 measures the cost of a frame, --textonly shows the captions over black. |
npm run render [-- --preset draft] | Render the film (resumable with --resume; --from/--to or --frames a:b render a range). |
npm run audio [-- --from s --to s] | Synthesize the score (a window renders in seconds). |
npm run release | Distribution encodes of the latest render: 1080p, a 720p preview, a poster and checksums. |
npm run typecheck | Type-check the engine, the film and the tools. |
film/ the film: timeline.json (script, captions, cues), project.ts, shots/, shaders/,
text.ts (captions), score.py (the score)
engine/ the WebGL2 film engine it runs on (TypeScript): renderer, camera, post, text,
components (planets, galaxies, an atmosphere) and a GLSL library
audio/ the Python synthesizer, mastering and analysis the score is written with
tools/ render, still, audio and release CLIs; the Modal pipeline; asset builders
assets/ data the film loads: Earth maps, the giant-impact simulation, NASA's Apollo 11 audio
docs/ the making-of, the score, and guides to working on, rendering and releasing the film
out/ renders, stills and audio (git-ignored)
timeline.json ──► project.ts ──► shots (GLSL, sprites, ray marching) ──► HDR composite ──► post ──► frame
│ └──────► captions (glyph cache, per-beat layout) ─────────────────────┘
└──────────────► score.py ──► audio/studio synth ──► mix ──► master ──► score.wav ──┐
▼
headless Chromium ──► raw RGBA ──► ffmpeg (x264) ──────────────► film.mp4
| Guide | What it covers |
|---|---|
| Getting started | Install, preview, render, troubleshooting |
| The making of | How each scene is made, and the science and history behind it |
| The score | The music's design and its cue sheet |
| Working on the film | The timeline, shots, captions, look and score, and the review loop |
| The engine | Shots, camera, sprites, planets, galaxies, the atmosphere, shader includes, post, text |
| Audio | The synthesizer, mixing, mastering, and verifying a score without listening |
| Rendering | Presets, GPU and CPU rendering, performance, 4K |
| Rendering on Modal | Parallel cloud renders, caching, costs, the GitHub workflow |
| Releasing | Distribution encodes and GitHub Releases |
| AGENTS.md | Conventions and hard-won pitfalls, for people and coding agents alike (CLAUDE.md links to it) |
Notes on the film are as welcome as code: a shot that could be better, a caption that reads wrong, a scientific or historical detail (with a source, ideally). Use the issue forms. Fixes and improvements to the engine, the tools and the synthesizer are welcome too, and so are re-cuts, translations and remixes of the film under its license. See CONTRIBUTING.md, the Code of Conduct and SECURITY.md. Changes are listed in the CHANGELOG.
The Arrow of Time is by Abhishek Pradhan. If it moved you, you can buy me a coffee.
TypeScript
39.1%
Python
34.3%
GLSL
26.2%