Usage
Once FIP has been added to your libraries, to use an effect you:
- Import FIP
- Specify in
size()
the P2D or P3D renderer, but not the default renderer (Why?). - Load the shader you want, using
loadShader()
1. - 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
}
-
The shader names are in camelCase, e.g.: FIP.sobelEdgeDetection ↩