Power-User Systems

Umbral Orrery

A planet, its moons and their sun, drawn by one ray-traced shader. Each moon casts a real eclipse shadow on the planet, dark in the middle and soft at the edge. A moon turns ember red when it passes into the planet's own shadow. Drag to move the camera around to the night side, where the atmosphere lights up as a ring.

Install

bun add ogl

Then copy 2 files into your project:

  • components/registry/umbral-orrery/umbral-orrery.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
moonCountnumber4How many moons orbit the planet.
orbitSpeednumber1Speed of every orbit. Inner moons always go around faster than outer ones.
tiltnumber0.3Turns the orbits around the line from the sun to the planet. Every moon still makes an eclipse at any tilt.
moonSizenumber0.2Size of the moons. The planet's radius is 1.
sunSizenumber0.05Size of the sun in the sky. A bigger sun gives softer shadow edges.
sunIntensitynumber1.6Brightness of the sunlight.
atmospherenumber1Strength of the glow around the planet.
trailsnumber0.6Brightness of the orbit lines. 0 hides them.
driftnumber0.03How fast the camera circles on its own. 0 keeps it still.
zoomnumber1.5How close the view is.
sunColorstring (hex)"#ffb24d"Color of the sun and its light.
glowColorstring (hex)"#a855f7"Color of the planet's atmosphere.
planetColorstring (hex)"#4b3a8c"Main color of the planet's cloud bands.
backgroundColorstring (hex)"#05060a"Color of space behind the scene.

What It Demonstrates

Orbit
An element circling around another in a continuous path.
Loop
An animation that repeats, a set number of times or infinitely.
Drag
Moving an element by grabbing it, often with momentum when released.
Momentum
Motion that carries velocity, especially after a drag or interruption.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.

Related Components

Appears In