-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday7.js
42 lines (36 loc) · 944 Bytes
/
day7.js
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
34
35
36
37
38
39
40
41
42
const day08_00 =`
#ifdef GL_ES
precision highp float;
#endif
uniform float u_time;
uniform vec2 u_resolution;
varying vec3 v_normal;
varying vec2 v_texcoord;
float fade(float x) { return x * x * x * (x * (x * 6. - 15.) + 10.); }
float phash(float p)
{
p = fract(7.8233139 * p);
p = ((2384.2345 * p - 1324.3438) * p + 3884.2243) * p - 4921.2354;
return fract(p) * 2. - 1.;
}
float noise(float p)
{
float ip = floor(p);
float fp = fract(p);
float d0 = phash(ip ) * fp;
float d1 = phash(ip + 1.) * (fp - 1.);
return mix(d0, d1, fade(fp));
}
void main(void)
{
vec2 uv = vec2(v_texcoord);
float movement = u_time * 0.3;
float movement2 = sin(uv.y * 13.) * u_time * 0.2;
// uv.y += sin(uv.y) + cos(u_time);
uv.x += movement2;
uv.x *= 15.0;
float f = fract(uv.x) * 10.;
float p = gl_FragCoord.x * 10. / u_resolution.x;
p += u_time * 2. - 10.;
gl_FragColor = vec4(f);
}`