Interactive WebGL globe rendered from Rust and compiled to WebAssembly.
- Three orbital bodies.
- Both sun and moon as light sources with appropriate math.
- Day night ground map switching.
- Water map vector overdrawn with drawable water texture.
- Cloud layers drawn at their real average altitudes provides a first pass on volumetric clouds along with Storms, Precipitation, and Fog.
This a baseline. You can pull higher quality localized assets and draw them over your home instead of trying to handle the entire globe all at once.
I've also been considering actual volumetric clouds.
- Drag with the mouse to rotate the globe.
- Use the mouse wheel to zoom in and out.
This project expects the standard browser WASM target and wasm-pack.
rustup target add wasm32-unknown-unknown
cargo install wasm-pack
wasm-pack build --target web
python -m http.server 8080Then open http://localhost:8080.
index.html loads the generated module from ./pkg/wasm_rust_globe.js.
The repo includes a build-smoke integration check that fails if either the Rust build or the wasm bundle is broken.
./tools/integration_build_check.shOr:
make testThe repo also includes a screenshot smoke test that builds the wasm bundle, serves the app locally, opens the real app URL in headless Chromium through Playwright, waits 2 seconds, and captures a globe screenshot.
./tools/smoke_globe_screenshot.shOr:
make screenshot-testBy default it targets http://127.0.0.1:8090/ and waits 2 seconds after page load before capture. If nothing is already serving there, it starts a temporary local server on that port. You can override the target with PORT=... or BASE_URL=....
Output:
tmp/globe-smoke.png
For repeated screenshot-driven iteration, the repo includes an archive/diff loop:
./tools/iterate_globe_screenshots.shOr:
make iterate-screenshotsIt captures multiple screenshots in sequence, writes per-shot JSON metrics, and saves diff images between successive shots under tmp/globe-iterations/<run-id>/.
The renderer currently uses baked image assets, so the first MERRA-2 integration step is a fetch-and-rasterize tool rather than live NetCDF loading.
tools/fetch_merra2_texture.py pulls daily MERRA-2 M2T1NXSLV.5.12.4 single-level diagnostics through the GES DISC OPeNDAP endpoint, derives near-surface relative humidity from QV2M, T2M, and PS, and writes renderer-ready PNGs into assets/.
Requirements:
python3numpyPillow- either
EARTHDATA_TOKENset, or a working~/.netrcfor Earthdata Login thatcurl --netrccan use
Example:
EARTHDATA_TOKEN=... python3 tools/fetch_merra2_texture.py --date 2026-04-01Outputs:
assets/merra2-near-surface-relative-humidity-2048.pngassets/merra2-2m-temperature-2048.pngassets/merra2-surface-pressure-2048.pngassets/merra2-2m-specific-humidity-2048.pngtmp/merra2-merra2-YYYY-MM-DD.json
tools/fetch_recent_cloud_texture.py pulls official cloud-analysis products and writes back the globe cloud textures.
Each fetch creates a unique pull ID and stores raw upstream files under tmp/cloud-products-raw/<pull-id>/.
The fetch stage now runs asynchronously and spawns concurrent curl child processes, printing progress lines as products are fetched and processed.
The fetcher now stores upstream telemetry provenance in tmp/cloud-products-<pull-id>.json, including:
- run start/end timestamps
- total run duration
- pull ID and pull mode
- requested remote fetch resolution
- raw on-disk upstream payload paths
- native upstream file dimensions
- per-product source URL
- per-product download timing and byte size
- per-product decode timing
- colormap fetch attempts used to decode numeric products
Example:
python3 tools/fetch_recent_cloud_texture.py --date 2026-04-01Reprocess an existing raw pull without refetching:
python3 tools/fetch_recent_cloud_texture.py --pull-id 2026-04-01-20260404T220000Z-deadbeefHighest-resolution fetch while keeping renderer assets at 4096x2048:
python3 tools/fetch_recent_cloud_texture.py --date 2026-04-01 --fetch-width 8192 --fetch-height 4096Output:
assets/cloud-combined-4096.jpgassets/cloud-visible-4096.jpgassets/cloud-confidence-4096.pngassets/cloud-top-height-4096.pngassets/cloud-optical-depth-4096.pngassets/cloud-low-4096.pngassets/cloud-medium-4096.pngassets/cloud-high-4096.pngassets/cloud-storms-4096.pngassets/cloud-precipitation-4096.pngassets/cloud-fog-4096.pngtmp/cloud-products-raw/<pull-id>/*.pngtmp/cloud-products-raw/<pull-id>/pull.jsontmp/cloud-products-<pull-id>.json
The renderer now consumes a packed cloud atlas instead of treating the cloud layer as a single grayscale mask.
tools/fetch_cloud_atlas.py builds assets/cloud-atlas-4096.png from the cloud products, precipitation, aerosol, and land/ocean context.
Channel layout:
R: coverageG: cloud typeB: cloud-top heightA: optical depth
Example:
python3 tools/fetch_cloud_atlas.py --date 2026-04-01Output:
assets/cloud-atlas-4096.pngtmp/cloud-atlas-YYYY-MM-DD.json
Recommended refresh order:
python3 tools/fetch_recent_cloud_texture.py --date 2026-04-01
python3 tools/fetch_cloud_atlas.py --date 2026-04-01
wasm-pack build --target web



