Ephemeris
A real-time WebGL orrery that puts every planet where it actually is tonight.
About this project
Nobody commissioned this one. It started as a question about whether a "3D space website" could be something other than decoration. Most of them are an arrangement of spheres with a nice typeface on top, where the astronomy is a mood rather than a fact. Ephemeris is the answer to that. It is a real-time orrery in the browser: you scroll, and the camera travels from the Sun out to Neptune, stopping at each body with a short written dossier and a live readout of where that planet is at this moment. At the end the whole system opens out, and you can drag the date across two hundred and fifty years and watch the orbits wind on. Every position on the page is computed rather than arranged. Each planet is placed by solving Kepler's equation — which has no closed form — by Newton-Raphson, against the orbital element set NASA JPL publishes for epoch J2000. Distance from the Sun, orbital speed, ecliptic longitude and light-travel time all fall out of the same solve and tick over live in a strip along the foot of the screen. It lands within a few arc-minutes for the inner planets and under half a degree for the outer ones: right for drawing a picture, and honest about being wrong for anything else. There is not one image file in the project. Nine bodies, two ring systems, the star field and the Milky Way are all generated in GLSL from noise — fractal sums for terrain, ridged multifractals for scarps, Worley cells for Mercury's craters, domain warping for anything that has to look stirred. Saturn's Cassini Division and Encke Gap sit at their true radii, and one density table draws both the rings and the shadow they cast on the planet, so the gaps appear in both. Then it had to survive contact with real hardware, and the interesting part of that was being wrong. The obvious suspect was the planet shading, so that went first: those surfaces never change, so they are now computed once at load into cube maps instead of being re-derived seventy times per pixel, per frame. It helped. But a proper profile — removing one thing at a time and re-measuring — showed the stock bloom pass costing four and a half times more than every planet on screen combined. Replacing it, dropping multisampling that was buying nothing visible, and folding tone mapping into the final pass took the frame rate up roughly fourfold. It degrades on purpose. Quality is guessed pessimistically from the device and then corrected from measured frame times. With no WebGL at all the page keeps its writing, its figures and its live readout, because the simulation still runs headless. Under reduced motion the smooth scrolling, camera drift and entrance animations are simply absent — and nothing is left hidden behind an animation that then has to arrive. No build step, no framework, no runtime dependencies. Native ES modules and an import map. View source, and it is the source.


