A year of sunlight over a real hillside, computed in your tab
Annual sun hours for every one of 455k terrain cells at 63.44° N. One WGSL pass marches 32 azimuths per cell to build a horizon map — the terrain's own skyline, packed to a byte per direction — and a second pass sums the daylight that clears it, for ~1 300 sun positions across the year. After that, shadowing is a lookup, not a ray: the sun sweeping the slope below runs the same horizon test per vertex at 60 fps. The result is read back once and 48 cells are recomputed in TypeScript from the same sun geometry; the CPU-check row is that comparison, printed live. Click any slope to read that cell's own skyline out of the map — the whole horizon in every direction, with no search radius and no ray cast, because the answer was already computed. The query time printed under the plot is measured, not quoted.
WebGPU not available in this browser
The horizon and sun-hour passes need a WebGPU-capable browser (Chrome/Edge 113+,
or Safari 18+). The WGSL source ships in the bundle either way, so open
src/sun.ts to read it.
Plate 01 · horizon map + sun-hour integral · WGSL compute Drag to orbit · click a slope for its horizon · scroll to zoom · Terrarium z13 DEM, 3.5× vertical exaggeration · solar time, no atmospheric refraction · horizon quantized to 0.35°
Happy to walk through any of it.
Also built: embedded systems, moving-map engines, production Rust against Norwegian national geodata, and a live product of my own at solrapport.no.
bjreppen@gmail.com