Loading Spectra Studios
Spectra Studios

Case study
Transparent video on the web

Path-traced glass
One 1.58 MB MP4

Forged in light,
shaped in glass.

A path-traced glass object, playing on the page with a real transparent background, in every browser, from a single ordinary MP4. Here's why it had to be video, and how it works.

Scroll

01 Why not render it live?

The material is
path-traced.

The orb is a Blender Cycles material. Its sparkle comes from a trick that only works when light is simulated, not rasterized.

  • Random IOR per sample. White noise drives the refraction index between 1.4 and 1.5. Every light sample bends a little differently, and hundreds of samples average into that crystalline glitter.
  • Faked dispersion. The same noise feeds a rainbow ramp into the refraction color, so light appears to split.
  • Real light paths. Rays enter the sphere, bounce inside it, exit through the spines and refract the object itself.

WebGL rasterizes. Its glass is one screen-space refraction of a blurred backdrop: no internal bounces, no glass seeing glass. At one sample per pixel per frame, the random IOR becomes flickering static. Browser path tracers exist, but they converge over seconds, standing still, on a desktop GPU. Not at 60 fps while bouncing on a phone.

Blender shader node graph: white noise through RGB curves and map range drives the IOR of a Refraction BSDF; a rainbow color ramp drives its color; a Fresnel node mixes it with a Multiscatter GGX glossy shader whose roughness and bump come from magic and noise textures.
The Cycles node graph. Noise → IOR is the part no real-time renderer reproduces. Open full size

02 Why not an image sequence?

Same 90 frames.
92× lighter.

PNG keeps transparency everywhere, which is why scroll-driven image sequences are the usual fallback. But every frame is a full lossless image, downloaded and decoded on its own. Compressing the frames to WebP cuts that to 22.6 MB, still 14× heavier than the video.

One PNG frame
1.62 MB
bigger than the entire video
Files to request
90 → 1
one HTTP request, streamed
At 20 Mbit/s
58 s / 9.0 s → 0.6 s
time to download, no overhead
Download size, same 3 s animation
PNG sequence 90 × 1080², RGBA145.8 MB
WebP sequence 90 × 1080², RGBA22.6 MB
Stacked-alpha MP4 1 × 1080×2160, H.2641.58 MB

Linear scale. Measured from this project's files: EXPORT/0001–0090.png vs glass-stack.mp4.

03 Why not a video with alpha?

No single format
works everywhere.

Transparent video exists, but each browser family wants a different file, and one of them can only be made on a Mac. The standard method serves both from one <video> tag, HEVC listed first: Safari takes it, everyone else falls through to the WebM.

BrowserFormat with alphaThe catch
Chrome, Firefox, EdgeWebM, VP9 with alphaFine: Premiere's WebM export has an Include Alpha box
Safari (macOS, iOS)HEVC with alpha (.mov)Safari plays VP9, but not VP9 with transparency
  • HEVC with alpha is an Apple extension. It can only be encoded on macOS (Compressor or Apple's encoder).
  • Premiere Pro 2026's HEVC export has no alpha option, and Media Encoder doesn't export it on Mac or Windows.
  • No Mac was available. ProRes 4444 carries alpha, but it's a mastering format, not something to ship to a browser. An online ProRes-to-HEVC-alpha converter exists (Touchpix), but it wasn't tested.

The goal: a short looping render on its own layer between the background and the CTA, on every device, without falling back to a PNG sequence.

04 The workaround

Hide the alpha
in plain sight.

Stack color and transparency in one ordinary, double-height video, then rebuild it in the browser. The codec never has to know about alpha, so one file plays everywhere.

  1. Top half: colorThe render, composited over black.
  2. Bottom half: matteWhite is opaque, black is transparent.
  3. One MP4Plain H.264. Chrome, Firefox and Safari all decode it.
  4. One shaderWebGL reads RGB from the top, alpha from the bottom, and draws it on a canvas.
RGBAlpha
Live · the actual video

The file on this page

Frame
1080 × 2160
two 1080² halves
Codec
H.264
no alpha support needed
Timing
30 fps · 3 s
90 frames, looped
Size
1.58 MB
one request, streams as it plays

What the page needs

  1. A hidden <video> with autoplay, loop, muted, playsinline.
  2. A WebGL canvas: only a shader can apply the matte.
  3. Frame uploads: each new video frame becomes the texture.
  4. Layers: background, then the canvas, then the CTA.
  5. Click-through: pointer-events: none and a transparent canvas, so the CTA stays clickable.

The whole trick, in GLSL

// uv.y: 0 = top of the visible frame
vec3  rgb = texture2D(video, vec2(uv.x, uv.y * 0.5)).rgb;        // top half
float a   = texture2D(video, vec2(uv.x, 0.5 + uv.y * 0.5)).r;    // bottom half
gl_FragColor = vec4(min(rgb, vec3(a)), a);  // color was over black: already premultiplied

05 Building it in Premiere Pro 2026

Nine steps,
no plugins.

  1. SequenceOne custom sequence at double height, 30 fps, square pixels: 1080×2160 for this orb.
  2. NestRendered frames on V2, select all, Nest. The nest behaves like one clip.
  3. DuplicateAlt-drag the nest to V3. V3 is the color copy, V2 the matte copy.
  4. PositionScale stays 100. V3 centered in the top half, V2 in the bottom half (540, 540 and 540, 1620 at 1080×2160).
  5. White solidA pure white Color Matte on V1, full frame, same length as the footage.
  6. Track Matte KeyOn the solid: Matte = Video 2, Composite Using = Matte Alpha. Don't move the solid; it moves the matte.
  7. Keep V2 visibleHiding V2 removes the matte and turns the whole frame white.
  8. CheckColor on top, a white silhouette below. Transparent areas export as black: white on black, exactly the matte the shader needs.
  9. ExportH.264 .mp4, no alpha options. Then re-encode it for phones.

06 It broke on phones. Silently.

Worked on one iPhone.
Not on the next.

An earlier build of this technique played on desktop and on an iPhone 17 Pro Max, but not on an iPhone 17 Pro or a 14 Pro Max. No error on screen. Not the file size, not the connection (5G), not the chip: same-chip phones disagreed. Why one phone accepted it is still unknown.

The headers gave it away: Premiere had tagged the H.264 stream level 6.0, Main profile. Desktop browsers don't care. Phone hardware decoders can refuse a stream flagged that high.

Playing on a computer and one phone is not "plays everywhere." Test a second phone, and read the profile and level of what the editor exported.

On-device debug bar
video readyState=0 error=4 size=0x0

Error 4 = media source not supported. The decoder rejected the file; the page code was fine.

The fix: re-encode before upload

ffmpeg -i source.mp4 -an -c:v libx264 \
  -profile:v high -level 5.1 -pix_fmt yuv420p \
  -crf 20 -movflags +faststart out.mp4

High profile, 8-bit 4:2:0, level 4.1, or 5.1 for frames larger than 720×2560. After the re-encode it played on every phone tested, and the file got smaller too.

07 The bug that looked like broken alpha

The video was fine.
The background was gone.

Dropped into a production theme, the transparent video sat on solid black, which looked exactly like a failed matte. The shader was fine. The theme's base stylesheet had one rule:

div:empty { display: none; }  /* theme base.css */

The background layer was an empty <div>, so the theme hid it. With nothing behind it, the transparent canvas showed the black page. The standalone test page didn't load the theme's stylesheet, so it never showed up there.

  • Fix: display: block !important on the background layer. This page does the same, and never relies on an empty div.
  • Not the cause: crossorigin attributes, rAF vs. requestVideoFrameCallback, shader precision, console logging.

Result

One file. Every browser.
Real transparency.

Two lessons from getting it live: guard the background layer's display rule, and re-encode for phones. Everything you've scrolled past is that one MP4.

Path-traced in Blender Cycles · composited in Premiere Pro · rebuilt in WebGLStacked-alpha H.264 · WebGL

Let's build the brand, the packaging, and the site that actually sell your product.

Book a 15-minute call. We'll walk through where your brand stands today and what it needs to get to the next stage.

Let's build what's next

Notes on brand, design, and growth, straight to your inbox.