Particle Fountain
Sparks thrown up from the floor and falling back, each spark tied to a frequency band. Lows throw from the middle, high…
Free to use for anything. No credit needed.
// Technocyte Cryo: a frozen surface cracking open, with hot light glowing out of the cracks.
// The bass makes the cracks flash, the highs make the frost sparkle.
// P1 how far the cracking has spread, P2 how fast it changes, P3 glow, P4 colour (orange fire to cyan).
float hash21(vec2 p)
{
p = fract(p * vec2(123.34, 456.21));
p += dot(p, p + 45.32);
return fract(p.x * p.y);
}
float vnoise(vec2 p)
{
vec2 i = floor(p);
vec2 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(mix(hash21(i), hash21(i + vec2(1.0, 0.0)), f.x), mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), f.x), f.y);
}
float fbm5(vec2 p)
{
float s = 0.0;
float a = 0.5;
for (int i = 0; i < 5; i++)
{
s += a * vnoise(p);
p = p * 2.03 + vec2(1.7, 9.2);
a *= 0.5;
}
return s;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
vec2 uv = (2.0 * fragCoord - iResolution.xy) / iResolution.y;
float bass = texture(iChannel0, vec2(0.03, 0.25)).x;
float treble = texture(iChannel0, vec2(0.55, 0.25)).x;
float t = iTime * (0.05 + P2 * 0.5);
vec2 p = uv * 2.2;
p += vec2(fbm5(p + t), fbm5(p - t + 3.1)) * 0.9;
float n = fbm5(p * 1.4 + t);
float ridge = 1.0 - abs(2.0 * n - 1.0);
float crack = pow(ridge, 20.0);
float soft = pow(ridge, 6.0);
float r = length(uv) + (fbm5(uv * 3.0 + t) - 0.5) * 0.7;
float radius = 0.1 + P1 * 2.2;
float infected = 1.0 - smoothstep(radius - 0.5, radius, r);
vec3 ice = vec3(0.03, 0.06, 0.10) + vec3(0.10, 0.17, 0.24) * pow(fbm5(uv * 5.0 + 2.0), 2.0);
ice *= 1.0 - 0.3 * length(uv);
float frost = pow(vnoise(uv * 70.0 + t * 3.0), 14.0) * (0.2 + treble * 3.0);
vec3 crackCol = mix(vec3(1.0, 0.45, 0.1), vec3(0.3, 0.8, 1.0), P4);
float flick = 0.5 + 1.8 * bass;
vec3 col = ice;
col += crackCol * crack * infected * flick * (0.8 + P3 * 2.0);
col += crackCol * soft * 0.15 * infected * (0.3 + P3);
col += vec3(0.7, 0.85, 1.0) * frost * 0.5;
col *= 1.0 - 0.1 * dot(uv, uv);
fragColor = vec4(col, 1.0);
}
Made for MNodes: paste it in a Shader Code node and wire it to a Shader or Scene. The P values are the sliders above the code.
Comments
No comments yet.
Log in or create an account to place a comment.