Film-develop file upload shader

I wanted to know if an ElementGL fragment shader can apply a darkroom negative-to-print chemical wave strictly inside an uploaded <img> frame while leaving the surrounding <input type="file">, <select> and buttons sharp and clickable. Drop an image, choose a file, switch sample prints, or scrub the bath slider.

PORTRA 400 · READY
DARKROOM · FILM BATH 100% · PRINT
Samples

Starting darkroom ElementGL shader...

Show the code rect-restricted chemical shader, file upload and hit sync
  1. Darkroom upload form inside a drawable canvas. Keeps the preview <img>, hidden <input type="file">, film stock <select> and button in one semantic form.
  2. Rect-scoped negative-to-print shader. Tests normalized UV against uFrameUv so surrounding form controls pass through untouched while the photo goes from safelight negative through developer ripples to its chosen film stock.
  3. Measuring the photo box without transform drift. Walks untransformed layout offsets to compute uFrameUv and calibrates updateElementGeometry() with geometryUnit().

How it works

This experiment rebuilds Yanis Lebzar's Film Develop Upload (Memorables) using one ElementGL WebGL 2 context. Everything lives inside a real <form drawable>, with local SVG data URLs for the built-in samples and URL.createObjectURL() when you drop or pick a local file so pixels stay same-origin and readable by texElementSubImage2D().

Rather than running the darkroom shader across the whole card and blurring text labels, measureFrameUv() computes the normalised rectangle of #print-frame from its layout offsets and passes it as uFrameUv. Outside that rectangle, the fragment shader outputs crisp DOM pixels untouched. Inside uFrameUv, an animated value-noise chemical front sweeps upward, shifting inverted safelight-amber negative tones into warm Portra, monochrome Tri-X, Prussian-blue Cyanotype or punchy Velvia colour while syncCardGeometry() keeps the file picker, stock menu and button clickable.

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