Zoom-blur tunnel NLE transition

I wanted to know if one ElementGL WebGL 2 canvas can drive a radial zoom-blur NLE transition between two live HTML scenes anchored at any focal point (fx, fy), while keeping buttons and text inputs hit-testable at both settled ends. Drag the reticle anywhere on the stage, tap Punch in or Pull back, toggle Auto loop or scrub Transition from 0% to 100%.

Editorial Shot A 01:14:08:12 · 24 FPS

Morning print edition

Daylight key plate at 1:1 scale. Drag the reticle to shift the radial blur centre or trigger Punch in.

EXPOSURE+1.3 EV
STOCK5600K DAY
MARKERS01 LOG
starting...

Show the code Dual-scene ElementGL upload, radial zoom-blur GLSL shader and hit-test geometry
  1. Two live HTML views inside one canvas. Editorial Shot A and Night Deck Shot B sit as sibling drawable sections inside <canvas content="drawable" layoutsubtree>.
  2. Hyperbolic scale curves, timestamp easing and hit-box swapping. Calculates tunnel scale, barrel warp, radial blur strength and toggles inert plus updateElementGeometry() at 0% and 100%.
  3. 16-tap radial zoom-blur and warm/cool chromatic dispersion. Samples 16 radial taps along (vUv - uFocal) with R/B channel offset and mirrored edge decay.
  4. hasPainted gate, premultiplied alpha and fallbacks. Sets UNPACK_PREMULTIPLY_ALPHA_WEBGL = true, calls stage.begin() before stage.upload() inside paint, and falls back to 5-argument drawElementImage() or plain HTML.

How it works

Both HTML scenes live inside one <canvas content="drawable" layoutsubtree> backed by a single WebGL 2 context from new ElementGL(canvas, ...). On startup and after any context restore, the page sets gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true), waits for the canvas paint event before uploading either scene with stage.upload(), and calls stage.begin() before uploading so the backing store already matches device pixels.

Between 0% and 100%, the fragment shader measures each pixel's offset delta = vUv - uFocal from the draggable optical anchor (fx, fy). In Zoom in mode, View A magnifies hyperbolically with outward barrel distortion; in Pull out mode, View A shrinks rapidly into the focal point while mirrored tunnel borders fade into the vignette. Along delta, 16 weighted taps trail behind the radial velocity curve while shifting red outward and blue inward for warm and cool lens dispersion. Near 50% peak velocity, smoothstep cross-dissolves into View B zooming down from oversized tunnel magnification into crisp 1:1 alignment at 100%.

At 0% and 100%, the shader switches to a single crisp texture fetch so text never blurs at rest. syncSceneGeometry() uses geometryUnit() to place the settled view at 1:1 via canvas.updateElementGeometry(), flips dataset.hitTick to clear Chromium's hit-test cache, and marks the inactive or mid-warp scenes inert so taps never hit hidden controls. Under prefers-reduced-motion: reduce or the Reduced motion toggle, Auto loop pauses and Punch in / Pull back jump straight between endpoints. If WebGL 2 texElementSubImage2D() isn't available, the 2D fallback draws both scenes scaled around (fx, fy) using five-argument drawElementImage(); on context loss, both scenes move into #plain-host.

Live checks

These checks run on isolated fixtures inside testStage() and wait for a tap so opening the page doesn't allocate extra WebGL contexts or move focus.

StatusCheckDetail

Findings