forked from mir-one/fingerprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
algo.glsl
34 lines (27 loc) · 832 Bytes
/
algo.glsl
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
vec2 hash2( vec2 p )
{
p = vec2( dot(p,vec2(63.31,127.63)), dot(p,vec2(395.467,213.799)) );
return -1.0 + 2.0*fract(sin(p)*43141.59265);
}
void main(void)
{
float invzoom = 64.;
vec2 uv = invzoom*((gl_FragCoord.xy-0.5*resolution.xy)/resolution.x);
float bounds = smoothstep(9.,10.,length(uv*vec2(0.74,0.55)));
float a=0.;
vec2 h = vec2(floor(7.*time), 0.);
for(int i=0; i<50; i++){
float s=sign(h.x);
h = hash2(h)*vec2(15.,20.);
a += s*atan(uv.x-h.x, uv.y-h.y);
}
uv += 20.*abs(hash2(h));
a+=atan(uv.y, uv.x);
float w = 0.8;
float p=(1.-bounds)*w;
float s = min(0.3,p);
float l = length(uv)+0.319*a;
float m = mod(l,2.);
float v = (1.-smoothstep(2.-s,2.,m))*smoothstep(p,p+s,m);
glFragColor = vec4(v,v,v,1.);
}