113 float radius = length(point) + 0.0001;
114 float angle = atan(point.y, point.x);
115 float orbit_phase =
time_f * 0.8 + age * 4.0;
116 float orbit_wave = sin(angle + orbit_phase);
117 float cross_twist = sin(angle * 2.0 - orbit_phase * 0.7);
118 float center_line = 0.34 + orbit_wave * (0.075 + middle * 0.045) +
119 cross_twist * (0.025 + middle * 0.015);
120 float twist = sin(angle * 3.0 -
time_f * 1.6 - age * 9.0) *
121 (0.055 + treble * 0.045);
122 return radius - center_line -
twist - bass * 0.025;
130 float aspect = resolution.x / resolution.y;
131 vec2 center =
iMouse.z > 0.0 ?
iMouse.xy / resolution : vec2(0.5);
132 vec2 point = (tc - center) * vec2(aspect, 1.0);
133 float bass = max(texture(spectrum0, 0.04).r,
amp_low);
134 float middle = max(texture(spectrum0, 0.36).r,
amp_mid);
135 float treble = max(texture(spectrum0, 0.79).r,
amp_high);
137 float angle = atan(point.y, point.x);
138 vec2 normal = normalize(point + vec2(0.0001));
139 vec2 tangent = vec2(-normal.y, normal.x);
140 vec2 live_uv = tc - normal *
field * (0.16 + bass * 0.12) +
141 tangent * sin(angle * 3.0 -
time_f) * treble * 0.018;
143 float ribbon = exp(-abs(
field) * (38.0 + treble * 25.0));
145 (0.2 + treble * 0.42);
147 vec3 accumulated = live * 1.2;
148 float total_weight = 1.2;
149 for (
int index = 0; index <
SIZE; ++index) {
150 float age = float(index + 1) / float(max(
SIZE, 1));
154 float old_field =
ribbon_field(point, old_bass, old_middle,
156 vec2 cache_point =
rotate_2d(age * (0.25 + old_middle * 0.7)) * point;
157 cache_point -= normalize(cache_point + vec2(0.0001)) * old_field *
158 (0.11 + old_bass * 0.1);
159 cache_point *= 1.0 - age * 0.075;
160 vec2 cache_uv = cache_point / vec2(aspect, 1.0) + center;
162 memory *= 0.66 +
palette(angle /
TAU + age + old_treble) * 0.6;
163 float old_ribbon = exp(-abs(old_field) * 30.0);
165 float weight = exp(-age * 2.4) * (0.68 + old_middle * 0.5);
166 accumulated += memory * weight;
167 total_weight += weight;
170 vec3 result = accumulated / total_weight;
171 result = mix(result, result.gbr, smoothstep(0.87, 1.0,
amp_peak) * 0.6);
172 result = (result - 0.5) * (1.1 +
amp_smooth * 0.32) + 0.5;
173 color = vec4(clamp(result, 0.0, 1.0), texture(samp, tc).a);
vec2 twist(vec2 coord, float twistAmount, float time, float direction)
Evaluates twist for this shader effect.