File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #version 150
2
+
3
+ uniform vec4 globalColor;
4
+
5
+ out vec4 outputColor;
6
+
7
+ void main()
8
+ {
9
+ outputColor = globalColor;
10
+ }
Original file line number Diff line number Diff line change
1
+ #version 150
2
+
3
+ // these are for the programmable pipeline system
4
+ uniform mat4 modelViewProjectionMatrix;
5
+ in vec4 position;
6
+
7
+ // the time value is passed into the shader by the OF app.
8
+ uniform float time;
9
+
10
+
11
+ void main()
12
+ {
13
+ // the sine wave travels along the x-axis (across the screen),
14
+ // so we use the x coordinate of each vertex for the calculation,
15
+ // but we displace all the vertex along the y axis (up the screen)/
16
+ float displacementHeight = 100.0 ;
17
+ float displacementY = sin (time + (position.x / 100.0 )) * displacementHeight;
18
+
19
+ vec4 modifiedPosition = modelViewProjectionMatrix * position;
20
+ modifiedPosition.y += displacementY;
21
+ gl_Position = modifiedPosition;
22
+ }
You can’t perform that action at this time.
0 commit comments