Perigee: a real-time 3D viewer of everything orbiting the Earth, the Moon and Mars (and the solar system)

Hi all,

I’ve been building Perigee (perigee.info), a free, open-source (MIT) web viewer that shows in real time the 16,000+ active satellites around the Earth, the spacecraft orbiting the Moon and Mars, and the probes crossing the solar system. It’s plain TypeScript + Three.js (WebGL2), no framework, and every position is computed in the browser.

A few things that might interest people here:

  • 16k satellites in one THREE.Points. SGP4 runs in a small worker pool. Workers return two position samples per object as transferable Float32Arrays. The vertex shader then moves each point along its orbit between samples with the two-body f and g series, so propagation only needs to run about every couple of minutes of simulated time. Picking is done on the GPU (an off-screen pass with the index encoded as a colour), with no raycasting.
  • Scales from meters to astronomical units. Everything is computed in Float64 on the CPU and sent to the GPU camera-relative, with logarithmicDepthBuffer in every view. Custom ShaderMaterials include the logdepthbuf_* chunks so they depth-test properly next to the built-in materials.
  • A quaternion orbit camera instead of OrbitControls, so you can roll over the poles without gimbal lock. It has arcball rotation, roll, a pan that moves the pivot, logarithmic zoom, and a guard that keeps the camera from entering bodies (it slides along the ground instead).
  • Textures. NASA public-domain maps are encoded offline to KTX2/Basis, with WebP as a fallback. 8k levels are streamed only when you get close, and only on capable GPUs.
  • Quality tiers. Cheap startup signals (WebGL caps, GPU name, memory, cores) pick a tier that sets pixel-ratio limits, MSAA and effects. Adaptive resolution then steps the pixel ratio down when frames run slow.
  • Small touches. A procedural Sun shader with real sunspot positions from NOAA, illustrative clouds baked on the GPU, glTF spacecraft models from NASA lit almost only by the Sun with self-shadowing, and an embed mode with a postMessage API so teachers can drop a live view into a page.

I made Perigee as a tool first and foremost for my kids and for myself. I’m a game developer having worked in the industry for more than 20 years and I’ve always wanted a tool to explore the solar system like we would do in a game, the UI is even inspired by the Halo series. I also wanted to test out agentic coding and try out new tools like Three.js, coming from a Unity and propietary game engine background.

Links:

Feedback is very welcome, especially on performance on your hardware (?debug=perf shows the tier and frame rate) and anything that looks off.