Saul Bass geometric paper-cutout credits
I wanted to know if one ElementGL WebGL 2 canvas can take live HTML title credits and chop, slide and mask them across Saul Bass geometric construction-paper cutouts, diagonal knife shutters and fibrous paper grain while keeping the inputs editable and the act pills clickable. Switch cutout motifs, edit the title or director, or tap the paper stage to wipe between acts.
Show the code cutout fragment shader, paint-gated upload, hit-test geometry sync and 2D clip-path fallback
- Live credits slate inside one drawable canvas. The act pills, condensed display title and editable
TitleandDirectorinputs sit inside<canvas content="drawable" layoutsubtree>. - Saul Bass geometric paper cutout shader. Samples the premultiplied DOM texture over crossed paper fibres and deckled edges across three cutout modes: diagonal knife shutters, staggered segmented blocks and a concentric spiral iris.
- Paint-gated upload after
stage.begin(). Uploads only afterhasPaintedbecomestrueinside thepaintlistener, callingstage.begin()beforestage.upload()withUNPACK_PREMULTIPLY_ALPHA_WEBGLturned on. - Aligned hit testing across tilted paper. Multiplies the slate
DOMMatrixbygeometryUnit(), callsupdateElementGeometry()and togglesdataset.hitTickso clicks and focus land on the drawn pills and inputs. - Five-argument 2D clip-path and plain-HTML fallbacks. Clips 5-argument
drawElementImage()through Canvas 2D cutout paths when WebGL 2 is missing, or moves the slate into plain HTML if a context is lost.
How it works
A single <section id="credits-slate" drawable> sits inside <canvas content="drawable" layoutsubtree>. I chose one WebGL 2 context through ElementGL so the entire 1950s paper stage, cast drop shadows and DOM texture composite in one pass without opening extra contexts. At context startup and in onRestored, the page sets gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true) so anti-aliased type blends cleanly over off-white construction paper.
Texture uploads never run outside a real browser paint. The paint listener sets hasPainted = true, calls stage.begin() to size the backing store first, and only runs stage.upload(slateEl) when the slate changed or hasn't uploaded yet. Scrubbing Cutout wipe % or spinning the spiral iris updates shader uniforms alone with zero re-uploads.
BASS_FRAG builds three cutout compositions on top of crossed paper-fibre noise, ink flecks and scissor-cut deckled edges. Shutters slices opposing diagonal knife blades across 54 px bands with cast shadows onto the slate below. Segmented blocks splits the slate into six asymmetric horizontal strips that snap cleanly into alignment when you hover, tap or focus an input, then fracture again across acts. Spiral iris frames the readable title inside an off-centre rotating aperture surrounded by alternating charcoal and terracotta spiral turns.
When Segmented blocks is aligned or Shutters tilts the slate by -1.4 deg, syncSlateGeometry() multiplies the CSS transform matrix by geometryUnit(), calls canvas.updateElementGeometry() and flips dataset.hitTick to clear Chromium's hit-test cache. If WebGL 2 isn't available, the 2D fallback builds matching Path2D cutout clips and calls 5-argument drawElementImage(); if the context is lost, the slate moves into #plain-host as readable HTML.
Live checks
These checks run on isolated fixtures on the test stage without scrolling or touching the demo above. Tap the button below to run them in this browser.
Findings
- Measured in headless Chrome 160.0.8188.0 canary on 2026-11-27 at 412 px wide and device scale factor 2.625: all 6 live checks passed with zero console or page errors. The backing store measured 924 by 1202 px (1.11 MP, 10.5 MB total canvas memory), with zero horizontal overflow (
scrollWidth412 px). - Setting
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true)atElementGLstartup, inonRestoredand on every fixture letstexElementSubImage2D()composite anti-aliased DOM ink over textured off-white paper without premultiplication halos. - Gating
stage.upload(slateEl)onhasPainted = trueinside thepaintlistener and callingstage.begin()beforestage.upload()sizes the canvas past the 300 by 150 px default before upload and avoids redundant uploads while scrubbingCutout wipe %or spinning the spiral iris. - Measured diagonal shutter masking via
readPixels()in Shutters mode: at0%wipe the band-0 centre read[244,235,217,255](DOM paper), and at55%wipe the cut centre dropped to[25,23,22,255](charcoal blade) while the adjacent open band stayed at[244,235,217,255](212 luma delta). - Measured tilted hit testing at
-0.024 radwithgeometryUnit()anddataset.hitTick:elementsFromPoint()hit both the fixture button and input, and a real pointer click on the tiltedAct IIpill switched to Reel 02 while typing inTitleupdated the condensed title toVERTIGO IN CHROME. - With
texElementSubImage2D()removed, the stage fell back to 5-argumentdrawElementImage()with Canvas 2Dclip()cutout paths; with--disable-blink-features=CanvasDrawElement, the slate moved into#plain-hostas plain HTML. - Not verified yet: headless Chromium 157 (
npm run check:jank -- /bass-cutouts/andtools/draw-size/audit.mjs) and live touch, typing and frame rate on Chrome 159 for Android at 412 px wide.