-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvertex.vert
More file actions
33 lines (29 loc) · 698 Bytes
/
vertex.vert
File metadata and controls
33 lines (29 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*{
"pixelRatio": 1,
"vertexCount": 3000,
"vertexMode": "POINTS",
}*/
precision mediump float;
attribute float vertexId;
uniform float vertexCount;
uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;
varying vec4 v_color;
void main() {
float t = time * .3;
float i = vertexId + sin(vertexId) * 2.;
vec3 pos = vec3(
sin(t + vertexId + i * 2.) * sin(t * .21 + i),
cos(t + vertexId - i) * cos(t * .19 + i),
cos(t) * sin(t + vertexId)
);
gl_Position = vec4(pos.x, pos.y * resolution.x / resolution.y, pos.z * .1, 1);
gl_PointSize = 3. / max(abs(pos.z), .1);
v_color = vec4(
fract(pos.x + i),
fract(pos.y + i),
fract(pos.z + i),
1
);
}