Inspirations

Sun Through the Oculus

The Pantheon's rotunda in Rome at true scale, as a compressed day passes over it. The sun's disc enters through the 8.2 m oculus and sweeps across the coffered dome, the drum and the marble floor along the real path for each date, inside a dusty beam of light.

Generated automatically by Claude API (automat) with claude-opus-5.5: the automat wrote the page, looked at its screenshots and fixed it where needed. This is not a single-shot result: comparisons on this site show models in one attempt.

Starting prompt

Build "Sun Through the Oculus": a real-time 3D interior of the Pantheon in Rome (completed around AD 125). A compressed day and year pass overhead, and the only direct light is the sun's disc entering through the open oculus. It should feel like standing in the rotunda: hushed, monumental and golden, with a slanted beam of light full of drifting dust. It must be beautiful from the first frame.

Use a single self-contained HTML file. Three.js r170 and its addons from the CDN via an import map are fine. Build everything procedurally, with canvas textures allowed; no external models, images or audio.

The building, at true proportions (units in metres):
- The rotunda's inner diameter is 43.3 m, and the height from the floor to the oculus is also 43.3 m, so a full sphere fits exactly inside. Model it this way:
  - a cylindrical drum 21.65 m high;
  - a hemispherical dome on top of the drum;
  - an open oculus 8.2 m wide at the crown, with a thick bronze-edged rim.
- The dome:
  - Five tiers of 28 coffers each. The coffers shrink upward and are stepped inward 3–4 times, like real coffers.
  - The tiers stop well short of the oculus, which leaves a smooth band of plain concrete around it.
  - Grey, slightly warm concrete with subtle procedural staining.
- The lower order of the drum:
  - Eight bays around the circle. The entrance is at the north, and the main apse opposite it at the south has a coffered half-dome.
  - The other six bays are exedrae that alternate between semicircular and rectangular. Each has two fluted giallo-antico columns with simplified Corinthian capitals.
  - Between the bays stand aediculae: small pedimented shrines, alternating triangular and segmental pediments.
  - A continuous entablature runs around the whole drum.
- The attic zone of the drum: porphyry and serpentine panels and blind windows under a second cornice.
- The floor:
  - Opus sectile in a grid that alternates large squares with inscribed circles and squares.
  - Use the real stones: purple porphyry, grey granite, giallo antico and pavonazzetto.
  - The floor is gently convex, rising about 30 cm at the centre, with small drain holes near the middle.
- Use instancing for coffers, columns and floor tiles so the scene stays fast.

The light (the heart of this piece, and it must be physically right):
- Compute the sun's direction for Rome (latitude 41.9° N) from the date and the solar time. Use declination δ = 23.44°·sin(2π(284+N)/365) and the standard hour-angle formulas.
- Direct sunlight is analytic and exact. In a custom shader on every interior surface, cast a ray from the fragment toward the sun. Intersect it with the plane of the oculus at y = 43.3 m. The fragment is lit only if that hit falls inside the 4.1 m radius.
  - Soften the edge by the sun's 0.53° angular size, so the disc has a real penumbra.
  - This produces the true elliptical patch of light. It slides across the coffers, stretches along the walls and lands on the floor near the summer solstice.
- Fake bounce light: put a warm PointLight just off the centre of the lit patch, with an intensity that scales with the patch's area and the sun's altitude. Add a dim sky-blue HemisphereLight that represents skylight through the oculus. This gives the whole interior a soft glow that changes with the sun.
- The beam: an oblique cylinder from the oculus along the sun direction, drawn as an additive shader with soft edges, faint noise and depth fade. Inside it, a few thousand dust motes drift slowly. They are lit only where they sit inside the beam.
- Night: when the sun is down, the oculus shows a deep starry sky disc and the room falls to cool blue moonlight. Make sure the scene never goes fully black.

The timeline, looping about every 70 s:
- One loop runs from dawn through noon to dusk and a short night.
- Each loop the date advances by about 1.5 months, so the disc's path visibly changes:
  - In winter the low sun keeps the patch high on the dome.
  - In summer the patch descends to the floor.
- On 21 April at noon, add a small caption note. That is Rome's founding day, when the light is said to fall near the entrance.
- The camera drifts slowly and continuously:
  - it starts just inside the entrance and looks up and across;
  - it rises toward the centre and gazes at the oculus;
  - it circles at mid-height and sinks back toward the floor.
- Use a wide but undistorted field of view of about 60–70°.

Interface:
- A small, elegant caption at the bottom left with:
  - "Pantheon, Rome · AD 125";
  - the current date and solar time;
  - the sun's altitude and azimuth;
  - where the disc falls: coffer tier n, smooth band, drum, apse or floor.
- Use a refined serif from Google Fonts, such as Cormorant Garamond.
- A thin day-of-year scrubber and a play/pause control, both small and unobtrusive.
- Drag to look around and scroll or pinch to change height. The camera returns to its path a few seconds after the last input.
- Everything starts automatically and is visibly moving from the very first frame.
- The layout works at 1150×700 and on a 390×844 phone. On a phone the caption is compact and the oculus sits a little above centre.

Rendering:
- ACES filmic tone mapping in sRGB, and a gentle bloom from UnrealBloomPass applied to the beam and the sunlit patch only.
- A soft vignette and very fine film grain.
- The stone has a low-gloss MeshStandard look, with the custom light term added. Extend the standard material with onBeforeCompile, or use a ShaderMaterial that declares everything it uses.
- Never washed out: the beam is luminous but translucent, and the shaded coffers keep their detail.

Engineering rules (the page must work on the first load, with no fixes):
- Single self-contained HTML file. Load Three.js r170 and its addons only via this exact import map: <script type="importmap">{"imports":{"three":"https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js","three/addons/":"https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"}}</script>. No other fetches.
- The page runs in a sandboxed iframe without allow-same-origin. Do not use localStorage, sessionStorage, cookies, alert or window.top.
- Use only methods that exist in Three.js r170. 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, especially the sun direction near the horizon and the patch area.
- Cap the pixel ratio at 2, handle resize, and keep a steady ~60 fps on a laptop. Use instancing, and avoid real-time shadow maps, which the analytic oculus test replaces.
- No console errors.
- 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 600 to 900 lines, compact and well structured. No black, untextured or placeholder objects anywhere.