Mru 2049
A browser flight simulator on real astronomical data. Fly anywhere in the solar system and out to the nearby stars. Its purpose is to show scale. There is no combat, economy or progression.
TypeScriptthree.js · WebGPU109,389 starsno server
Run it
npm install
npm run dev
npm run check # types, tests and lintThe data files in public/ are committed, so a fresh clone flies without building any assets.
Controls
| Input | Effect |
|---|---|
| Mouse | Pitch and yaw, rate based |
| Space | Full throttle. The ship handles the arrival |
| W / S | Throttle, logarithmic, 1 m/s to 1000 light years per second |
| Shift | Hold for ten times the throttle rate |
| A / D | Roll |
| X | Full stop |
| O | Match orbit with the nearest body |
| F | Find an object by name |
URL switches
| ?webgl | Force the WebGL2 backend |
| ?debug=sky | The star pass alone, amplified 400× |
| ?debug=scene | The scene pass alone, with no sky |
| ?debug=depth | Linear depth |
| ?debug=alpha | The scene pass's alpha channel |
How it is put together
sim Ship state, date, flight. All Float64. Never imports three.js ephem Body positions and orientations from astronomy-engine scene Meshes, materials, and the per-frame rebase render Renderer, post chain, auto-exposure, textures stars Star catalogue, point-source flux, the instanced star field input Keyboard, pointer and touch, into one control struct ui HUD and panels. Never renders inside the frame loop tools Build-time scripts. Their output is committed
The coordinate system
- Float64 on the CPU. All state is metres in the heliocentric J2000 mean equatorial frame. It never enters a shader.
- Floating origin. The camera sits at exactly (0,0,0) and never moves.
- Reverse-Z depth, behind a runtime toggle.
- Distant-body rescale. Anything past 1e8 m is drawn at 1e8 m and scaled to keep its angular size.
Updated Sep 2026 · Edit on GitHub · Questions? Request information