-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2022-01-02-02.html
41 lines (34 loc) · 1.09 KB
/
2022-01-02-02.html
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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>shader</title>
<link rel="stylesheet" href="style.css">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
<canvas></canvas>
<script type="x-shader/x-fragment">
precision mediump float;
uniform vec2 resolution;
uniform float time;
// bool c(float f, float f2) {
// float d = 12.; //64.;
// return mod(gl_FragCoord.y+sin(gl_FragCoord.x*f + time*f2)*10., d) < (d/2.);
// }
bool c(vec2 uv, float f1, float f2) {
return uv.x+(uv.y*f2) > 0.5 ||uv.x+(uv.y*f1) < 0.3;
}
void main() {
vec2 uv = gl_FragCoord.xy / resolution.x;
// float v1 = ;
float v = 1.-float(c(uv, 0.2+sin(time)*0.01, 0.3+sin(time*1.2)*0.01) && c(uv, 0.5, 0.9));
// float b = step(length(vec2(0.5, 0.3) - uv), 0.2);
float b = 1.;
gl_FragColor = vec4(vec3(v)*b, 1.);
}
</script>
<script src="veda.js"></script>
</body>
</html>