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.
The elevation data comes from the ArcticDEM mosaic with SRTM30 as a base layer to fill in gaps in ArcticDEM coverage. Satellite imagery is from Copernicus Sentinel-2. Peak locations are sourced from OpenStreetMap. The tile pipeline uses STAC APIs for data discovery, GDAL for reprojection, and rio-tiler for slicing and mosaicking Cloud-Optimized GeoTIFFs into map tiles. The route shown is the standard West Buttress route, traced from Jack Kuenzle’s 2023 FKT.
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 |