Tactile press dent and damped elastic shockwave pad

I wanted to know if one ElementGL canvas can dent a live 3×2 HTML pad under pointerdown and release damped concentric shockwaves across neighbouring tiles while every control stays clickable. Hold a tile to dent it, release to ripple, or switch to flat CSS press.

PAD MATRIX · MK II 6-ZONE ELASTIC
000 HITS 0/4 RINGS
starting...

Show the code Drawable pad markup, deterministic tMs wave solver, dent and shockwave shader, upload and fallbacks
  1. Live 3×2 pad inside one drawable canvas. #ti-pad holds six tactile button and switch tiles, live increment readouts and a selectable <input id="ti-label"> inside <canvas id="ti-canvas" content="drawable" layoutsubtree>.
  2. Deterministic dent and 4-ring wave solver plus hit-box sync. stepImpactWaves() evaluates press compression and up to four concurrent damped wave rings at timestamp tMs, and syncPadGeometry() aligns hit boxes via geometryUnit() and updateElementGeometry().
  3. Press dent and concentric shockwave fragment shader. IMPACT_FRAG bends nearby pixels inward around uPressPos with cavity darkening and a raised rim highlight, then integrates up to four propagating sin(r*k - w*t) * exp(-decay*r - timeDecay*t) rings with finite-difference surface normals.
  4. Premultiplied uploads, 5-argument 2D fallback and context recovery. Turns on UNPACK_PREMULTIPLY_ALPHA_WEBGL = true on creation and restore, gates stage.upload() behind hasPainted and stage.begin(), and falls back to 2D ring overlays or #plain-host.

How it works

The entire control surface sits inside one <canvas id="ti-canvas" content="drawable" layoutsubtree> managed by a single ElementGL WebGL 2 context from /lib/element-gl.js. Both at creation and inside onRestored, the page turns on gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true) so keycap bevels, counters and input borders stay crisp without dark fringes. Uploads stay gated behind hasPainted inside the paint handler, and stage.begin() sizes the backing store before stage.upload() transfers #ti-pad via texElementSubImage2D().

Pressing down on any tile or pad gap stores an active press origin and ramps uDentDepth smoothly over 80 ms. In IMPACT_FRAG, the depression forms a Gaussian bowl with a subtle outer rim lip: pixels around the press pull gently inward toward the fingertip while finite-difference surface normals darken the concave centre and add a specular highlight along the rim. On release (or when you press Drop pulse), stored dent energy converts into an entry in a four-ring buffer evaluated at timestamp tMs by stepImpactWaves(). Each active ring evaluates -sin(r*k - w*t) * exp(-r*rDecay - t*tDecay) behind a causal wave front at speed * t, pushing neighbouring HTML tiles radially outward on crests and catching Blinn-Phong highlights along tilted slopes until exponential decay drops amplitude to zero.

Every button, switch and input inside #ti-pad remains clickable because syncPadGeometry() calibrates CSS-to-canvas scale with geometryUnit(), applies updateElementGeometry() and toggles data-hit-tick to flush Chromium's hit-test cache. Pointer tracking avoids calling setPointerCapture() on interactive buttons and inputs, and a selectstart guard stops drag selection across the pad while leaving user-select: text enabled on #ti-label. Animation frames pause when the stage scrolls off screen (IntersectionObserver), when document.hidden is true, when Flat CSS press or Reduced motion is active, and whenever all rings finish decaying. When WebGL 2 isn't available or ?route=2d is set, a 5-argument drawElementImage() pass draws the pad with a 2D concentric ring overlay; on webglcontextlost, ?route=plain or missing API support, #ti-pad moves into #plain-host as plain HTML.

Live checks

These checks run on isolated fixtures inside testStage() and wait for a tap so loading the page allocates one WebGL context and moves nothing on screen.

StatusCheckDetail

Findings