Inspirations

Rainbow over the Falls

A 60 m waterfall in a mossy basalt gorge, live in 3D: its spray carries a true double rainbow (42° and 51°, Alexander's dark band, supernumerary fringes) that moves with the camera and climbs as the sun sinks. Grass, ferns, lupines, a footbridge.

Made in Claude Code (Claude subscription) with claude-fable-5.2. 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 "Rainbow over the Falls": a real-time 3D scene of a tall waterfall plunging into a mossy basalt gorge in late-afternoon sun (think Skógafoss), whose spray carries a physically correct double rainbow. It should look like a landscape film from the first frame, with real scale. Single self-contained HTML file; Three.js and addons from a CDN via an import map; everything procedural (canvas textures are fine), no external models or images.

The place (metres, y up; the fall faces south = +z, the viewer looks north):
- The fall: about 60 m high and 22 m wide, dropping from a notch in the rim into a round plunge pool 40 m across. Build it from three layered translucent sheets and a wispy outer veil on ballistic curves. Make the streak pattern a function of (position across, time minus fall time), so streaks travel with the water and stretch as it speeds up: glassy at the lip, torn white with bright sunlit streaks and dark gaps lower down.
- The gorge: a horseshoe cliff about 92 m across around the pool, whose arms run 270 m south, flare apart and drop lower, so the low sun reaches the fall. Sweep one sheet along that outline: a scree apron, a near-vertical wall with gullies, buttresses, blocky steps and four uneven ledges, a rounded rim, then a rolling plateau.
- Rock, in the shader: dark basalt in courses of irregular jointed blocks, with bands of columnar basalt, rusty patches, darker recesses, strong bump relief and a wet sheen near the fall. Moss with thickness on ledges and flatter surfaces: a raised lip with a dark underside, natural greens, tiny glints of dew.
- The floor: the river winds south from the pool, 10 to 15 m wide, between black gravel and grass. A gravel footpath follows the east bank; a branch crosses a 22 m wooden footbridge (cambered plank deck, posts, two rails, two trestles), the only human trace: no people. About 400 wet, glossy rocks line the water.
- Plants, instanced, alpha-tested and swaying, in natural clumps: about 36,000 grass tufts (painted blades, green to olive, uneven height), dense banks of some 4,000 ferns (eight arching fronds), 2,600 violet Nootka lupines of varied height, and low birch and willow scrub away from the path.
- Water: planar reflection with a Fresnel term, flowing ripples, a churning white boil under the fall, foam streaks carried downstream.
- Sky: deep blue with drifting sunlit cumulus, a warm glow near the sun, and a dark slate rain bank in the north behind the fall, so the bows stand against dark cloud.

The light and the rainbow, the heart of the piece:
- A warm low sun in the south-south-west, behind the viewer. Shadow-mapped shadows from cliff, rocks and bridge; soft cloud shadows slide over the gorge.
- Spray: a half-resolution raymarch through the depth buffer of a noisy plume over the pool and a thinner column up the fall, lit through the shadow map so the cliff's shadow cuts shafts into it. Add soft sprites curling up from the impact line.
- The bows are computed per pixel from the angle between the view ray and the antisolar direction, never drawn as geometry, so they move with the camera and the sun. Primary from 40.5° (violet) to 42.4° (red); secondary from 50.4° (red) to 53.7° (violet), a bit under half as bright; a white glow inside the primary and outside the secondary, and a clearly darker Alexander's band between them. Sum eight wavelengths, each with an Airy-like profile (a sharp outer edge and damped interference fringes inside): this gives the supernumerary fringes. Bow brightness = sunlit spray along the ray (from the raymarch) plus a faint veil of distant rain over the sky. No sun on the drops, no bow.
- ACES tone mapping, correct sRGB output, a slight contrast lift, natural greens, subtle bloom, soft vignette, fine grain. Vivid but never washed out; the fall keeps its detail. Hold 60 fps on a laptop: instancing, merged geometry, shadow map every second frame, pixel ratio capped at 1.5, stepping down if frames drop.

The film, a 72-second wall-clock loop, one continuous camera move:
1. 0–14 s: the hero view from the path, 106 m from the fall: grass and lupines in front, the bridge on the left, both bows arching over the fall.
2. 14–35 s: walk the east path past the bridge; the bows slide across the cliff.
3. 35–54 s: on towards the pool, stopping about 50 m from the fall and looking up it through the spray, the bow huge.
4. 54–72 s: rise 12 m above the river and glide back to the start, the full double arch over pool and bridge.
Over the first 62 s the sun sinks from 26° to 14° and the bows climb. Then a cloud covers the sun for a few seconds: the light turns soft, the bows vanish, the sun resets unseen, and the loop restarts without a cut.

Interface: a small caption at the bottom left with the title, one line of physics per moment (primary bow and its 42°; dispersion; the bow walks with you; secondary bow; Alexander's dark band; supernumerary fringes; lower sun, higher bow; a cloud, no bow; the sun returns), a live read-out such as "Sun 24.1° high · bow crest 17.9° · second bow 26.9°" and a thin progress line. Drag to look around; the view eases back after a few seconds; a "Drag to look around" hint fades out. Moving from the first frame: no loader or fade-in. Works on a phone.

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 700 to 1,000 lines, compact and well structured.