An interactive 3D tour of the solar system, built with Next.js and React Three Fiber. Scroll to fly outward from the Sun, planet by planet, or switch to Explore mode and orbit, zoom and click your way around the system.
Nearly every surface is procedural: the Sun, the planets, fourteen moons, Saturn's rings,
the asteroid belt and Halley's Comet are all generated by GLSL shaders at runtime. Earth,
the Moon and Mercury are the exceptions, the three worlds you can check against your own
eyes. Their geography comes from four small public-domain maps in public/maps, 145 kB
in all, and everything else about them, colour, relief, weather and light, is still the
shader's work.
npm install
npm run devThen open http://localhost:3000.
Other scripts:
npm run build # production build
npm start # serve the production build
npm test # unit tests (Vitest)
npm run lint # ESLint
npm run typecheck # TypeScript
npm run check:shaders # compiles every GLSL program in headless Chrome
PORT=3100 npm run test:e2e # Playwright smoke test against a dev serversrc/data/bodies.tsis the single source of truth: copy, stats, orbit and rotation parameters, palettes and shader settings for every body.src/lib/holds the pure logic (orbit positions, spin axes and tidal locking, scroll-to-tour mapping, camera framing, quality tiers, seeded randomness). All of it is unit-tested intests/.public/mapsholds the four real surface maps, rebuilt byscripts/build-maps.py, andsrc/lib/maps.tsloads them and hands them to the shaders that want one.src/components/scene/is the 3D layer. One fixed full-screen canvas sits behind the page. The camera rig follows the scroll position in tour mode and hands the camera to camera-controls in Explore mode.src/shaders/contains the GLSL, one module per family: the star, rocky worlds, Earth (surface, clouds, aurora), Venus, gas giants and rings, ice giants, atmospheres, the moons (rock and ice, Io, Titan, plumes), the comet, the cinematic effects, and the particles (star dome, nebula, dust, belt).src/shaders/index.tsregisters every program for the compile checker.src/components/ui/is the DOM layer: hero, story panels, progress rail, explore HUD, loader.
Tour mode: scroll, or use the rail on the right to jump between worlds. Click any world to visit it. The Autoplay control at the bottom left scrolls the tour for you; its slider sets the speed from 0.5x to 3x, and any scroll, key press or click on the rail pauses it.
Explore mode: drag to orbit, scroll or pinch to zoom, click a world to fly to it. Use the dock at the bottom or the left and right arrow keys to move between worlds, including Halley's Comet on its elliptical orbit. Escape or "Back to the tour" returns you to the scroll journey.
Moons: every story panel lists the moons of the world you are looking at, and each one is a link you can follow. Thirteen famous moons are here beside our own, from Phobos and the four Galileans to Titan, Enceladus, Triton and Charon. Mercury and Venus have none, and say so. Moon orbits are drawn only around the world you are visiting, and a moon stops being drawn at all once it is smaller than a pixel or so on screen.
Seen from the north everything orbits and spins counterclockwise, as the real system does, so a planet's day runs the same way round as its year. The three worlds tipped past upright, Venus, Uranus and Pluto, turn backwards because of that tilt.
A moon spins about the axis its own orbit turns on, so Saturn's moons stand square to the rings and Uranus's lie on their sides along with the planet. Every moon here is tidally locked, its spin read straight off its orbit, so the same face stays turned toward its planet: watch the Moon from beside Earth and you get the near side, the one we grew up with. Pluto and Charon are locked to each other, the only pair that is. Our Moon's axis leans 6.7 degrees off its orbit, so the face it shows wanders by that much as it goes round, which is the libration that lets us see a little way past the edge.
The scene picks a quality tier on load from the device's pointer type, core count and memory. The tier controls post-processing, pixel ratio and particle counts. Reduced motion is respected: the camera snaps between sections instead of flying, twinkling and flare motion stop, and panel transitions become instant. Browsers without WebGL still get the full text of the tour over a static sky.
Figures follow NASA planetary fact sheets. Distances and sizes in the 3D model are compressed on purpose; nothing is to scale.
The surface maps are public-domain NASA imagery: Blue Marble and its matching water mask
for Earth, the Scientific Visualization Studio's LRO albedo map for the Moon, and the
NASA / JHUAPL / Carnegie MESSENGER MDIS mosaic for Mercury. scripts/build-maps.py
fetches them, shrinks them and writes what the site ships.