Adding a few more shader examples

This commit is contained in:
codeanticode
2012-09-03 01:31:49 +00:00
parent d09d1d461f
commit 7709d70d47
10 changed files with 526 additions and 0 deletions
@@ -0,0 +1,19 @@
PImage tex;
PShader deform;
void setup() {
size(512, 384, P2D);
textureWrap(REPEAT);
tex = loadImage("tex1.jpg");
deform = loadShader("deform.glsl");
deform.set("resolution", float(width), float(height));
}
void draw() {
deform.set("time", millis() / 1000.0);
deform.set("mouse", float(mouseX), float(mouseY));
shader(deform);
image(tex, 0, 0, width, height);
}