LATENT
a film physics engine that runs in your browser
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.

Phase 2 · Five GL Passes
- 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.
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.

