tvOS multi-layer parallax poster

I wanted to know if one ElementGL WebGL 2 canvas could tilt three separate drawable HTML layers as a tvOS poster card, cast soft parallax shadows between them, sweep a glossy squircle sheen across the face and keep tilted controls clickable with updateElementGeometry().

4K DOLBY VISION PG-13 2h 14m
ORIGINAL FEATURE SERIES 01
READY TO STREAM

Directed by Elena Vance · Sci-Fi

starting...

Hover or drag across the poster to pivot the three layers and sweep the diagonal gloss sheen. Edit the film title directly on the foreground plane, tap Play trailer or + Watchlist while tilted, and adjust Split layers from 0 px flush to 40 px exploded depth.

Show the code 3-layer markup, 3D uMvp projection, inter-layer shadow shader, ElementGL uploads and 2D fallback
  1. Three independent drawable poster layers. Background artwork (depth 0), midground emblem and pills (depth 1), and foreground editable title and action buttons (depth 2) live inside one <canvas content="drawable" layoutsubtree>.
  2. Per-layer 3D perspective uMvp and hit-test matrix. Maps each layer at z = k * splitWorld through shared yaw/pitch rotation and camera projection, returning both clip-space uMvp and projective DOMMatrix.
  3. Squircle mask, inter-layer shadows and diagonal specular sheen. Clips corners to a continuous squircle SDF, samples blurred upper-layer alpha opposite the pointer light, and sweeps a glossy specular highlight across the card.
  4. Single ElementGL context, premultiplied uploads and geometry sync. Sets UNPACK_PREMULTIPLY_ALPHA_WEBGL = true, gates uploads on hasPainted inside paint, calls stage.begin() before stage.upload(), and updates updateElementGeometry() scaled by geometryUnit().
  5. Five-argument drawElementImage() 2D fallback and plain-HTML rescue. Renders affine parallax layers with 2D cast shadows when WebGL 2 is absent, and moves the three layers into #plain-host on context loss.

How it works

Live checks

Each check builds its own isolated fixture on testStage() and retires its canvas when finished, leaving the poster above untouched.

ResultExperimentDetail

Findings

Measured in headless Google Chrome 160.0.8188.0 canary on 2026-11-27 at 412 px and 2.625 DPR (SwiftShader WebGL). Chrome 159 on Android and npm run check:jank stay not verified.