Building 106: sun and 25 years of climate on a real building (WebGPU + WebGL 2)

Building 106 is a digital model of a real building in Panama’s City of Knowledge, made for teaching sun and climate. The sun is comp

uted for every minute with the NOAA solar calculator algorithm, and the climate comes from hourly ERA5 data for 2001 to 2025, with temperature and humidity adjusted to the nearby Albrook airport.

It runs on three.js 0.186.1 with WebGPU and falls back to WebGL 2 on its own. The scene light follows the data: the sun and shade contrast is tied to that hour’s radiation, and while the scene draws rain it draws no direct sun. Eave shadows on the walls were checked against ray tracing, within 8 cm for sun altitudes between 14° and 42°. The city around it uses OpenStreetMap footprints, with 228 of its 322 buildings assembled from a kit of parts whose floors, roofs and colours were read from Street View as a visual reference, and there is a printed AR card that runs with MindAR.

I directed it; Claude wrote most of the code and Codex made adjustments. The interface is in Spanish.

Weather data by Open-Meteo.com (CC BY 4.0). Contains modified Copernicus Climate Change Service information (ERA5).

A follow-up on how we checked that the light in the scene is right, since a sun viewer is only useful if the numbers hold.

Sun on the walls vs Radiance. We rendered the same building in Radiance and compared the direct sun on each façade. On all four the viewer is within 2 percent of Radiance. One sample hour: southwest wall 522 vs 522 W/m², roof 558 vs 549. The total comes out 6 to 8 percent below Radiance, and we know why: Radiance’s Perez sky puts 16 to 21 percent more diffuse light on the walls than the Hay-Davies model we use. We left that gap visible instead of tuning it away.

Climate data vs a real sensor. The radiation comes from ERA5, so we compared it with the pyranometers on the Smithsonian (STRI) canopy crane, a few km away. Over 2,170 days ERA5 reads 8.8 percent high, with an hourly correlation of 0.889 and no time lag. The bias depends on the season: −2.5 percent in January and February, +7.6 percent in March and April, +14.1 percent from May to November, when the cloudy afternoons start.

Light and shade contrast. The sun to shade ratio in the scene is 8.04 against 7.92 in Radiance (1.5 percent). Under a very clear sky the scene runs about 9 percent more contrast, 11.05 vs 10.15.

Checking the checker. The verification script has controls that inject a deliberate error (a 35 percent bias, and a small time shift) and must fail. If those controls ever pass, the test itself is broken.

The building model was made from photos by Luis Miguel Caamaño and Raúl Alejandro González. The method notes are in the repo under docs/validacion (in Spanish).