Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 1a66011

Browse files
committed
added pde file
1 parent ea59f04 commit 1a66011

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
PShader toon;
2+
3+
void setup() {
4+
size(640, 360, P3D);
5+
noStroke();
6+
fill(204);
7+
toon = loadShader("frag.glsl", "vert.glsl");
8+
toon.set("fraction", 1.0);
9+
}
10+
11+
void draw() {
12+
shader(toon);
13+
background(0);
14+
float dirY = (mouseY / float(height) - 0.5) * 2;
15+
float dirX = (mouseX / float(width) - 0.5) * 2;
16+
directionalLight(204, 204, 204, -dirX, -dirY, -1);
17+
translate(width/2, height/2);
18+
sphere(120);
19+
}

0 commit comments

Comments
 (0)