# Komorebi — a tiny afternoon

A small floating diorama in an anime style, rendered with Three.js. A schoolgirl holds a cold can next to a glowing vending machine on a quiet residential corner. Afternoon sunlight comes through a tree's leaves and leaves moving spots of light on the pavement (komorebi). There are hydrangeas, sunflowers, wildflowers, a sleeping cat on the wall, butterflies, dust motes and light shafts.

Everything is built in code from primitives and canvas-drawn textures. There are no model or image files.

## Running

Open `index.html` in a browser. It works straight from disk (`file://`), so you don't need a server, a build step or a network connection. You can also serve the folder if you like:

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

## Controls

| Input | Action |
|---|---|
| Left-drag | Orbit the camera |
| Scroll / pinch | Zoom in and out |
| Right-drag (or two-finger drag) | Pan |
| `Space` | Pause or resume the slow automatic orbit |
| `R` | Reset the view |
| `H` | Show or hide the title and hint text |
| `F` | Show or hide the FPS and draw-call counter |

The camera orbits slowly on its own. When you drag, the auto-orbit stops, and it starts again about 5 seconds after you let go (unless you paused it with `Space`).

## Notes

- **Files:** `index.html` contains the whole scene. `lib/` holds a local copy of Three.js r170 and its OrbitControls, converted to plain scripts so the page also runs from `file://`.
- **Shading:** toon (cel) materials use a stepped light ramp, and characters and props get ink outlines (inverted hull). The leaf shadows are real shadow-mapped shadows: the shadow pass skips a hashed subset of leaf cards so sunlight gets through in spots.
- **Animation:**
  - A shared GPU wind function moves the leaves, grass, flowers and hydrangeas.
  - The girl breathes, shifts her weight with IK-planted feet, looks around, blinks, and her hair and skirt sway.
  - The vending machine hums with a fluorescent flicker and stutters every ~9 s.
- **Performance:** about 200 draw calls and about 120k triangles. If the frame rate stays under ~45 fps, the page lowers its render resolution automatically.
