Cathedral of Light
A walk through a High Gothic nave over one compressed day: sunlight streams through procedural stained glass as visible shafts, casting jewel-coloured patterns across piers, chairs and the labyrinth floor, from blue morning to golden evening to candlelit dusk.
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 "Cathedral of Light": a real-time 3D walk through the nave of a High Gothic cathedral (inspired by Chartres and the Sainte-Chapelle), where sunlight pours through stained glass over one compressed day. It should look like an architectural visualisation, beautiful from the first frame, with real proportions and nothing toy-like. Single self-contained HTML file; Three.js and its addons from a CDN via an import map are fine; build everything procedurally (canvas textures are fine), no external models or image files. The building (metres, y up; the nave runs along z, west = +z, south = +x): - A nave about 14 m wide (pier axes at x = ±7) and 63 m long in nine 7 m bays, with 6 m side aisles, closed by a west façade and a flat east wall. - Clustered piers: a round core about 1.85 m across with four engaged colonnettes, an octagonal plinth, moulded bases, a flared capital with crockets and an octagonal abacus at 10.5 m. Three slender vaulting shafts rise from each capital to the high vault springing at 23 m. - Three storeys: pointed arcade arches with roll mouldings (apex about 15 m); a triforium of four small pointed openings per bay with a dark passage behind; a clerestory with two lancets and an oculus per bay. String courses at 15.6 m and 19.6 m. - Quadripartite rib vaults, crown about 35 m in the nave and 15 m in the aisles: four curved cells per bay meeting on the groins, keeled diagonal ribs, heavier transverse ribs, wall ribs and gilded carved bosses. - West façade: a wooden portal with iron straps, three lancets and a great rose window 12 m across. East wall: three tall lancets above the altar and a smaller rose. - Stone with procedural masonry in the shader: ashlar courses with staggered joints on walls and vaults, drum joints on the piers, per-block tone variation, soft weathering and grime streaks, darker bases, a slight bump on the joints. - A worn limestone pavement with the Chartres labyrinth inlaid near the west end (rings with turns, a six-petal centre, a cusped rim). - About 600 wooden church chairs with rush seats in two blocks along a central aisle, a stepped sanctuary with a draped altar, a cross and six candlesticks, two tall candelabra, a votive stand and three iron crown chandeliers, all with flickering flames. Stained glass, painted on canvas: medallion lancets with a deep blue mosaic ground, ruby borders with white pearls, round and quatrefoil medallions holding simple figures (halo, face, robes, trees), iron armature bars and black lead lines; a rose with twelve figured petals, quatrefoils, small roundels and dark stone tracery. Windows glow from behind, brighter on the sunlit side, deep blue at dusk. The light, the heart of the piece: - Mask the sun's direct light with the glass: in the shaders, trace from each point towards the sun, find the wall plane the ray leaves the building through (clerestory, aisle or end wall) and read the glass colour there, blurred more with distance. Only the piers, arcade walls and chairs cast shadow-mapped shadows. Jewel-coloured images of the windows fall across the floor, chairs and piers and slide as the sun moves. - Visible shafts: a half-resolution raymarch through the depth buffer using the same glass function and the sun's shadow map, with drifting dust density and forward scattering, added before bloom. Dust motes sparkle only inside the beams. - ACES tone mapping, subtle bloom, a soft vignette. The interior stays readable: never a black cave, never washed out. Keep it smooth on a laptop: merge static geometry and instance the piers and chairs. The day, a 56-second loop: cool morning light from the east-southeast, noon from high in the south, a golden evening sun streaming through the west rose, then candlelit dusk with deep blue windows and warm candle and chandelier light. Fade through black at the loop. The camera, one continuous take: 1. A slow processional dolly down the central aisle over the labyrinth, looking east. 2. A tilt up into the vaults at noon. 3. A turn back to face the west rose in the evening light, drifting east. 4. At dusk, a turn towards the candlelit choir while drifting back down the nave. Interface: a small, elegant caption with the title, the architectural element in view (derived from where the camera looks) and the time of day, plus a thin day-progress line. Drag to look; the view returns to the path a few seconds after the last input. Everything starts automatically and is visibly moving from the first frame, without any interaction. The layout 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 900 to 1,300 lines, compact and well structured.