mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Adding a few more shader examples
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user