Denali Terrain
This notebook implements an interactive 3D terrain viewer from scratch using WebGPU. It renders elevation data for the Denali region of Alaska, composited with satellite imagery and OpenStreetMap feature labels.
Elevation data is served by Mapterhorn, which aggregates over 150 open elevation datasets — see mapterhorn.com/attribution for the full list of sources. Satellite imagery is the Sentinel-2 cloudless mosaic by EOX. Peak locations are sourced from OpenStreetMap. The route shown is the standard West Buttress route, traced from Jack Kuenzle’s 2023 FKT. (This notebook originally used self-scraped and self-tiled elevation and imagery data covering only the Denali region, built with STAC, GDAL, and rio-tiler, before I discovered open tile services covering the entire globe.)
The renderer implements terrain mesh rendering, imagery compositing, basic GeoJSON features (no vector tiles!), and single-scattering atmospheric fog. The atmosphere uses Rayleigh and Mie scattering, inspired by wwwtyro/glsl-atmosphere and GPU Gems 2, Chapter 16.
I mean, let’s be clear. This is a totally half-baked one-off ad hoc renderer. It uses way too much data for the (remarkably!) high resolution terrain. At the top of my list is to lower the terrain resolution and precompute the hillshading, rather than relying on full-resolution terrain for the shading.
| Input | Action |
|---|---|
| Drag | Pan |
| ⌘+Drag / Right-drag | Orbit |
| Ctrl+Drag | Pivot (look around) |
| ⌥+Drag | Zoom |
| Shift+Drag | Pan (camera plane) |
| Scroll | Zoom |