44 vec2 i = floor(p), f = fract(p);
45 f = f * f * (3. - 2. * f);
46 return mix(mix(
H(i),
H(i + vec2(1, 0)), f.x), mix(
H(i + vec2(0, 1)),
H(i + 1.), f.x), f.y);
77 vec2 p = (tc - .5) * vec2(A, 1);
78 float flame =
F(vec2(p.x * 3. + sin(p.y * 5.) * .4, p.y * 3. -
iTime * (.5 + b)));
79 float shape = smoothstep(.72, .15, abs(p.x) * (1.2 + p.y) - flame * .28 + .08);
80 vec2 uv = tc + vec2(sin(flame *
T), -flame) * (.012 + .018 * m);
81 float ca = .004 + .02 * t;
82 vec3 c = vec3(texture(samp, uv + ca).r, texture(samp, uv).g, texture(samp, uv - ca).b) *
84 float thread = pow(.5 + .5 * sin(flame * 24. - p.y * 18. +
iTime * 2.), 14.) * shape;
85 c +=
P(flame * .35 - p.y * .4 +
iTime * .03) *
86 (shape * (.28 + b * .4) + thread * (.55 + 1.5 * a));
88 c = mix(c, 1. - c, smoothstep(.96, 1.,
amp_peak));
89 color = vec4(1. - exp(-max(c, 0.) * 1.35), 1);