Gooey ink typography over live headings
I wanted to test whether a single ElementGL fragment shader can sample live DOM glyph alpha in a radial Gaussian kernel and fuse spring-driven ink droplets with an editable heading at a sharp threshold, without splitting text into a second hidden copy. Move across the words, click a letter to edit the heading, or switch ink below.
Starting ElementGL ink shader...
Show the code transparent drawable card, radial Gaussian metaball shader and hit sync
- Editable heading inside a transparent drawable card. Setting
background: transparenton#type-cardturnsuTex.ainto an exact mask of glyphs and button strokes. - Single-pass radial metaball shader. Evaluates a 17-tap two-ring Gaussian kernel on
uTex.anear the cursor droplet and its trailing drops, then cuts at an anti-aliased threshold. - Pointer spring physics and hit-box calibration. Syncs
updateElementGeometry()scaled bygeometryUnit()so editing#ink-headingand tapping ink buttons work natively.
How it works
This experiment rebuilds Dwayne's Gooey Title (Memorables) with HTML-in-canvas.
Instead of rendering text twice in separate DOM layers to survive a CSS blur and contrast filter, the heading and its buttons stay in one <article drawable> element with a transparent background.
In WebGL 2, ElementGL uploads the card with gl.texElementSubImage2D() whenever typing, button presses or resizing triggers a paint event.
Near the spring-tracked pointer droplet and four trailing micro-drops, the fragment shader evaluates a 17-tap radial Gaussian blur over uTex.a, adds the pointer droplet field and passes the combined density through an anti-aliased smoothstep cut over warm paper.
Away from the cursor, letters render unblurred straight from uTex, while syncCardGeometry() keeps the editable heading and ink buttons aligned for mouse, touch and keyboard focus.
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
- Measured in Chrome Canary
161.0.8200.0on 2026-12-04 at412x915(DPR2.625, SwiftShader WebGL): all 7 live checks passed with zero JS errors, zero lost contexts, zero open snapshots and zero horizontal overflow on a924x1087canvas (7.7 MB). - Uploading the transparent DOM typography texture (
630x420) through one 25-tap Gaussian metaball pass fused ink droplets into letters, dropping gap pixel luminance from248(apart) to26(fused bridge). - Live editing inserted
46dark glyph samples intox=86..146px(from0before edit), both editable heading and buttons received hits cleanly, and reduced motion drew statically withgl.getError()=0. - Blink does not stretch an
inset: 0child of<canvas layoutsubtree>to the canvas height, so at1280x900the card laid out at464x290inside a558x414canvas and the buttons were hit-tested above where they were drawn. Sizing the card fromcanvas.clientWidthandcanvas.clientHeightthrough--card-wand--card-hfixed it: the card now measures558x360on desktop (I trimmed the wide-screen canvas so the full-height card has no empty band above the chips) and352x414at412x915, and the heading, ink chips and Reset word hit at their drawn centres with0pxvertical drift.