This repository was archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathYUCIBlobsGenerator.cikernel
executable file
·55 lines (45 loc) · 1.8 KB
/
YUCIBlobsGenerator.cikernel
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
43
44
45
46
47
48
49
50
51
52
53
54
55
// Blobs by @paulofalcao
// https://www.shadertoy.com/view/lsfGzr
float makePoint(float x,float y,float fx,float fy,float sx,float sy,float t){
float xx=x+sin(t*fx)*sx;
float yy=y+cos(t*fy)*sy;
return 1.0/sqrt(xx*xx+yy*yy);
}
kernel vec4 coreImageKernel(vec4 inputExtent, float inputTime) {
vec2 fragCoord = destCoord();
vec2 iResolution = inputExtent.zw;
float time = inputTime;
vec2 p=(fragCoord.xy/iResolution.x)*2.0-vec2(1.0,iResolution.y/iResolution.x);
p=p*2.0;
float x=p.x;
float y=p.y;
float a=makePoint(x,y,3.3,2.9,0.3,0.3,time);
a=a+makePoint(x,y,1.9,2.0,0.4,0.4,time);
a=a+makePoint(x,y,0.8,0.7,0.4,0.5,time);
a=a+makePoint(x,y,2.3,0.1,0.6,0.3,time);
a=a+makePoint(x,y,0.8,1.7,0.5,0.4,time);
a=a+makePoint(x,y,0.3,1.0,0.4,0.4,time);
a=a+makePoint(x,y,1.4,1.7,0.4,0.5,time);
a=a+makePoint(x,y,1.3,2.1,0.6,0.3,time);
a=a+makePoint(x,y,1.8,1.7,0.5,0.4,time);
float b=makePoint(x,y,1.2,1.9,0.3,0.3,time);
b=b+makePoint(x,y,0.7,2.7,0.4,0.4,time);
b=b+makePoint(x,y,1.4,0.6,0.4,0.5,time);
b=b+makePoint(x,y,2.6,0.4,0.6,0.3,time);
b=b+makePoint(x,y,0.7,1.4,0.5,0.4,time);
b=b+makePoint(x,y,0.7,1.7,0.4,0.4,time);
b=b+makePoint(x,y,0.8,0.5,0.4,0.5,time);
b=b+makePoint(x,y,1.4,0.9,0.6,0.3,time);
b=b+makePoint(x,y,0.7,1.3,0.5,0.4,time);
float c=makePoint(x,y,3.7,0.3,0.3,0.3,time);
c=c+makePoint(x,y,1.9,1.3,0.4,0.4,time);
c=c+makePoint(x,y,0.8,0.9,0.4,0.5,time);
c=c+makePoint(x,y,1.2,1.7,0.6,0.3,time);
c=c+makePoint(x,y,0.3,0.6,0.5,0.4,time);
c=c+makePoint(x,y,0.3,0.3,0.4,0.4,time);
c=c+makePoint(x,y,1.4,0.8,0.4,0.5,time);
c=c+makePoint(x,y,0.2,0.6,0.6,0.3,time);
c=c+makePoint(x,y,1.3,0.5,0.5,0.4,time);
vec3 d=vec3(a,b,c)/32.0;
return vec4(d.x,d.y,d.z,1.0);
}