# Opus 5.5 — October

A copy of the September 2026 Opus 5.5 rainbow (`../2026-09 Claude_Opus_5.5/`, left untouched), improved by Claude Opus 5.5
working on its own in Claude Code through one night in October 2026.
Focus, in rough order: landscape and light, rainbow physics, ambient sound, life in the glens. Everything must stay calm.

Each round below says what changed, why, and how it was checked. Things tried and thrown away are listed too.

## Quick tour
Open `rainbow.html` in this folder. The links below set the conditions through the address (`#...`); the controls
work as before afterwards. A link that flies you somewhere may now also look down (`pitch` below zero); before, flying
forced the view up to at least 6°.

| What | How to see it |
|---|---|
| Sound | Click the speaker by the clock, or press **O**. It's off until you do. |
| Fair-weather cumulus and their shadows | [`#fly=-6820,-12,9610&yaw=116&pitch=2&t=15&rain=0&cloud=0.35&wind=0.05&noseed=1`](rainbow.html#fly=-6820,-12,9610&yaw=116&pitch=2&t=15&rain=0&cloud=0.35&wind=0.05&noseed=1): low over Loch Leven, the cumulus mirrored in it |
| The reflection rainbow | [`#wind=0.02`](rainbow.html#wind=0.02): the opening shower on a calm evening; look up above the bow |
| Rain that looks like rain | The opening view |
| The golden eagle | Any day. `#eagle=150` brings its thermals close (a test setting) |
| The bothy and sheep | [`#fly=-5900,-25,8740&yaw=158&pitch=-5&fov=40&t=15`](rainbow.html#fly=-5900,-25,8740&yaw=158&pitch=-5&fov=40&t=15), or land on the shore east of the start |
| The bothy's firelit windows | [`#fly=-5845,-36,8680&yaw=177&pitch=-1&fov=40&t=21.9`](rainbow.html#fly=-5845,-36,8680&yaw=177&pitch=-1&fov=40&t=21.9) |
| The dinghy on Loch Leven | [`#fly=-5800,-41,9300&yaw=69&pitch=1&fov=30&t=16.5`](rainbow.html#fly=-5800,-41,9300&yaw=69&pitch=1&fov=30&t=16.5). At night it lies at anchor with its light lit. |
| Red deer (shy: come within 140 m and they run) | [`#fly=-5495,500,7421&yaw=225&pitch=-41&fov=12&t=15`](rainbow.html#fly=-5495,500,7421&yaw=225&pitch=-41&fov=12&t=15) looks down on the herd from 180 m above |
| Morning mist, fogbow and glory | [`#t=6.4&wind=0.06&rain=0&cloud=0.15&yaw=265&pitch=-12`](rainbow.html#t=6.4&wind=0.06&rain=0&cloud=0.15&yaw=265&pitch=-12) |
| The glory on cloud tops | [`#fly=-6100,4200,8700&t=17&cloud=0.72&rain=0.2&yaw=80&pitch=-20`](rainbow.html#fly=-6100,4200,8700&t=17&cloud=0.72&rain=0.2&yaw=80&pitch=-20), then look at the point opposite the sun |
| A moonless Milky Way | [`#t=3.3&cloud=0&rain=0&yaw=180&pitch=28`](rainbow.html#t=3.3&cloud=0&rain=0&yaw=180&pitch=28) |
| The northern lights | [`#t=3.3&cloud=0.1&rain=0&yaw=0&pitch=10&aurora=0.8`](rainbow.html#t=3.3&cloud=0.1&rain=0&yaw=0&pitch=10&aurora=0.8) |
| Real photos beside the sim | [`compare.html`](compare.html): 23 Highland photographs, each with the sim at the same spot, bearing, date and time (round 15) |
| A real place on a real day | [`#os=NN32453364&dir=2&hfov=55&date=2005-06-06&time=13:00&weather=fair`](rainbow.html#os=NN32453364&dir=2&hfov=55&date=2005-06-06&time=13:00&weather=fair): Ben Dorain from the A82; **P** copies a link to whatever you're looking at |

Everything runs in the page; nothing new is downloaded. GPU time in the default view at 1080p went from 6.4 to 7.9 ms on
a Quadro RTX 5000; mist, aurora and the reflection bow add a little more, and only while they're showing. No paid AI
models were used overnight. A request for an AI critique of the sound was blocked by the permission system, so the
sound was checked by measurement (loudness, spectra and spectrograms) instead.

## Starting point
Identical to the 5.5 page at commit 6583c0f.

## Round 1 — the bow readout tells the truth
The readout looked for rain on one line only, toward the crown of the bow. A bow often stands on two legs in a
shower while its crown is against dry sky, so it could say "no rain opposite the sun" over a vivid bow.
The probe now samples seven points along the visible arc and reports the strongest.
Checked at 18:05 with the opening shower: the old readout said 29 %, the new one 95 %, for the same vivid bow.
![before / after](notes/r01_bow_readout.jpg)

## Round 2 — fair-weather cumulus and their shadows
On a fair afternoon the sky had only high cirrus and the big shower cells: none of the small flat-based puffs
that make a Scottish summer day, and so none of the patches of shadow that drift across the hills.
They are too small for the weather simulation's grid, so they have their own cell pattern in the cloud
density: one flat-based dome per puff, 160–460 m tall, drifting and slowly changing with the rest of the sky.
They grow with the day's heating (none at night or low sun, most in a fair afternoon) and give way as the sky
clouds over. The terrain's shadow test only looked at 2.3 and 3.1 km up, so it gained a sample at the
cumulus layer, kept soft so the shadows read as shade, not holes.

First tries looked wrong — pointed "crowns", then tall teeth — until the cell pattern stopped varying with
height and the dome height followed the square root of each cell's strength.

Cost: about +1 ms of GPU time at 1080p on the sky pass (1.3 → 2.3 ms; whole frame ~14 ms on a Quadro RTX 5000).
![before / after: mirror loch and the glens](notes/r02_cumulus.jpg)

## Round 3 — a night sky worth looking up at
On a clear moonless night the Milky Way was a faint smudge you had to hunt for, and few stars showed. From a dark Highland
moor the band is plain once your eyes adapt, and the sky is crowded with stars. The band is about three times
brighter now, with its mottled star clouds kept. It is softened at the edges so it doesn't look like a cut-out, and fainter
stars are drawn a little larger and brighter.
Moonlight now washes both out. The stars and the band fade with the moon's phase and height, as they do outside, so a
moonlit night is no brighter than before.
The sim's moon sets at about 03:10, so 03:15–03:25 is the darkest sky of the night.
A first, stronger version had hard edges, so it was dimmed by a quarter.
![before / after: 03:20, no moon](notes/r03_night_sky.jpg)

## Round 4 — sound
The scene was silent. There's now a speaker button by the clock (or press **O**). It's off until you click it,
and the page remembers if you left it on. Everything is made in the browser from noise and oscillators, so
nothing is downloaded. It follows the simulation:
- **Wind** from the sim's wind speed and gusts, with extra random gustiness. It's deeper and stronger aloft, has more
  hiss in the heather near the ground, and a low moan over the ridges when it blows hard. Gliding fast adds a rush of air.
- **Rain** only where it is falling on you: a hiss plus two patter textures (light drops you can pick out, and a
  heavy downpour), made from a bank of 40 drop sounds (ticks on leaf, heather and rock, and a few plops into pools).
  A shower close by, but not on you, is a faint far roar.
- **Thunder** from each lightning strike, arriving at the speed of sound (a strike 4 km away is heard 12 s after
  the flash). Each roll is built fresh from a run of claps from different parts of the channel. Farther strikes
  are deeper and softer, and close ones have a tearing edge.
- **Water** lapping when you stand on a loch shore or skim the water. The GPU probe now measures how much open water
  lies within 25 m and 90 m (it reads 0.67 at the Loch Leven start).
- **Birds**, each placed at a compass bearing so they stay put as you turn, and duller behind you: meadow pipits and
  a far skylark on calm, dry days; curlews by the water, mostly at dusk; a tawny owl at night. They go quiet in rain
  and strong wind. From high up there are fewer, and they sound farther away.
- A glen's reverb with echoes off the far slopes, and a compressor plus limiter so nothing is ever loud.

Levels at full volume, measured on offline renders (EBU R128):

| Scene | Loudness |
|---|---|
| Calm wind | −38 LUFS |
| Strong wind | −22 LUFS |
| Light rain | −32 LUFS |
| Heavy rain | −25 LUFS |
| Shore with lapping | −34 LUFS |
| Birds | −30 to −35 LUFS |
| A strike 3 km away | short-term peak −16 LUFS, true peak −3.8 dBFS |

Typical web audio is around −14 LUFS, so this sits well underneath. A first pass had the strong wind at −19 LUFS,
carried by a tonal moan at 510 Hz; the moan is now 8 dB lower and gusts can't push it past a cap.

**How it was checked.** The sound code is one self-contained block. A test page renders scripted scenes with an
OfflineAudioContext to WAV files:
- shore;
- rising wind on the moor;
- a shower with thunder;
- a fast glide;
- night.

These were then measured for loudness and inspected as spectrograms. I can't listen, and an AI listening review
wasn't available during this run, so the birds were judged against what the real calls look like on a spectrogram:
- The first skylark was random glides (a "robot" risk). It now repeats syllables a few times before moving on, as larks do.
- The pipit has thin descending "tsip" notes that quicken, then a slowing trill as it parachutes down.
- The curlew has a rising "cour-lee" whistle or a bubbling trill.
- The owl is a pure 430 Hz hoot with a wavering end.

**Performance.** The first version built all its sound buffers when you clicked, which froze the page for 1.1 s, and
each strike froze it for 0.15 s. Now every buffer is built a slice at a time, at most about 2.5 ms per frame:
- switching sound on costs 1.4 ms;
- the wind is ready in about 0.3 s and the heavy rain in about 3 s (the fade-in covers it);
- thunder is built in the seconds before it's due.

Parameter updates are only sent when a value moves by more than 1 %, and the sound pauses when the tab is hidden.

Spectrograms (time across, 0–8 kHz up; ffmpeg's frequency labels sit about 1.5 kHz too high):
- shore: laps every few seconds, two pipit songs, a curlew, a far skylark;
- a shower building, with two thunder rolls;
- night: owl hoots and a curlew.

![spectrograms: shore, shower, night](notes/r04_sound.jpg)

## Round 5 — the reflection rainbow
When the sun shines on a calm loch, the water mirrors it, and that mirrored sun lights the rain too. It makes a second
bow centred as far *above* the horizon as the sun is high, so it rises from the same feet as the primary at the
horizon and arches higher. It's rare and memorable, and Loch Leven at the start faces straight into the evening bow.

It's computed the same way as the main bow, not painted on:
- While integrating the rain along each view ray, each drop also asks where light from the sun's image would have
  left the water. That's down-sun of the drop, as far out as the drop is high divided by tan(sun altitude). Only
  drops whose reflection point is on a loch (from the height map's water level) count.
- The strength is water's Fresnel reflectance at that grazing angle (26 % with the sun 13° up), from the same
  Airy bow table as the primary, so it has its own faint secondary.
- Real wind breaks the mirror. It fades between 1.5 and 4.5 m/s, so the breezy default opening has none. Turn the
  wind right down at the start to see it.
- The readout adds "a reflection bow off the calm loch" only when the probe finds sunlit rain on that arc.
  It samples the arc just as round 1 does for the primary.

Cost: +0.3 ms on the main pass at 1080p, and only while the water is calm; otherwise none.
![before / after: Loch Leven at 17:27, wind almost calm](notes/r05_reflection_bow.jpg)

## Round 6 — life in the glens: an eagle and a bothy
**A golden eagle.** It is a real 3D outline (span 2.1 m), not a flat sprite, so it reads correctly from any angle:
- From below: long broad wings, splayed primary "fingers", a short fanned tail.
- Side on: a thin shallow V.
- Its back catches the sun.

How it flies:
- It rides a thermal over the highest ground near you, picked from a few candidates in front of you, 350–900 m off.
- It circles, banked, climbing slowly, then gives a few slow, deep wingbeats and glides to the next thermal.
- It is away at night and in heavy rain, and turns up again near you if you fly off.

A first version had a buzzard's long tail and too much head; the tail is now 30 % shorter and fanned.

**A bothy on the shore.** It's found automatically when the page loads: a flat spot 2–16 m above the water, close
to the shore, in the fan the opening view looks over. It's the same spot whatever time the page is opened, it faces
the water, and it works on any landscape (for the real Highlands, 280 m from the start, on Loch Leven).
- **Building:** whitewashed rubble walls (blotchy, greener at the foot), a slate roof in courses, a stone chimney,
  a tarred door and four-paned windows. It is lit like the land (sun, terrain and cloud shadow, sky and ground light)
  and hazed with the terrain's own aerial perspective.
- **Shadow:** the terrain shader tests a box for the walls, roof and chimney, so it casts a shadow, and the ground
  darkens where it meets the walls.
- **Trees:** cleared from an 11 m garden, both where trees are placed and in the trees' procedural shadows, so no
  phantom shadows are left.
- **Smoke:** a thread of peat smoke rises from the chimney pot, leans downwind and spreads. Its density falls as it
  spreads (as real smoke does), so it reads as one plume, not separate puffs. It's thicker in the evening.
- **Windows:** after dark they glow with a flickering fire. The glow is added after the eye's night-vision shift, so it
  stays warm orange while everything else goes blue-grey.

Problems found on the way:
- The door and windows first z-fought with the wall at a distance (2 cm apart is below the depth buffer's resolution
  at 150 m), so they are now painted in the wall's own shader.
- A conifer grew through the roof, hence the cleared garden.

Cost: nothing measurable (main pass 3.6–3.8 ms either way).
![the eagle; the bothy by day; the bothy at night](notes/r06_life.jpg)

## Tried and dropped — crepuscular rays (sun shafts)
The idea: the haze glows with scattered sunlight except where it lies in a cloud's shadow. So, along each view ray,
measure how much of the (height-weighted) hazy air is sunlit, and dim the haze's glow by that. A forward-scatter
glow toward the sun was added for the sunlit part. A diagnostic render showed the right structure: rays fanning from
the sun under a shower cell. But in the final image the effect was mostly extra depth (haze darker in a shower's
shadow, distant ridges crisper) rather than visible beams, because a 1 km cloud shadow is a small part of a 16 km
line of sight unless you look almost along it.

Cost at 1080p: +2.6 ms on the main pass with 8 samples; still +1.1 to +1.5 ms with 4 samples, limited to within 70°
of the sun or the antisolar point (each low-detail cloud-density lookup is about 0.3 ms per full-screen pass). Too
much for what it shows, so it was reverted.

To revisit it: compute the sunlit fraction in a separate quarter-resolution pass (16 samples, no jitter, about
0.1 ms) and sample it in the main pass. It's low-frequency, so that loses nothing.

## Round 7 — rain that looks like rain
The opening view has a shower, and its rain was drawn as identical white sticks at constant opacity, a curtain over
the whole picture. Real rain a few metres away is varied and soft. Each streak now:
- **Takes its size from its fall speed** (bigger drops fall faster). Big drops make the longer, wider, brighter streaks;
  most are small and faint.
- **Fades at both ends** of its motion blur, and is slightly beaded (falling drops wobble).
- **Glints when backlit:** looking toward the sun, sunlit drops brighten.
- **Flashes at the rainbow angle:** a sunlit drop there shows that colour of the bow, looked up in the same Airy table
  as the bow itself, and computed per end, so a streak crossing the angle changes colour along it. A debug render
  showed the geometry is right: drops inside the primary are bright, those in Alexander's dark band between the bows
  are dark, and those on the arcs are coloured. At natural strength it's subtle, and it only happens when the drops
  around you are in sunshine, at the sunny edge of a shower.

The effect: the bow and hills show through the shower more clearly, and the rain reads as rain. Cost: none
measurable (a texture lookup per streak vertex).
![before / after: the opening view](notes/r07_rain.jpg)

## Round 8 — the glory (and a gentle cloudbow)
Fly above a cloud deck with the sun behind you and look down to the point opposite the sun. Pilots see a glory
there, round their plane's shadow: a small set of coloured rings on the cloud tops. It comes from light that cloud
droplets send straight back.
- **How it's built:** it's added to the clouds' scattering for light from their sunlit skin, where it forms. The rings
  come from the squared Bessel function J₀(2π·a·θ/λ)² for red, green and blue, averaged over droplet radii of
  7.5–9.5 µm. A wider spread (6–11 µm) washed out everything past the first red ring, so it was narrowed.
- **The result:** a white core, then red, a blue-green ring and a faint outer red, about 3° across. That is a small
  halo at normal zoom and textbook rings zoomed in.
- **Cloudbow:** the same droplets give a broad, almost white bow about 39° out. It's included, gently, and it's as hard to
  see as a real one (white on white).

The help panel now says where to look. Cost: one function per sky ray looking away from the sun; nothing measurable.
![the glory zoomed in (12° view) and at normal zoom](notes/r08_glory.jpg)

## Round 9 — the northern lights
On many dark nights the Highlands see the aurora (the "mirrie dancers"), and 2025–26 is just past solar maximum.
It's drawn in the sky pass behind cirrus and cloud, so cloud hides it and calm lochs reflect it:
- **Shape:** curtains 100–300 km up and hundreds of km to the north, along a line that folds slowly east to west.
- **Colour:** green from oxygen at 557.7 nm, strongest near 125 km with a sharp lower edge, and a faint red at 630 nm
  above 200 km.
- **Rays:** fine vertical rays that drift and shimmer. They converge toward the zenith in perspective, as real auroral
  rays do along the magnetic field lines.
- **Brightness:** integrated along the line of sight through the curtain, so a low arc near the horizon glows
  brightest, as it does in life. The eye's night vision makes it paler green than in photographs, which is also true.
- **Activity:** it waxes and wanes over tens of minutes. Some nights there's nothing, often a quiet arc low in the
  north, now and then a brighter display nearer overhead. It appears only in proper darkness. `#aurora=0..1` fixes it.
- **Readout:** says "the northern lights are out: look north" when there's a display. The help panel mentions it.

The 16 altitude samples first showed as faint horizontal bands. They're now jittered each frame, as the cloud
march is, and the sky's resolve smooths them. Cost: about +0.2 ms on the sky pass, at night, looking north.
![the aurora over Loch Leven, 03:20](notes/r09_aurora.jpg)

## Round 10 — sheep on the hill
Scottish Blackface sheep, the Highland breed: a creamy, lumpy fleece, black face and legs.
- **Placement:** about 50 in four flocks, on gentle ground above the shore near the start. One flock grazes on the
  slope behind the bothy. Placement uses the sheep's own random numbers, so the weather's sequence is unchanged.
- **On the ground:** each sheep stands on the terrain and leans with its slope. Heights come straight from the
  height map in the vertex shader, with no readbacks.
- **Behaviour:** mostly grazing, head down. Now and then one takes a few steps (back toward the flock if it has
  strayed) or lifts its head to look round. After dark they lie down one by one, legs folded under.
- **Lighting:** like the land (sun, terrain shadow, the trees' shadows, cloud shadow, sky and ground light, the same
  haze). A soft contact shadow is cast a little away from the sun, fainter in shade.

The first version was a smooth white egg on four sticks. The fleece is now pushed out in tufts with smooth normals
and woolly noise shading, the legs are sturdier, and the wool is toned to a dirtier cream.
At 50 m and beyond they read as sheep; up close they are simple but convincing.

The haze code shared by the bothy and the sheep is now one chunk (HAZE), not two copies.
Cost: +0.2 ms in the geometry pass with a flock in view.
![a flock grazing; closer](notes/r10_sheep.jpg)

## Round 11 — morning mist, with a fogbow and a glory
On a calm, dry morning that isn't overcast, mist lies in the glens and over the lochs, a few tens of metres deep.
It forms around dawn and burns off as the sun climbs, by about 25°. It's ray-marched as a thin layer in the main
pass: patchy, slowly drifting, its top lit gold where the low sun reaches it and blue-grey in the shadow of the
hills (a terrain-shadow test where the line of sight enters it). Trees and knolls stand out of it.

Its droplets add two pieces of optics to its scattering:
- **A fogbow:** a broad, almost white bow about 39° from the point opposite the sun. Mist droplets are too small to
  split the colours much. It's subtle, as in life.
- **A glory:** looking down into the mist toward the point opposite the sun, there are coloured rings where your
  shadow's head would be. That's the Brocken spectre's glory, the one Scottish hillwalkers see from the tops.

The readout points to them when there's mist, and the help panel mentions it.
A first version had a sign error in its forward-scattering term that gave a black disc round the sun, now fixed.
The mist also burned off too early (by 20°) and now lasts a little longer.
Cost: +0.65 ms on the main pass on misty mornings; nothing otherwise.
![mist in the glen at sunrise; the glory on the mist](notes/r11_mist.jpg)

## Round 12 — a boat on the loch, and lights in the dark
**A sailing dinghy:** white hull with a blue band, varnished deck, mast, a cream mainsail and jib.
- **Route:** found automatically, two points of open water at least 45 m from any shore with water all the way
  between, in the fan the opening view looks over. On Loch Leven that's a 515 m leg.
- **Sailing:** it tacks slowly from end to end. Speed and heel follow the wind; the boom swings out to leeward, further
  off the wind; it rocks and pitches a little. The sails glow when the sun is behind them.
- **Wake:** a faint V of foam when it's moving.
- **Reflection:** a mirrored copy, wavering a little more the deeper it lies. It's drawn only where the composite's
  depth says the pixel is open water (the reflection is under the water, so the depth test can't be used), so it
  never shows over land. It fades as the wind ruffles the loch.
- **Night:** it lies at anchor with its riding light lit.

**Lights in the dark.** A masthead light or a bothy window is a few centimetres across, sub-pixel from half a
kilometre, yet the eye sees such lights from miles away. So at night they're also drawn as small warm points of
constant size, depth-tested so hills hide them. The bothy now shows from the opening view at night as two warm specks
by the loch.

A first version didn't compile (a uniform missing from the boat's fragment shader) and broke the page; it was caught by the
load test and fixed before anything was committed.
![the boat under a shower's bow; closer, with its reflection](notes/r12_boat.jpg)

## Round 13 — red deer, and shy animals
A herd of red deer (9–13 hinds and a stag or two) on open hill ground well above the glen floor, 0.7–2.2 km from the
start. On the real Highlands they're about 300 m up the slopes above Loch Leven.
- **Look:** a red-brown summer coat with a pale rump, slender legs, a long neck. The stags carry antlers.
- **Movement:** they graze with muzzles to the grass, wander, and look round. Legs swing in diagonal pairs when they
  walk, with a bounding gait when they run.
- **Shyness:** come within about 140 m on foot or flying low, and the herd lifts its heads, then bounds away from you
  for several seconds and settles again further off.
- **Sheep:** they're shy too now. Land among them and they amble away.

Fixes on the way:
- The first neck leaned backwards (a sign error). In the grazing pose it swung down through the body, leaving the
  head hanging apart from it.
- The body was a sausage, so it's now one surface, deep-chested with a tucked belly. Its normals started analytic, but
  the profile made them disagree with the surface, so they're now averaged from the faces round each vertex.
- The patchy coats that remained were pairs of animals overlapping: random placement could put two within half a metre.
  Animals now keep their distance (3 m for deer, 1.6 m for sheep), at placement and as they move.

Cost: about +0.1 ms in the geometry pass.
![the herd from above; grazing, side on](notes/r13_deer.jpg)

## Round 14 — real animal models, made in Blender
The user suggested better models made or tidied in Blender. My hand-built sheep and deer were simple shapes; these
are proper low-poly animals by Quaternius, public domain (CC0 1.0), from poly.pizza: a red deer hind, a stag and a sheep.
They come with animations: the deer's and stag's eating, idle, walk and gallop.

**In Blender** (4.2, run from the command line):
- Each model is turned into the sim's frame: metres, y up, z forward, feet on the ground, scaled to life (hind 1.95 m
  long, stag 2.15 m, sheep 1.3 m). The stag's antlers, attached to its head bone, became part of the skinned mesh.
- Each vertex keeps its four strongest bone weights.
- Each clip is sampled at a few frames a second as bone matrices, stored as half floats.
- The sheep only had an idle animation, so its grazing (neck and head down to the grass, a chewing bob), walking
  (diagonal leg pairs) and lying (legs folded, body lowered) were posed in Blender for this.
- It all goes in `animals.js` (395 KB, loaded with the page; if it's missing the animals are simply left out).

**In the page:** one skinning shader draws each species in a single instanced draw. Each animal blends from the
clip it's leaving into the one it's entering over a third of a second, reading its bones' matrices from a texture.
The faces are flat-shaded from screen-space derivatives (the low-poly look), and lighting is the same as for the land.
Behaviour is unchanged; it now chooses clips:
- sheep graze, look up, walk, trot away if you land among them, and lie down after dark;
- the herd grazes, looks round, walks, and gallops off when you come close.

Problems found on the way:
- The sheep's rest pose lies on its side, so the first home-made poses came out tipped up. They're now built on its
  standing pose.
- The first grazing pose curled its head into its chest.
- The deer came out pale because the model's colours were too bright for this landscape's dark heather; the palettes
  were darkened about 40 %.

Cost: about +0.06 ms in the geometry pass with animals in view.

## Round 15 — real photographs, a real map, a real year
Asked for after round 14: "can we get some actual pictures of the Highlands and see if we can develop the code to match
them? ... I imagine it's the trees and land which needs work now."

**Links that put you somewhere real.** `#os=NN1234567890` (an OS grid reference), `#en=easting,northing` or
`#ll=lat,lon`; `#h=` metres above the ground or `#alt=` above the sea; `#dir=` compass bearing; `#hfov=` horizontal
field of view; `#date=YYYY-MM-DD` and `#time=HH:MM` (UK clock time, summer time handled);
`#weather=clear|fair|cloudy|overcast|showers|rain`; `#snow=` snow line in metres; `#mist=` and `#cirrus=` if wanted.
With a real place or day the sun is the real one (latitude 56.7°, the day's declination, the equation of time) instead
of the scene's usual late-summer evening at 40° N. **P** copies a link to the current view. The map (**M**) shows the
grid reference you're at.

**The photographs.** About 34,000 geotagged pictures in the sim's 100 km square were found on Wikimedia Commons; most
come from Geograph, and Commons' structured data gives where each was taken and which way it faces. Landscape views
were picked out by their titles, 200 were looked at on contact sheets, and 26 kept. Three were dropped because they
were taken from high ground that their recorded positions don't match. `compare.html` shows the rest, each beside
or overlaid on the live sim, with the bearing, tilt, field of view, date, time and weather adjustable. The photos are
linked from Commons, not copied here, and credited on the page (all CC BY-SA 2.0). Times of day aren't recorded, so
they're guesses.

**The land, from maps instead of noise:**
- **Woods** come from the National Forest Inventory Scotland 2025 (Forestry Commission, Open Government Licence). It
  maps conifer, broadleaf, felled and young planting, at 50 m. ESA WorldCover adds small woods the inventory misses.
  The invented plantations and lone trees are gone from the real Highlands.
- **Ground colour** comes from Sentinel-2 cloudless 2016 (EOX, CC BY 4.0). The haze and the hills' own sunny and
  shady sides are taken out using the OS heights. Lochs and woods are filled from the ground around them. The moor's
  procedural patchwork stays as the detail within each 50 m cell. Clear-fells are brash-brown, young planting dark.
- Both live in `highlands_land.js` (1.8 MB) and `highlands_sat.js` (1.5 MB), side by side in one texture.
  `#sat=0` turns them off.
- WorldCover was tried for heather, bog and rock and gave up: it calls 70 % of the square "grassland".

**Trees:**
- **Species:** birch (white bark, upright open crowns), oak and alder, Sitka spruce in plantations (six ragged
  blue-green whorls) and Scots pine (bare orange trunk, flat top).
- In a close wood the crowns spread until they touch, and grass thins on the wood's floor.

**The year:**
- The moor greens in spring and turns tawny and rust from late August.
- Bracken rusts in September; birch goes gold and oak bronze in October; broadleaves are bare from November.
- Spring leaves come out fresh green in early May.
- Snow lies above a typical line for the month (600 m in January), patchily: in gullies and hollows, thin on the
  ribs. Real-date links get mist and cirrus only when asked for them.

**Matching the photos.** Each change was judged on photo/sim pairs, rendered frame-exact at the photo's aspect. On the
way:
- The satellite colour was first 40 % too bright and too yellow.
- May birch came out in autumn gold (fixed).
- The January snow line never reached the shader (fixed).
- Far lochs reflected only the white horizon. Unresolved wind ripples now tilt the reflection up into bluer sky at
  the right Fresnel.
- Gullies now groove moderate slopes, not just crags, with dark wet floors.
- The foreground got tussocks of mixed grass, dead moor grass and rush, and heather patches whose tufts flower
  purple in August.

![Stob Ghabhar, October, and Meall a' Bhainne, July: photo left, sim right](notes/r15_photos.jpg)
*Photos: "Stob Ghabhar from the southeast" © Jim Barton and "Meall a' Bhainne" © Richard Webb, both CC BY-SA 2.0 via
Geograph / Wikimedia Commons.*

![Over the glens, before and after the mapped land](notes/r15_land.jpg)

Still wrong, judged against the photos:
- The sky is paler than a real blue sky, so the lochs are greyer than they should be.
- Distant hills are a little smooth. The heights are 50 m data.
- Trees up close are still simple shapes.
- A real overcast sky is brighter and higher than the sim's.

Cost: the tree pass in a wood went from 0.9 to about 3.5 ms (more and fuller crowns); elsewhere it's small.

## Round 16 — sky, cloud and water against the photographs
All 23 photo views re-rendered with round 15's code showed the same faults nearly everywhere: cotton-wool clouds,
a dim picture, a greyish sky and silver lochs. Measured on the pairs, then fixed one at a time:

- **Exposure.** The sim metered on the sky alone. With sunlit cumulus in view it cut the exposure by up to 2.2×, so
  the land came out half as bright as in the photographs. It now gives way only partly to a bright sky, as a camera
  exposing for the hills does; the full pull is kept for the glare round the sun.
- **Clouds.** Fair-weather cumulus are bigger and taller, 200–900 m. A finer three-dimensional field bulges their
  sides and tops into cauliflower turrets, so they are no longer smooth domes. Distant clouds fade into the colour of the
  air in front of them, so the horizon no longer carries a crisp band of cotton.
- **Sky colour.** Three-colour Rayleigh scattering gives a slightly cyan sky. By day it is turned to the deeper blue
  of the photographs, with its brightness kept. Twilight colours are left alone. The air is cleaner too (less haze
  between showers), so the far hills stand out.
- **Lochs.** In a breeze above about 3 m/s the calm slicks break up, and the unresolved chop is steeper (the full
  Cox–Munk slope). The water reads navy, as in the photographs, instead of mirroring the pale horizon and the clouds.
  Calm days (`#wind=0.05`) still give mirror water.
- **Hill colour.** The satellite mosaic's vegetation is bluer than grass and heather ever are: haze its correction
  left in, worst on slopes that were in shadow and so got brightened. Blue beyond what plants reflect now goes back
  toward olive. Bright grey rock and scree are left alone.

**Faster comparisons.** A render took about 2 minutes: ~40 s compiling shaders (the landscape shader is large, and
Windows' D3D compiler is slow on it), the map data, then 10 s of simulated frames for exposure and clouds to
settle. Now:
- A real-place link typed into the address bar re-aims the running sim in place, with no reload and no recompiling.
  Other hash changes reload the page, so any link still works when pasted.
- `compare.html` uses this: after the first photo, each one switches in a second or two. (Opened from a file the
  frames can't reach each other, and it reloads as before. On the website it switches in place.)
- The batch renderer used for these rounds (outside the repo) renders all 23 views in one page per job: 5 minutes
  instead of 20.

![Meall a' Bhainne, Loch Arkaig and Loch Creran: photo, round 15, round 16](notes/r16_photos.jpg)
*Photos: "Meall a' Bhainne" © Richard Webb, "Loch Arkaig from near Caonich" © Walkon4, "Loch Creran beyond
Druimavuic" © Peter S, all CC BY-SA 2.0 via Geograph / Wikimedia Commons.*

The six standard views (bow, glens, sunset, mirror, storm, night) look as before, a little clearer.

Still wrong:
- The foreground grass is sparse tufts on smooth ground. A real meadow or moor is a dense, fine mat.
- The photographs' skies often hold broad stratocumulus. The sim's 'fair' and 'cloudy' still give separate puffs.
- Near hillsides seen up close are smooth and pale. Real ones have rock, tussock and shadow at every scale.
- Some camera positions don't match their photos: a few views stand inside a plantation, or below the real viewpoint.
- A small water body on a hillside (Loch Creran view) shows as a dark band.

