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

Commit 891ed02

Browse files
committed
renamed sketches so they appear in the right order
1 parent 95ff399 commit 891ed02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+60
-107
lines changed
File renamed without changes.

Diff for: intro/Ex_2_1_toon/data/frag.glsl renamed to intro/Ex_02_1_toon/data/frag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_LIGHT_SHADER
7-
86
uniform float fraction;
97

108
varying vec4 vertColor;

Diff for: intro/Ex_2_1_toon/data/vert.glsl renamed to intro/Ex_02_1_toon/data/vert.glsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ uniform mat4 transform;
22
uniform mat3 normalMatrix;
33
uniform vec3 lightNormal;
44

5-
attribute vec4 vertex;
5+
attribute vec4 position;
66
attribute vec4 color;
77
attribute vec3 normal;
88

@@ -11,7 +11,7 @@ varying vec3 vertNormal;
1111
varying vec3 vertLightDir;
1212

1313
void main() {
14-
gl_Position = transform * vertex;
14+
gl_Position = transform * position;
1515
vertColor = color;
1616
vertNormal = normalize(normalMatrix * normal);
1717
vertLightDir = -lightNormal;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_COLOR_SHADER
2-
31
uniform mat4 transform;
42

5-
attribute vec4 vertex;
3+
attribute vec4 position;
64
attribute vec4 color;
75

86
varying vec4 vertColor;
97

108
void main() {
11-
gl_Position = transform * vertex;
9+
gl_Position = transform * position;
1210
vertColor = color;
1311
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: intro/Ex_9_1_allshaders/data/texvert.glsl renamed to intro/Ex_05_1_texture/data/texvert.glsl

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
#define PROCESSING_TEXTURE_SHADER
2-
31
uniform mat4 transform;
42
uniform mat4 texMatrix;
53

6-
attribute vec4 vertex;
4+
attribute vec4 position;
75
attribute vec4 color;
86
attribute vec2 texCoord;
97

108
varying vec4 vertColor;
119
varying vec4 vertTexCoord;
1210

1311
void main() {
14-
gl_Position = transform * vertex;
12+
gl_Position = transform * position;
1513

1614
vertColor = color;
1715
vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
#define PROCESSING_LIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64

75
uniform vec4 lightPosition;
86

9-
attribute vec4 vertex;
7+
attribute vec4 position;
108
attribute vec4 color;
119
attribute vec3 normal;
1210

1311
varying vec4 vertColor;
1412

1513
void main() {
16-
gl_Position = transform * vertex;
17-
vec3 ecVertex = vec3(modelview * vertex);
14+
gl_Position = transform * position;
15+
vec3 ecPosition = vec3(modelview * position);
1816
vec3 ecNormal = normalize(normalMatrix * normal);
1917

20-
vec3 direction = normalize(lightPosition.xyz - ecVertex);
18+
vec3 direction = normalize(lightPosition.xyz - ecPosition);
2119
float intensity = max(0.0, dot(direction, ecNormal));
2220
vertColor = vec4(intensity, intensity, intensity, 1) * color;
2321
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_LIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64

75
uniform vec4 lightPosition;
86
uniform vec3 lightNormal;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311

@@ -16,10 +14,10 @@ varying vec3 ecNormal;
1614
varying vec3 lightDir;
1715

1816
void main() {
19-
gl_Position = transform * vertex;
20-
vec3 ecVertex = vec3(modelview * vertex);
17+
gl_Position = transform * position;
18+
vec3 ecPosition = vec3(modelview * position);
2119

2220
ecNormal = normalize(normalMatrix * normal);
23-
lightDir = normalize(lightPosition.xyz - ecVertex);
21+
lightDir = normalize(lightPosition.xyz - ecPosition);
2422
vertColor = color;
2523
}
File renamed without changes.

Diff for: intro/Ex_7_1_texlight/data/texlightvert.glsl renamed to intro/Ex_07_1_texlight/data/texlightvert.glsl

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_TEXLIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64
uniform mat4 texMatrix;
75

86
uniform vec4 lightPosition;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311
attribute vec2 texCoord;
@@ -16,11 +14,11 @@ varying vec4 vertColor;
1614
varying vec4 vertTexCoord;
1715

1816
void main() {
19-
gl_Position = transform * vertex;
20-
vec3 ecVertex = vec3(modelview * vertex);
17+
gl_Position = transform * position;
18+
vec3 ecPosition = vec3(modelview * position);
2119
vec3 ecNormal = normalize(normalMatrix * normal);
2220

23-
vec3 direction = normalize(lightPosition.xyz - ecVertex);
21+
vec3 direction = normalize(lightPosition.xyz - ecPosition);
2422
float intensity = max(0.0, dot(direction, ecNormal));
2523
vertColor = vec4(intensity, intensity, intensity, 1) * color;
2624

File renamed without changes.

Diff for: intro/Ex_7_2_texpixlight/data/pixlightxvert.glsl renamed to intro/Ex_07_2_texpixlight/data/pixlightxvert.glsl

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_TEXLIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64
uniform mat4 texMatrix;
75

86
uniform vec4 lightPosition;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311
attribute vec2 texCoord;
@@ -18,11 +16,11 @@ varying vec3 lightDir;
1816
varying vec4 vertTexCoord;
1917

2018
void main() {
21-
gl_Position = transform * vertex;
22-
vec3 ecVertex = vec3(modelview * vertex);
19+
gl_Position = transform * position;
20+
vec3 ecPosition = vec3(modelview * position);
2321

2422
ecNormal = normalize(normalMatrix * normal);
25-
lightDir = normalize(lightPosition.xyz - ecVertex);
23+
lightDir = normalize(lightPosition.xyz - ecPosition);
2624
vertColor = color;
2725

2826
vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
File renamed without changes.

Diff for: intro/Ex_9_1_allshaders/data/bwfrag.glsl renamed to intro/Ex_08_1_bw/data/bwfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97

108
varying vec4 vertColor;
File renamed without changes.
File renamed without changes.

Diff for: intro/Ex_8_2_edges/data/edgesfrag.glsl renamed to intro/Ex_08_2_edges/data/edgesfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97
uniform vec2 texOffset;
108

File renamed without changes.
File renamed without changes.

Diff for: intro/Ex_9_1_allshaders/data/embossfrag.glsl renamed to intro/Ex_08_3_emboss/data/embossfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97
uniform vec2 texOffset;
108

File renamed without changes.

Diff for: intro/Ex_8_1_bw/data/bwfrag.glsl renamed to intro/Ex_09_1_allshaders/data/bwfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97

108
varying vec4 vertColor;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_COLOR_SHADER
2-
31
uniform mat4 transform;
42

5-
attribute vec4 vertex;
3+
attribute vec4 position;
64
attribute vec4 color;
75

86
varying vec4 vertColor;
97

108
void main() {
11-
gl_Position = transform * vertex;
9+
gl_Position = transform * position;
1210
vertColor = color;
1311
}

Diff for: intro/Ex_9_1_allshaders/data/edgesfrag.glsl renamed to intro/Ex_09_1_allshaders/data/edgesfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97
uniform vec2 texOffset;
108

Diff for: intro/Ex_8_3_emboss/data/embossfrag.glsl renamed to intro/Ex_09_1_allshaders/data/embossfrag.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ precision mediump float;
33
precision mediump int;
44
#endif
55

6-
#define PROCESSING_TEXTURE_SHADER
7-
86
uniform sampler2D texture;
97
uniform vec2 texOffset;
108

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
#define PROCESSING_LIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64

75
uniform vec4 lightPosition;
86

9-
attribute vec4 vertex;
7+
attribute vec4 position;
108
attribute vec4 color;
119
attribute vec3 normal;
1210

1311
varying vec4 vertColor;
1412

1513
void main() {
16-
gl_Position = transform * vertex;
17-
vec3 ecVertex = vec3(modelview * vertex);
14+
gl_Position = transform * position;
15+
vec3 ecPosition = vec3(modelview * position);
1816
vec3 ecNormal = normalize(normalMatrix * normal);
1917

20-
vec3 direction = normalize(lightPosition.xyz - ecVertex);
18+
vec3 direction = normalize(lightPosition.xyz - ecPosition);
2119
float intensity = max(0.0, dot(direction, ecNormal));
2220
vertColor = vec4(intensity, intensity, intensity, 1) * color;
2321
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_LIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64

75
uniform vec4 lightPosition;
86
uniform vec3 lightNormal;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311

@@ -16,10 +14,10 @@ varying vec3 ecNormal;
1614
varying vec3 lightDir;
1715

1816
void main() {
19-
gl_Position = transform * vertex;
20-
vec3 ecVertex = vec3(modelview * vertex);
17+
gl_Position = transform * position;
18+
vec3 ecPosition = vec3(modelview * position);
2119

2220
ecNormal = normalize(normalMatrix * normal);
23-
lightDir = normalize(lightPosition.xyz - ecVertex);
21+
lightDir = normalize(lightPosition.xyz - ecPosition);
2422
vertColor = color;
2523
}

Diff for: intro/Ex_9_1_allshaders/data/pixlightxvert.glsl renamed to intro/Ex_09_1_allshaders/data/pixlightxvert.glsl

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_TEXLIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64
uniform mat4 texMatrix;
75

86
uniform vec4 lightPosition;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311
attribute vec2 texCoord;
@@ -18,11 +16,11 @@ varying vec3 lightDir;
1816
varying vec4 vertTexCoord;
1917

2018
void main() {
21-
gl_Position = transform * vertex;
22-
vec3 ecVertex = vec3(modelview * vertex);
19+
gl_Position = transform * position;
20+
vec3 ecPosition = vec3(modelview * position);
2321

2422
ecNormal = normalize(normalMatrix * normal);
25-
lightDir = normalize(lightPosition.xyz - ecVertex);
23+
lightDir = normalize(lightPosition.xyz - ecPosition);
2624
vertColor = color;
2725

2826
vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);

Diff for: intro/Ex_9_1_allshaders/data/texlightvert.glsl renamed to intro/Ex_09_1_allshaders/data/texlightvert.glsl

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#define PROCESSING_TEXLIGHT_SHADER
2-
31
uniform mat4 modelview;
42
uniform mat4 transform;
53
uniform mat3 normalMatrix;
64
uniform mat4 texMatrix;
75

86
uniform vec4 lightPosition;
97

10-
attribute vec4 vertex;
8+
attribute vec4 position;
119
attribute vec4 color;
1210
attribute vec3 normal;
1311
attribute vec2 texCoord;
@@ -16,11 +14,11 @@ varying vec4 vertColor;
1614
varying vec4 vertTexCoord;
1715

1816
void main() {
19-
gl_Position = transform * vertex;
20-
vec3 ecVertex = vec3(modelview * vertex);
17+
gl_Position = transform * position;
18+
vec3 ecPosition = vec3(modelview * position);
2119
vec3 ecNormal = normalize(normalMatrix * normal);
2220

23-
vec3 direction = normalize(lightPosition.xyz - ecVertex);
21+
vec3 direction = normalize(lightPosition.xyz - ecPosition);
2422
float intensity = max(0.0, dot(direction, ecNormal));
2523
vertColor = vec4(intensity, intensity, intensity, 1) * color;
2624

Diff for: intro/Ex_5_1_texture/data/texvert.glsl renamed to intro/Ex_09_1_allshaders/data/texvert.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define PROCESSING_TEXTURE_SHADER
2-
31
uniform mat4 transform;
42
uniform mat4 texMatrix;
53

Diff for: intro/Ex_10_1_points/Ex_10_1_points.pde

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ void setup() {
1111
background(0);
1212
}
1313

14-
void draw() {
15-
shader(pointShader, POINTS);
14+
void draw() {
15+
shader(pointShader);
16+
// It is possible to set the shader type, but not needed, Processing will try to
17+
// autodetect the type
18+
//shader(pointShader, POINTS);
1619
if (mousePressed) {
1720
point(mouseX, mouseY);
1821
}
19-
}
20-
22+
}

0 commit comments

Comments
 (0)