Stoatworks Labs

Stencil

Spray paint through a cut stencil, for Resolume

Betav0.1.0Plugin & ModuleC++ / GLSL
Stencil — Spray paint through a cut stencil, for Resolume
Stencil

What it does

An FFGL effect for Resolume Arena and Avenue. The clip is cut into a stencil and paint is sprayed through it. A stencil is a sheet with holes in, and it can't hold a floating piece: the middle of an O, the counter of an A, or an island of light inside a shadow would just drop out. So whoever cuts it leaves bridges, thin strips of sheet that tie every island to the rest, and the plugin cuts them the same way.

The clip's tone is cut at one to four thresholds, and each layer's sheet is labelled into pieces on the CPU. Any piece that doesn't reach the edge of the frame is an island, and gets the shortest bridge there is from it to any other piece, found by a jump flood on the GPU that carries two seeds per texel: the nearest sheet, and the nearest sheet belonging to a different piece. An island bridged to another island is still floating, so it goes round again until nothing is. The paint is then the holes convolved with the disc of the nozzle's footprint, with some creep under the sheet and drips where it runs over.

What comes out is the look of a real stencil. Every enclosed shape is broken where its ring is thinnest, and rings inside rings are tied one to the next until everything hangs off the frame. The layers are sprayed lightest first, so n layers give n + 1 tones and a dark layer's bridge shows the paint underneath. The halo across every edge widens with Distance, with Lift up the bridges show as ghostly lines, and paint past saturation runs down in drips.

The Cut controls set the layers, the threshold, Invert (paint the light), a smoothing blur, the bridge width and the smallest island worth keeping. The Spray controls set the nozzle's distance, the pressure, the lift and the drips. The Paint controls pick the cans (five palettes, or each layer's own colour from the clip) and the wall: the clip, brick, concrete or plain.

  • No island of sheet floats, counted by a flood fill of the output itself
  • Every bridge exactly the shortest gap from its island to another piece, checked against brute force
  • One to four layers sprayed light to dark, each with its own bridges
  • The edge profile the chord fraction of the nozzle's disc, to one half-float ulp
  • Last frame's bridges kept while they stay within a texel of the shortest, so a still clip's bridges hold still
  • Invert, five palettes or the clip's own colours, and brick, concrete, plain or clip walls
  • Universal macOS bundle and a Windows x64 DLL

Where it stands

v0.1.0, and early days. It hasn't been loaded into Resolume on macOS yet. On Windows it has: a build loads, registers and renders in Resolume Arena 7.27.1 on software rendering (no GPU), with every parameter as declared and all 14 controls moving the picture. Everything else is measured by an offline harness driving the real plugin and reading every property back out of the picture: after bridging, a flood fill finds no piece of sheet cut off from the frame, on letters, rings nested four deep, squares in squares and random blobs; every bridge is the shortest gap from its island to another piece, checked against brute force; bridges are the stated width and stay 4-connected; the edge profile is the chord fraction of the nozzle's disc; n layers give n + 1 tones; and last frame's bridges survive a resize. It catches nine models broken on purpose, and all 14 controls change the picture. It's heavy for a VJ effect: about 9 to 22 ms a frame at 1080p on the demo clips at the defaults (two layers), and about half that with one. It makes one bridge per island per pass, always the shortest, so on moving footage the bridges it keeps hold still in the frame and then step. Filming found that a bright subject on transparency paints nothing unless Invert is on. The macOS build is signed and notarised. There's a user guide and a browser demo, whose CPU cutter is a JavaScript port that's only been checked by reading it, but no presets and no OpenFX port. Try it in your own rig before you trust it in a show.

Watch it running

Stencil video thumbnail

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