···
96
96
}
97
97
`,
98
98
},
99
99
+
{
100
100
+
name: 'Factory',
101
101
+
author: 'yozic',
102
102
+
shader: `
103
103
+
#define BALLS 15.
104
104
+
#define PI 3.14159265359
105
105
+
#define zoom 47.379
106
106
+
#define rotation 0.874
107
107
+
#define yOuter 0.626
108
108
+
#define yDivider 278.913
109
109
+
#define xOuter 0.626
110
110
+
#define xDivider 194.847
111
111
+
#define multiplier 706.071
112
112
+
#define radius 32.912
113
113
+
#define ballSize 2.178
114
114
+
#define contrast 2.529
115
115
+
116
116
+
mat2 rotate2d(float _angle){
117
117
+
return mat2(cos(_angle), -sin(_angle), sin(_angle), cos(_angle));
118
118
+
}
119
119
+
120
120
+
void mainImage (out vec4 fragColor, in vec2 fragCoord) {
121
121
+
vec2 uv = 2. * fragCoord/iResolution.xy - 1.;
122
122
+
uv.x *= iResolution.x / iResolution.y;
123
123
+
uv *= zoom;
124
124
+
fragColor = vec4(0.);
125
125
+
126
126
+
uv = normalize(abs(uv) + sin(abs(uv) - iStream)) * length(uv);
127
127
+
uv *= rotate2d(rotation);
128
128
+
129
129
+
for (float i = 0.; i < BALLS; i++) {
130
130
+
float dist = length(uv);
131
131
+
uv.y += yOuter * sin(uv.y/yDivider + iStream/5.) / 1. * sin(uv.x/1. - iStream/3.);
132
132
+
uv.x -= xOuter * sin(uv.x/xDivider - iStream/5.) / 1. * sin(uv.x/1.1 + iStream/1.);
133
133
+
134
134
+
float t = i * PI / BALLS * (5. + 1.) + iStream/5000.;
135
135
+
float _multiplier = dist * multiplier * sin(uv.x);
136
136
+
vec2 p = vec2(radius * -2. * tan(t * multiplier), 2. * radius * sin(t * multiplier));
137
137
+
138
138
+
vec3 col = cos(vec3(0, 1, -1) * PI * 2. / 3. + PI * (iStream / 20. + i / 5.)) * 0.5 + 0.5;
139
139
+
fragColor += vec4(pow(iVolume, 1.3) * ballSize / length(uv - p * 0.9) * col, contrast);
140
140
+
}
141
141
+
142
142
+
fragColor.xyz = pow(fragColor.xyz, vec3(contrast));
143
143
+
fragColor.w = 1.0;
144
144
+
}
145
145
+
`,
146
146
+
},
99
147
]
100
148
101
149
const image_shader = `