abhishekpradhan/the-arrow-of-time

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

See the code

See what people are saying

SourceMessageScoreDate

The Arrow of Time (r/ClaudeAI)

Following the trend here to create an AI generated film. My spin on this is I wanted to open source it so that others may fork and improve it. I created this project using Claude Code and Opus 5.5 over the weekend. I gave it a pretty straightforward and simple prompt and this is what is came up…

6

Sep 28, 2026

README

The Arrow of Time

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.

CI Film: CC BY 4.0 Code: MIT Buy me a coffee

Frames from The Arrow of Time

Watch the film (1080p, a 720p preview and a poster, on the Releases page)

The film

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.

TimeChapter
0:00Prologue"Everything that has ever happened…", a single point of light gathering energy
0:20The Universethe Big Bang, inflation, the first elements, first light
0:50Cosmic Dawnthe dark ages, the first stars, galaxies, the Milky Way
1:20The Sun and Eartha collapsing nebula, the young Sun, a molten Earth, the impact that makes the Moon, the first oceans
2:00Lifethe first cells, the Great Oxidation, Snowball Earth, the Cambrian seas, onto land, the dinosaurs, the asteroid
2:46Humanitymammals at dawn, the first people at dusk on the savanna, hand stencils in a cave
3:06Civilizationtwelve thousand years as one day: the first harvest, Uruk, cuneiform, Giza, Athens, Gutenberg's press, the railway, the Wright Flyer, Trinity
3:31The Space Racethe 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:12Nowthe pale blue dot, and silence
4:20The Futurenew worlds, drifting constellations, the oceans boil away, the red giant, the white dwarf, the Milky Way and Andromeda
5:06The Endthe last stars, the black hole era, evaporation, the end of time
5:40Epilogue"That moment is now."

How it was made

  • Everything is code. No footage, stock or samples: ray marching, particle sprites and painted silhouettes make every frame, and a small synthesizer makes every sound. The one recording is NASA's own, of Neil Armstrong calling Houston from Tranquility Base.
  • Real science and history where it counts. The Moon forms in a smoothed-particle hydrodynamics simulation run for the film (SWIFT, 61,139 particles). Today's Earth comes from Natural Earth maps, and the Big Dipper drifts on its Hipparcos proper motions. The rocket under the 1957 card is the R-7 that carried Sputnik, and Eagle comes down under a Sun ten degrees up, as it did on 20 July 1969.
  • One source of timing. 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.
  • A score you can check without listening. Organ, strings, piano, synth brass, bells, choir and drums with convolution reverb, mastered to -14 LUFS. CI renders it on every push and checks its hits and cuts against the timeline.
  • Cinematic post. HDR rendering, bloom, anamorphic streaks, light shafts, ACES tonemapping, grading, grain, motion blur, and a 2.39:1 letterbox that opens to full frame for the biggest moments.
  • Renders anywhere. Headless Chromium on a GPU, Mesa llvmpipe on a plain CPU, or dozens of containers at once on Modal for minutes and about a dollar.

The making-of goes scene by scene, and the score explains the music.

Build it yourself

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.

CommandWhat it does
npm run devPreview 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 releaseDistribution encodes of the latest render: 1080p, a 720p preview, a poster and checksums.
npm run typecheckType-check the engine, the film and the tools.

What's in this repository

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
GuideWhat it covers
Getting startedInstall, preview, render, troubleshooting
The making ofHow each scene is made, and the science and history behind it
The scoreThe music's design and its cue sheet
Working on the filmThe timeline, shots, captions, look and score, and the review loop
The engineShots, camera, sprites, planets, galaxies, the atmosphere, shader includes, post, text
AudioThe synthesizer, mixing, mastering, and verifying a score without listening
RenderingPresets, GPU and CPU rendering, performance, 4K
Rendering on ModalParallel cloud renders, caching, costs, the GitHub workflow
ReleasingDistribution encodes and GitHub Releases
AGENTS.mdConventions and hard-won pitfalls, for people and coding agents alike (CLAUDE.md links to it)

Contributing

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.

Credits and license

The Arrow of Time is by Abhishek Pradhan. If it moved you, you can buy me a coffee.

  • The film (the video and its soundtrack, stills, and the words it speaks) is licensed under CC BY 4.0. Share it, re-cut it, translate it, remix it, commercially too, with credit: "The Arrow of Time by Abhishek Pradhan, https://github.com/abhishekpradhan/the-arrow-of-time, CC BY 4.0".
  • The code, all of it (the engine, the tools, the synthesizer, and the film's shots, shaders and score code), is licensed under the MIT License. Build on it.
  • Borrowed with thanks: the Apollo 11 air-to-ground audio, courtesy of NASA (not covered by the film's license); Earth maps from Natural Earth (public domain); star positions from ESA's Hipparcos catalogue; the Moon-forming impact simulated with SWIFT, WoMa and SEAGen; shader and DSP snippets by Inigo Quilez, Dave Hoskins and others (MIT); and the typefaces Cinzel, Jost, Cormorant Garamond and UnifrakturMaguntia (SIL Open Font License). Details are in THIRD_PARTY_NOTICES.md.
cosmology
creative-coding
film
generative-art
glsl
music-synthesis
ray-marching
shaders
short-film
webgl2

abhishekpradhan/the-arrow-of-time

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

See the code

See what people are saying

SourceMessageScoreDate

The Arrow of Time (r/ClaudeAI)

Following the trend here to create an AI generated film. My spin on this is I wanted to open source it so that others may fork and improve it. I created this project using Claude Code and Opus 5.5 over the weekend. I gave it a pretty straightforward and simple prompt and this is what is came up…

6

Sep 28, 2026

README

The Arrow of Time

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.

CI Film: CC BY 4.0 Code: MIT Buy me a coffee

Frames from The Arrow of Time

Watch the film (1080p, a 720p preview and a poster, on the Releases page)

The film

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.

TimeChapter
0:00Prologue"Everything that has ever happened…", a single point of light gathering energy
0:20The Universethe Big Bang, inflation, the first elements, first light
0:50Cosmic Dawnthe dark ages, the first stars, galaxies, the Milky Way
1:20The Sun and Eartha collapsing nebula, the young Sun, a molten Earth, the impact that makes the Moon, the first oceans
2:00Lifethe first cells, the Great Oxidation, Snowball Earth, the Cambrian seas, onto land, the dinosaurs, the asteroid
2:46Humanitymammals at dawn, the first people at dusk on the savanna, hand stencils in a cave
3:06Civilizationtwelve thousand years as one day: the first harvest, Uruk, cuneiform, Giza, Athens, Gutenberg's press, the railway, the Wright Flyer, Trinity
3:31The Space Racethe 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:12Nowthe pale blue dot, and silence
4:20The Futurenew worlds, drifting constellations, the oceans boil away, the red giant, the white dwarf, the Milky Way and Andromeda
5:06The Endthe last stars, the black hole era, evaporation, the end of time
5:40Epilogue"That moment is now."

How it was made

  • Everything is code. No footage, stock or samples: ray marching, particle sprites and painted silhouettes make every frame, and a small synthesizer makes every sound. The one recording is NASA's own, of Neil Armstrong calling Houston from Tranquility Base.
  • Real science and history where it counts. The Moon forms in a smoothed-particle hydrodynamics simulation run for the film (SWIFT, 61,139 particles). Today's Earth comes from Natural Earth maps, and the Big Dipper drifts on its Hipparcos proper motions. The rocket under the 1957 card is the R-7 that carried Sputnik, and Eagle comes down under a Sun ten degrees up, as it did on 20 July 1969.
  • One source of timing. 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.
  • A score you can check without listening. Organ, strings, piano, synth brass, bells, choir and drums with convolution reverb, mastered to -14 LUFS. CI renders it on every push and checks its hits and cuts against the timeline.
  • Cinematic post. HDR rendering, bloom, anamorphic streaks, light shafts, ACES tonemapping, grading, grain, motion blur, and a 2.39:1 letterbox that opens to full frame for the biggest moments.
  • Renders anywhere. Headless Chromium on a GPU, Mesa llvmpipe on a plain CPU, or dozens of containers at once on Modal for minutes and about a dollar.

The making-of goes scene by scene, and the score explains the music.

Build it yourself

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.

CommandWhat it does
npm run devPreview 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 releaseDistribution encodes of the latest render: 1080p, a 720p preview, a poster and checksums.
npm run typecheckType-check the engine, the film and the tools.

What's in this repository

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
GuideWhat it covers
Getting startedInstall, preview, render, troubleshooting
The making ofHow each scene is made, and the science and history behind it
The scoreThe music's design and its cue sheet
Working on the filmThe timeline, shots, captions, look and score, and the review loop
The engineShots, camera, sprites, planets, galaxies, the atmosphere, shader includes, post, text
AudioThe synthesizer, mixing, mastering, and verifying a score without listening
RenderingPresets, GPU and CPU rendering, performance, 4K
Rendering on ModalParallel cloud renders, caching, costs, the GitHub workflow
ReleasingDistribution encodes and GitHub Releases
AGENTS.mdConventions and hard-won pitfalls, for people and coding agents alike (CLAUDE.md links to it)

Contributing

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.

Credits and license

The Arrow of Time is by Abhishek Pradhan. If it moved you, you can buy me a coffee.

  • The film (the video and its soundtrack, stills, and the words it speaks) is licensed under CC BY 4.0. Share it, re-cut it, translate it, remix it, commercially too, with credit: "The Arrow of Time by Abhishek Pradhan, https://github.com/abhishekpradhan/the-arrow-of-time, CC BY 4.0".
  • The code, all of it (the engine, the tools, the synthesizer, and the film's shots, shaders and score code), is licensed under the MIT License. Build on it.
  • Borrowed with thanks: the Apollo 11 air-to-ground audio, courtesy of NASA (not covered by the film's license); Earth maps from Natural Earth (public domain); star positions from ESA's Hipparcos catalogue; the Moon-forming impact simulated with SWIFT, WoMa and SEAGen; shader and DSP snippets by Inigo Quilez, Dave Hoskins and others (MIT); and the typefaces Cinzel, Jost, Cormorant Garamond and UnifrakturMaguntia (SIL Open Font License). Details are in THIRD_PARTY_NOTICES.md.
cosmology
creative-coding
film
generative-art
glsl
music-synthesis
ray-marching
shaders
short-film
webgl2

Languages

TypeScript

39.1%

Python

34.3%

GLSL

26.2%