Usage

Once FIP has been added to your libraries, to use an effect you:

  1. Import FIP
  2. Specify in size() the P2D or P3D renderer, but not the default renderer (Why?).
  3. Load the shader you want, using loadShader()1.
  4. Call filter(), passing in the shader name.
import fip.*; // Import the FIP library

PShader glitch;
PImage ireland;

void setup() {
    size(1000, 1000, P3D); // Set up the canvas with a renderer (P3D in this case)

    glitch = loadShader(FIP.glitch); // Load the glitch shader

    ireland = loadImage("ireland.jpg");
}

void draw() {
    image(ireland, 0, 0, width, height);

    filter(glitch); // Apply the glitch shader
}
Image with no effects
Image with glitch effect applied

  1. The shader names are in camelCase, e.g.: FIP.sobelEdgeDetection