Lab › Mru 2049

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 lint

The data files in public/ are committed, so a fresh clone flies without building any assets.

Controls

InputEffect
MousePitch and yaw, rate based
SpaceFull throttle. The ship handles the arrival
W / SThrottle, logarithmic, 1 m/s to 1000 light years per second
ShiftHold for ten times the throttle rate
A / DRoll
XFull stop
OMatch orbit with the nearest body
FFind an object by name

URL switches

?webglForce the WebGL2 backend
?debug=skyThe star pass alone, amplified 400×
?debug=sceneThe scene pass alone, with no sky
?debug=depthLinear depth
?debug=alphaThe 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