Topographic cursor-elevation card

I wanted to know if an ElementGL fragment shader can generate anti-aliased topographic isolines that swell into glowing peaks beneath the pointer and pinned summits while live <output> telemetry, sliders and radio controls stay sharp on top. Move across the card, tap Pin peak, or drag Ridge gain.

EMERALD · 1 pinned
TERRAIN VAULT · SECTOR 09 1,840 m
Mapped reserve $14,820.50

Move to raise a hill under the cursor, or tap open map space to pin up to 4 summits.

Starting ElementGL topographic contour shader...

Show the code central-difference isolines, transparent card composite and hit sync
  1. Transparent telemetry card over live terrain. Keeps <output> figures, a range input, biome radios and buttons directly inside the drawable canvas.
  2. Anti-aliased contour isolines and hillshade. Sums fBM terrain, a cursor Gaussian hill and up to four pinned peaks, evaluates screen-space gradient lines and composites premultiplied DOM controls on top.
  3. Geometry calibration and tap peak pinning. Uses geometryUnit() with updateElementGeometry() and updates <output> telemetry cleanly on taps without blocking controls.

How it works

This experiment combines Sunnie Kapar's Topographic Wallet Card and Nico Frey's Moving Mountains inside one ElementGL WebGL 2 canvas. Inside the canvas, #topo-card uses a transparent background so its premultiplied alpha mask isolates white type, the slider, radio chips and action buttons cleanly from the terrain behind them.

In the fragment shader, terrainHeight() combines two octaves of value noise, a spring-smoothed Gaussian mound following the pointer and up to four pinned peak coordinates passed in uPeaks. Central finite differences estimate height slope per pixel so major and minor isolines stay crisp without flickering on software or mobile GPUs, lighting elevated ridges with directional hillshade before compositing the uploaded DOM texture on top.

Live checks

These checks wait for a tap so the page keeps one WebGL context until requested. Each check runs inside its own isolated fixture on the test stage and retires its canvas afterwards.

Findings