215vec2
style_warp(vec2 uv, vec2 center,
float aspect,
float sub,
float bass,
216 float low_mid,
float middle,
float presence,
float high,
217 float air,
float flux) {
218 vec2 point = (uv - center) * vec2(aspect, 1.0);
219 float radius = length(point) + 0.0001;
220 float angle = atan(point.y, point.x);
224 if (point.y > point.x) point = point.yx;
225 point *= 1.0 + sin(radius * (12.0 + bass * 15.0) -
time_f * 2.7) *
228 float petals = 7.0 + floor(middle * 7.0);
229 float sector =
TAU / petals;
230 float folded_angle = abs(mod(angle + sector * 0.5, sector) - sector * 0.5);
231 radius *= 1.0 + cos(folded_angle * petals * 2.0 +
time_f) *
232 (0.12 + low_mid * 0.2);
233 point = vec2(cos(folded_angle), sin(folded_angle)) * radius;
235 point =
rotate_2d(
PI * 0.25 + presence * 0.2) * point;
237 point = vec2(point.x + point.y, abs(point.x - point.y)) * 0.72;
238 point += sin(point.yx * (9.0 + high * 12.0) +
time_f) * (0.015 + flux * 0.06);
240 point =
rotate_2d(log(radius + 0.035) * (0.45 + bass * 0.8) -
241 time_f * (0.12 + low_mid * 0.16)) * point;
242 point *= 1.0 + sin(log(radius + 0.02) * 13.0 -
time_f * 2.0) *
245 float jet = pow(abs(cos(angle * 2.0)), 9.0);
246 point.x += sign(point.x) * jet * (0.08 + presence * 0.22);
247 point.y += sin(point.x * (11.0 + high * 9.0) -
time_f * 3.0) *
248 (0.025 + air * 0.08);
250 for (
int iteration = 0; iteration < 4; ++iteration) {
251 point = abs(point) / max(dot(point, point), 0.12) -
252 vec2(0.72 + bass * 0.12, 0.54 + middle * 0.11);
253 point =
rotate_2d(0.31 + presence * 0.14) * point;
255 point *= 0.17 + flux * 0.05;
257 point.x += sin(point.y * (10.0 + middle * 11.0) -
time_f * 1.7) *
258 (0.035 + low_mid * 0.1);
259 point.y += cos(point.x * (9.0 + high * 13.0) +
time_f * 1.3) *
261 point =
rotate_2d(sin(radius * 8.0 -
time_f) * (0.08 + bass * 0.16)) * point;
263 float petals = 8.0 + floor(presence * 6.0);
264 float sector =
TAU / petals;
265 float folded_angle = abs(mod(angle + sector * 0.5, sector) - sector * 0.5);
266 float lotus = sin(radius * (17.0 + high * 15.0) -
time_f * 3.4);
267 radius *= 1.0 + lotus * (0.07 + bass * 0.12);
268 point = vec2(cos(folded_angle), sin(folded_angle)) * radius;
270 float shock = sin(radius * (24.0 + bass * 18.0) -
time_f * (4.0 + flux * 3.0));
271 point *= 1.0 + shock * (0.04 + sub * 0.16);
272 point =
rotate_2d(shock * (0.05 + presence * 0.12)) * point;
274 vec2 chamber = abs(fract(point * (3.0 + floor(middle * 5.0))) - 0.5);
275 point += (chamber.yx - 0.25) * (0.08 + high * 0.16);
276 point =
rotate_2d(floor(radius * (8.0 + bass * 6.0)) *
PI * 0.25 +
280 return point / vec2(aspect, 1.0) + center;
318 float old_sub,
float old_bass,
float old_middle,
319 float old_high,
float old_air) {
320 vec2 point = (uv - center) * vec2(aspect, 1.0);
321 float shrink = 1.0 + progress * (0.38 + old_sub * 1.4 + old_bass * 0.8);
325 point =
rotate_2d(progress * (0.08 + old_high * 0.7) * sin(
time_f * 0.4)) * point;
326 point += normalize(point + vec2(0.001)) * old_bass * progress * 0.08;
327#elif STYLE_ID % 5 == 1
328 point.x += sin(point.y * (8.0 + old_middle * 12.0) + progress *
TAU) *
329 progress * (0.025 + old_air * 0.08);
330 point.y += cos(point.x * 7.0 - progress *
TAU) * old_high * progress * 0.05;
331#elif STYLE_ID % 5 == 2
332 float radius = length(point) + 0.001;
334 (0.08 + old_middle * 0.2)) * point;
335#elif STYLE_ID % 5 == 3
336 point.x *= 1.0 + progress * old_middle * 0.25;
337 point.y *= 1.0 - progress * old_high * 0.12;
338 point += vec2(old_air, old_bass) * progress * 0.045;
340 float radius = length(point) + 0.001;
341 vec2 tangent = vec2(-point.y, point.x) / radius;
342 point += tangent * progress * (0.035 + old_high * 0.16);
343 point += normalize(point + vec2(0.001)) * sin(radius * 19.0 +
time_f) *
344 old_bass * progress * 0.05;
347 return point / vec2(aspect, 1.0) + center;
355 vec2 texel = 1.0 / resolution;
356 float aspect = resolution.x / resolution.y;
357 vec2 center =
iMouse.z > 0.5 ?
iMouse.xy / resolution : vec2(0.5);
370 float flux = clamp(abs(sub - previous_sub) * 1.5 +
371 abs(middle - previous_mid) +
372 abs(high - previous_high) * 0.8, 0.0, 1.5);
373 float energy = sub * 0.24 + bass * 0.22 + low_mid * 0.17 +
374 middle * 0.15 + presence * 0.1 + high * 0.08 + air * 0.04;
376 float segments = 4.0 + float(
STYLE_ID % 5) + floor(middle * 7.0);
379 float fold_zoom = 1.08 + sub * 0.38 + bass * 0.28 + flux * 0.11;
380 warped_uv =
fractal_fold(warped_uv, center, aspect, fold_zoom, bass, middle);
381 warped_uv =
style_warp(warped_uv, center, aspect, sub, bass, low_mid,
382 middle, presence, high, air, flux);
383 warped_uv =
darkstar_wrap(warped_uv, center, aspect, sub, bass, middle,
386 vec2 direction = normalize((warped_uv - center) * vec2(aspect, 1.0) + vec2(0.001));
387 vec2 chroma_offset = direction * vec2(1.0 / aspect, 1.0) *
388 (0.002 + presence * 0.008 + air * 0.016 + flux * 0.006);
389 float blur_spread = 1.0 + low_mid * 2.5;
390 vec3 red_sample =
soft_live(warped_uv + chroma_offset, texel, blur_spread);
391 vec3 green_sample =
soft_live(warped_uv, texel, blur_spread);
392 vec3 blue_sample =
soft_live(warped_uv - chroma_offset, texel, blur_spread);
393 vec3
kaleido = vec3(red_sample.r, green_sample.g, blue_sample.b);
396 float radial = length((tc - center) * vec2(aspect, 1.0));
397 float spectral_ring = 0.5 + 0.5 * sin(log(radial + 0.025) *
398 (10.0 + middle * 13.0) -
time_f *
400 float live_mix = clamp(0.52 +
energy * 0.32 + flux * 0.22, 0.0, 0.94);
401 vec3 live = mix(base,
kaleido, live_mix);
402 live *= 0.72 + spectral_ring * (0.28 + presence * 0.32);
403 live +=
palette(spectral_ring * 0.18 +
time_f * 0.035 + high) *
404 pow(spectral_ring, 8.0) * (0.04 + flux * 0.3);
406 vec3 trail_accum = vec3(0.0);
407 float trail_weight = 0.0;
408 for (
int index = 0; index <
SIZE; ++index) {
409 float progress = float(index + 1) / float(max(
SIZE, 1));
416 old_sub, old_bass, old_middle,
419 float old_energy = old_sub * 0.32 + old_bass * 0.25 +
420 old_middle * 0.22 + old_high * 0.13 + old_air * 0.08;
422 old_middle * 0.5 + old_high * 0.28);
423 float weight = exp(-progress * (2.6 + high * 0.8)) *
424 (0.72 + old_energy * 0.5);
425 trail_accum += mix(cached, cached * tint, 0.42 + progress * 0.4) * weight;
426 trail_weight += weight;
429 vec3 trail = trail_accum / max(trail_weight, 0.001);
430 trail *= 0.45 + bass * 0.22 + middle * 0.13;
431 vec3 result = live + trail - live * trail;
433 result = (result - 0.5) * (1.04 + presence * 0.2 + flux * 0.1) + 0.5;