mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Updated shader examples on desktop
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// This example shows how to change the default fragment shader used
|
||||
// in P3D to render textures, by a custom one that applies a simple
|
||||
// in P2D to render textures, by a custom one that applies a simple
|
||||
// edge detection filter.
|
||||
//
|
||||
// Press any key to switch between the custom and the default shader.
|
||||
// Press the mouse to switch between the custom and the default shader.
|
||||
|
||||
PImage img;
|
||||
PShader shader;
|
||||
@@ -10,7 +10,7 @@ PGraphicsOpenGL pg;
|
||||
boolean customShader;
|
||||
|
||||
void setup() {
|
||||
size(400, 400, P3D);
|
||||
size(400, 400, P2D);
|
||||
img = loadImage("berlin-1.jpg");
|
||||
|
||||
pg = (PGraphicsOpenGL)g;
|
||||
@@ -23,7 +23,7 @@ public void draw() {
|
||||
image(img, 0, 0, width, height);
|
||||
}
|
||||
|
||||
public void keyPressed() {
|
||||
public void mousePressed() {
|
||||
if (customShader) {
|
||||
pg.defaultShader(TEXTURE_SHADER);
|
||||
customShader = false;
|
||||
|
||||
Reference in New Issue
Block a user