# Millbrook Pond

A calm countryside pond diorama in Three.js — an irregular pond with soft grassy
banks, rocks, reeds, a dirt path, lily pads, drifting leaves, dragonflies, birds
and the occasional rising fish. A small timber watermill with a shingled roof and
stone chimney stands on one shore; its wooden waterwheel turns continuously,
paddles dipping into the water and churning it. A plank dock juts out from the
mill, a small arched footbridge crosses the inlet, and a rowboat with a seated
angler drifts on the pond, rod and line out, the float making small rings.

The water is a real-time planar reflection (render-target mirror of the mill,
trees and sky) blended with screen-space refraction of the pond bed, a
depth-based tint from clear sandy shallows to a dark centre, a Fresnel term,
soft procedural wind ripples and dynamic spreading ripple rings from the
waterwheel, boat wake, fishing float, fish and your taps.

Everything is generated in code — no external models, textures or HDRIs. Three.js
is loaded (pinned) from jsDelivr via an import map; there is no build step.

## Run

Serve the folder over HTTP (ES modules need a server, `file://` will not work):

```bash
python3 -m http.server 8000
# then open http://localhost:8000/
```

## Controls

| Action | Input |
| --- | --- |
| Orbit | drag (mouse or one finger) |
| Zoom | scroll wheel or pinch |
| Make ripples | tap / click the water |
| Pause / resume auto-orbit | `Pause orbit` button, or `Space` |
| Switch time of day | `Time: Afternoon` / `Time: Golden hour` button, or `T` |

The camera also orbits the pond slowly on its own until you pause it. Dragging
temporarily holds the auto-orbit, which resumes a couple of seconds after you
let go. Touch input is fully supported (one finger orbit, two-finger pinch).

## Capture mode

Open `index.html?capture=1`:

- all UI is hidden (title, hint, buttons, stats),
- input is disabled,
- a scripted 12-second camera move plays: a full slow revolution around the
  pond with a gentle rise/fall and push-in that is an exact loop — the camera
  ends precisely where it started (water, wheel, boat and foliage animations are
  also phase-locked to the 12-second loop), so the frame can be recorded and
  looped as a seamless clip.

Optional `?capture=1&t=SECONDS` freezes the scripted move at a given time
(handy for grabbing a still); it does not affect the normal capture playback.

## Performance notes

- Reflection and refraction render targets are scaled to the display and
  reduced on phones; shadow maps drop from 2048 to 1024 on small/touch devices.
- Geometry is merged and instanced (trees, reeds, grass, rocks, lily pads,
  leaves) to keep draw calls low; the target is 60 fps on a laptop and 30 fps on
  a mid-range phone.
- Add `?stats=1` to the URL to show a small fps / draw-call readout, and
  `?mobile=1` to force the reduced-quality path when testing on a desktop.
