Inspirations

Dunes under the Milky Way

A time-lapse over a sea of sand dunes, live in 3D: raking light on wind ripples, a glowing sunset with long blue shadows and a lone acacia, the Belt of Venus, then the Milky Way core rising over the dunes before dawn returns.

Made in Claude Code (Claude subscription) with claude-opus-5.5. The agent wrote code, looked at the preview and fixed it over several iterations. This is not a single-shot result: comparisons on this site show models in one attempt.

Starting prompt

Build "Dunes under the Milky Way": a real-time 3D time-lapse of a sand sea that runs from late-afternoon light through sunset and a moonless night under the Milky Way to dawn, filmed as one continuous camera move. It must look like real time-lapse photography of a great erg (the Sahara or the Namib) and be beautiful from the first frame. Single self-contained HTML file; Three.js and its addons from a CDN via an import map are fine; build everything procedurally, no external models, textures or image files.

The sand sea (metres, y up; x east, z south):
- One analytic height function, used on the CPU (camera, particles, plants) and in the shaders. Megadunes about 1.3 km apart and up to 30 m high carry crescentic (barchan) ridges about 120 m apart and up to 20 m high. Each dune has a long windward slope of 10 to 15° and a slip face at the angle of repose, about 34°. The two meet in a knife-sharp, sinuous crest. Where a dune shrinks, its crest swings downwind into horns. A few star dunes, 60 to 150 m high, rise above the field with three to five sinuous, knife-edged arms.
- Per-pixel detail: wind ripples about 10 cm apart, asymmetric and across the wind, only on windward slopes and flats, crawling downwind and fading out with distance so they never shimmer. Avalanche grooves run down the slip faces.
- The sand material: warm orange quartz sand, lighter on the crests, with a slight colour change on the ripple crests. Warm wrap lighting at the terminator (subsurface warmth), a backscatter hot spot, warm bounce light from sunlit slopes into the shadows, and fine grain glints that sparkle in direct sun.
- Real shadows. March a height texture towards the sun, so dunes cast long shadows that are sharp near the dune and soften with distance. Shadows are lit only by the sky, so they turn blue.
- An interdune flat with a pale crust, a few dry grass tufts and one lone umbrella acacia (a forked trunk and a flat crown of fine foliage), each casting a long shadow at sunset. No people, footprints, animals or vehicles.
- Saltation: thin streamers of sand blow off the nearest crests in gusts and glow when backlit by the low sun; the wind drops at night.

The sky, one physical model for day and night:
- A single-scattering atmosphere (Rayleigh, Mie for desert dust, ozone) that includes the Earth's shadow, rendered each frame into a small lookup texture. It gives the warm horizon glow and the sun's aureole, the soft blue-grey Earth's shadow and the pink Belt of Venus rising opposite the sunset, and the deep blue of the blue hour. The same model lights the sand (sun colour and skylight) and adds aerial perspective to distant dunes.
- The night sky in true positions for a June night at latitude 24° N:
  - About 9,000 stars. The bright ones are coloured, and Scorpius, the Teapot of Sagittarius and the Summer Triangle are where they really are.
  - The Milky Way, its bright core rising in the south-east, with star clouds and dark dust lanes, including the Great Rift.
  - Faint green airglow along the horizon, and zodiacal light along the ecliptic before dawn.
- The sky turns around the celestial pole. A satellite crosses after dusk and fades into the Earth's shadow; one meteor flashes.
- Starlight keeps the night sand readable: never a black screen.

The film: a 60-second time-lapse that loops. The night is slow; midday flashes past.
1. Afternoon (0–6 s, 18:00): low raking light. The camera glides about 2 m above a rippled windward slope.
2. Sunset (6–11 s): the camera rises over the crests. The crests glow orange, long blue shadows stretch away from the sun and the sun touches the horizon. The 8-second frame must be the most beautiful light.
3. Twilight (11–21 s): looking east over crests that catch the last pink skylight, at the soft blue-grey Earth's shadow under the pink Belt of Venus. Then the blue hour: dune shapes in soft blue light under the first stars.
4. Night (21–45 s): the classic astro-landscape shot. The camera circles a tall star dune, low over the sand, so its knife-edged arms fill the foreground while the Milky Way core rises above the summit and swings from south-east to south-west. Starlight and airglow keep the crests and slip faces readable in cool blue-grey. The satellite and the meteor appear here.
5. Dawn (45–53 s): zodiacal light, then the first light in the east, as the camera flies back.
6. Day (53–60 s): warm morning light, a midday of under a second, then golden afternoon light raking across the ripples back to the start, so the loop is seamless.

The look: ACES filmic tone mapping with sRGB output, the exposure ramped like a day-to-night time-lapse, a soft vignette and fine grain. Dramatic but readable, never muddy or washed out.

Interface: a small, elegant caption in a corner with the title, local time and phase, and one line of physics per moment: the angle of repose, saltation and ripples, why dunes migrate, why the sky turns pink opposite the sunset, why the Milky Way has dark lanes. Drag to look around; the view eases back to the path a few seconds after the last input. Everything moves from the first frame, with no loader, title card or fade, driven by wall-clock time. The layout works on a phone. The page runs inside a sandboxed iframe, so use no storage and no dialogs.

Engineering rules (the page must work on the first load, with no fixes):
- Use Three.js r170 and only methods that exist on each of its classes. Give every custom ShaderMaterial `fog: false`, and declare every uniform, constant and varying its shaders use.
- Declare each identifier once. Inside one calculation, never reuse a shared scratch vector for two values that are both still needed; use local vectors.
- Guard every animated value against NaN.
- Answer with the complete file exactly once, in a single ```html code block: no drafts, partial snippets or notes.

Keep planning brief and write the code. Aim for roughly 900 to 1,300 lines, compact and well structured.