Stoatworks Labs

gaffer

Depth of field with a rig that rings, for Resolume

Releasedv0.1.5Plugin & ModuleC++ / GLSL
gaffer — Depth of field with a rig that rings, for Resolume
The browser demo, not the plugin: gaffer's own GLSL ported to WebGL2 and running on a generated scene in the page — the same parameters and the same maths as the FFGL build, with the lens, depth and rig controls it declares on the right. Not a Resolume capture.

What it does

A lens gathers light through an opening, and a point that isn't on the focal plane arrives as a disc the shape of that opening. That's why an out-of-focus highlight behind a real camera is a circle, or a hexagon, rather than a soft grey smudge, and it's why depth of field is more than a blur. This builds the disc, so bright highlights bloom into the shape of the iris instead of dissolving.

Two things then move the focus, and both are models of a physical object rather than an envelope follower. The rattle is the one worth explaining: a camera in front of a loud PA shakes the way cameras shake, whatever the music's doing. The pressure hits an assembly with its own mass and stiffness, which answers at its own frequency and carries on answering after the hit's gone. So the rig here is four damped oscillators, one per axis, driven by the arrival of the bass rather than its level: a kick rings it, a drone doesn't move it. The lens elements are part of the same assembly, so the frame moves and the focus comes off together.

The rack is a focus puller with two marks taped on the barrel. Follow turns the Focus control into a place you're pointing at and lets the hand take its time getting there, so animating focus in the host lags the way a real pull does. Pull racks between the two marks on a cue: a bar line, a button, or the kick. Sweep never stops, hunting slowly or polling through every plane in the picture several times a second. Stutter puts a new plane on every cue, which turns focus into a rhythm part rather than a camera move.

The depth itself comes from one of five places, and they're five different things rather than five settings of one. Radial makes a field up and works on any clip at all. Luma and Alpha read one out of the picture's own channels. Split H and Split V read it out of the other half of a double-width or double-height frame, the only one of the five that can carry a proper, independent depth pass at full resolution.

  • A real aperture rather than a blur: out-of-focus highlights bloom into the shape of the iris, with a blade count that is measurable in the result
  • A camera rig of four damped oscillators driven by the arrival of the bass, so a kick rings it and a drone does not move it — and the focus comes off as the frame moves, because they are one assembly
  • A focus puller with two marks and four behaviours — Follow, Pull, Sweep and Stutter — cued from the bar line, a button, or the kick drum
  • Five sources of depth, including Split H and Split V, which carry a real independent depth pass at full resolution
  • Ships for Resolume on macOS and Windows, and for Resolve, Nuke, Natron and Vegas on macOS, Windows and Linux

Where it stands

Released at v0.1.5. The last two point releases changed nothing in the Resolume picture: v0.1.4 renamed it SW Gaffer in Resolume's browser, and v0.1.5 fixed the OpenFX build on Resolve's Fusion page, where every render used to fail. The lens is checked numerically against an independent C++ implementation of the circle of confusion across 48 parameter combinations, in x and y separately, and the light it neither creates nor destroys measures 1.0000 of the pinhole. The bokeh is measured too: at 5, 6, 8 and 9 blades the matching rotational harmonic is the strongest one there and well clear of the biggest unrelated one. The focus puller and the rig are checked directly over tens of thousands of frames, both nulls are exact to the byte, and all 30 controls measurably change the output. It's never been loaded into Resolume, the only OpenFX host it's rendered in is Resolve's Fusion page (Resolve Studio 21.1, macOS), no audio has ever reached it, and no Windows build has been run, only compiled. Running in a host and passing a harness are different claims, and the numbers above are only the second kind. Try it in your own rig before you trust it in a show.

Watch it running

gaffer video thumbnail

Nothing loads from YouTube until you press play.Watch it there instead