75 float a = sin(dot(p, vec2(18.0, 11.0)) + t * 2.1);
76 float b = sin(dot(p, vec2(-13.0, 24.0)) - t * 1.7);
77 float c = sin(length(p - vec2(sin(t * .23), cos(t * .19)) * .25) * 31.0 - t * 3.4);
78 float d = sin(p.x * 47.0 + sin(p.y * 9.0 - t) * 2.0 + t);
79 return a * .38 + b * .29 + c * .22 + d * .11;
86 vec2 p = (tc - .5) * vec2(aspect, 1.0);
89 vec2 grad = vec2(hx -
h, hy -
h) / e;
90 vec3
n = normalize(vec3(-grad * .055, 1.0));
91 vec2 refractOffset =
n.xy * (.025 +
amp_low * .018);
92 vec2 uv =
mirrorUV(tc + refractOffset);
93 float dispersion = .002 + .008 *
amp_high + .0025 * length(grad);
94 vec2 axis = normalize(
n.xy + vec2(.0001));
95 vec3 src = vec3(texture(samp,
mirrorUV(uv + axis * dispersion)).r, texture(samp, uv).g,
96 texture(samp,
mirrorUV(uv - axis * dispersion)).b);
97 vec3 l = normalize(vec3(-.35, .55, .76));
98 float focus = pow(max(dot(
n, l), 0.0), 18.0);
99 float ridge = pow(clamp(length(grad) * .075, 0.0, 1.0), 1.7);
101 vec3 result = src * (.70 + .28 * max(
n.z, 0.0));
103 result += pow(max(dot(
n, normalize(vec3(.6, -.3, .74))), 0.0), 80.0) * .55;
104 color = vec4(
aces(result * (1.0 +
amp_rms * .22)), texture(samp, uv).a);