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: an infection of glowing veins creeping over a cold, dark surface.
// The bass makes the veins pulse, the highs make them glow.
// P1 how far the infection has spread, P2 how fast it grows, P3 glow, P4 colour (red to violet).
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 vein = pow(1.0 - abs(2.0 * n - 1.0), 8.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);
vein *= infected;
vec3 veinCol = mix(vec3(1.0, 0.06, 0.05), vec3(0.6, 0.15, 1.0), P4);
vec3 base = vec3(0.015, 0.025, 0.04) + vec3(0.03, 0.04, 0.06) * fbm5(uv * 4.0);
base *= 1.0 - 0.35 * length(uv);
float pulse = 0.5 + 1.8 * bass;
vec3 col = base + veinCol * vein * pulse * (0.5 + P3 * 1.5);
col += veinCol * pow(vein, 0.4) * 0.12 * P3 * infected * (1.0 + treble * 4.0);
col += veinCol * 0.04 * infected * bass;
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.