← Back

ofxPatches

github.com/paulobarcelos/ofxPatches · @paulobarcelos
OF 0.12 Utilities Shaders

ofxPatches is a visual patching system for openFrameworks that enables users to create and manage live image-processing pipelines using shader effects.

7 0 Last commit 4mo ago Created 14y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

develop 1 commit ahead · last commit 5y ago

README

ofxPatches



ofxPatches is a small visual patching system for openFrameworks. It lets you build a live image-processing pipeline out of shader effects, connect patch outputs to patch inputs, tweak parameters with ofxGui, and save the graph as XML so a sketch can come back exactly as you left it.

It was built as a practical tool for sketching interactive video systems: chroma keying, masks, feedback, thresholding, blurs, blends, and quick experiments where editing a graph is faster than recompiling a chain by hand.

Status



The addon is being refreshed for current openFrameworks after a long quiet stretch. The examples build and run on macOS with openFrameworks 0.12.1, but this is still a hands-on creative-coding tool rather than a polished node editor. Use the examples as working references and expect to spend a little time with the patch graph.

Features



Installation



Clone this addon into your openFrameworks addons folder:

cd /path/to/openFrameworks/addons
git clone https://github.com/paulobarcelos/ofxPatches.git


Install the external addon dependencies in the same folder:

git clone https://github.com/paulobarcelos/ofxFX.git
git clone https://github.com/paulobarcelos/ofxHomography.git


ofxGui and ofxXmlSettings ship with openFrameworks. For openFrameworks 0.12.1, use the Paulo Barcelos ofxFX fork above; it carries the small compatibility fix needed by the current examples.

In your project addons.make, include:

ofxFX
ofxGui
ofxHomography
ofxPatches
ofxXmlSettings


Examples



example-ChromaKey loads a saved graph that combines camera input and movie.mov through a mask and blend chain. It is the best place to see the patch UI and XML graph loading in action.

example-BackgroundSubtraction builds a camera-based background subtraction graph with accumulation, difference, morphology, blur, thresholding, and masking.

Both examples are capped at 30 fps and have individual patch previews disabled in the saved settings to keep the graph responsive on modest machines. Release builds are strongly recommended for manual patch editing.

cd example-ChromaKey
make Release
make RunRelease


Basic Use



The manager setup order matters:

manager.setup(numberOfSources);
manager.allocate(width, height);
OFX_PATCHES_REGISTER_ALL_EFFECTS(manager);
manager.loadSettings();


In update(), set the source textures and update the manager when there is a fresh frame:

if(cam.isFrameNew()){
    manager.setTexture(cam, 0);
    manager.update();
}


In draw(), draw the patch UI:

manager.drawGUI();


Use the manager's save/load buttons to persist the current patch graph.

Performance Notes



Each active patch owns FBOs and runs its shader passes when the manager updates. Dense graphs can be heavy, especially in Debug builds or under system memory pressure. If the UI feels sluggish, try a Release build, lower or disable patch preview scales, cap the app frame rate, and keep the patch graph in edit mode only while wiring.

Compatibility



Tested on June 1, 2026 with openFrameworks 0.12.1 on macOS. Earlier releases were tested with openFrameworks 0.11.2.

Current builds still produce warning noise from openFrameworks, utf8, and older ofxFX APIs on modern Clang. The warnings do not block the examples. On the current test machine, example-BackgroundSubtraction also logs one OpenGL sampler warning on launch and then continues running.

Version History



Version 1.3.0 (2026.06.01)



Version 1.2.0 (2021.05.19)



Version 1.0.1 (2021.05.19)



Version 1.0.0 (2021.05.19)



License



MIT. See license.md.

Get this addon

HTTPS
SSH