ALI LIN
01Ali Lin Lab
2026

Latent

Latent is a film physics engine that runs in your browser. It models halation and grain the way film does.

The Latent calibration workbench: on the left a reference film scan of a tiled subway platform with orange halation blooming off the overhead light, in the centre the engine OUTPUT panel rendering the same kind of scene, and at the right edge the halation control panel, of which only the parameter names are in frame.

Problem

AI generated video has film looks, not film physics. That's why it looks fake.

Solution

Latent models the film optics instead.

Methods

Use 5 GLSL passes to resemble the actual film physics. Calibrated against film I shot and scanned myself.

Next Step

More calibrations by different film stocks.

01/05
← IndexAli Lin

LATENT

a film physics engine that runs in your browser

film physics engineWebGL2 / GLSL / WebCodecs2026shipped July 2026

the engine running, 19.5s · click to play
open live ↗

WHAT

A film physics engine that gives AI video real halation and grain, running in a browser tab.

WHO

AI artists who want film quality. Prompting "35mm CineStill 800T" does not produce it.

WHY

A LUT maps one pixel value to another and cannot see the pixel next to it. Halation is entirely about the neighbourhood.

Plugins like Dehancer model it properly, but they sit outside the browser and break the generation loop. Latent runs in the tab you are already in.

HOW

Five GL passes on WebGL2, on your GPU, in a browser tab. Their order is where each step happens on real film.

Phase 1 · The physical mechanism

CineStill 800T halates red because the remjet backing is gone and the red sensitive layer sits closest to the film base.

halation on a clipped highlight, engine output against the negative it was calibrated to
EXHIBIT 01 · halation measured off my own 800T negatives, not fitted to a curve
Phase 2 · Five GL Passes
54321
  • 1ThresholdMasks highlights with a smoothstep on gamma-space luma, so the threshold tracks perceived brightness.
  • 2BlurFive texture fetches per direction, run horizontally then vertically as a separable gaussian.
  • 3CompositeScreen blends the tinted glow over the base in linear light, adding energy without hard clipping.
  • 4Color ResponseApplies the stock's dye-layer crosstalk matrix, then its characteristic curve.
  • 5GrainGranularity rises with developed density and saturates, seeded by a pcg3d integer hash.
the five passes in order, first to last · hover a row to isolate its plane in the stack

CALIBRATION

I shot and scanned 800T myself and matched the engine to the negatives: threshold 0.55, radius 4.9, tint 1.2 / 0.03 / 0.03. Green and blue near zero, so the halo is almost pure red, not the warm orange most filters give you.

Above a 9.8 radius cap three settings produced the same image, and my eye could not tell them apart. A dark field R minus B metric caught it.

calibration date 2026-07-10, stored with the source data

the calibration workbench · reference scan on the left, engine output on the right, the parameter panel on the right edge
the workbench · the panel reads threshold 0.55, radius 4.90, intensity 1.01, tint 1.20 / 0.03 / 0.03

Ali Lin