Nodes: Kaleidoscope
glint · Examples · Tutorials · Gallery
Visual node mode: rotate, fold, warp, then clouds through a sunset palette.

An example in glint, a free live shader editor in the browser: the GLSL code floats over the running picture and recompiles as you type.
The code
One pass, in GLSL.
fragment shader (generated from a node graph)
#version 300 es
precision highp float;
// Generated from nodes: edit the graph, or use "Convert to code" to take it from here by hand.
uniform vec2 resolution;
uniform float time;
in vec2 v_texcoord;
out vec4 fragColor;
float n_hash(vec2 p) { p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); }
vec2 n_hash2(vec2 p) { return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453); }
float n_noise(vec2 p) {
vec2 i = floor(p), f = fract(p), u = f * f * (3.0 - 2.0 * f);
return mix(mix(n_hash(i), n_hash(i + vec2(1, 0)), u.x), mix(n_hash(i + vec2(0, 1)), n_hash(i + vec2(1, 1)), u.x), u.y);
}
float n_fbm(vec2 p, float octaves) {
float v = 0.0, a = 0.5;
for (int k = 0; k < 8; k++) { if (float(k) >= octaves) break; v += a * n_noise(p); p = mat2(1.6, 1.2, -1.2, 1.6) * p; a *= 0.5; }
return v;
}
vec2 n_rotate(vec2 p, float a) { float c = cos(a), s = sin(a); return mat2(c, s, -s, c) * p; }
vec2 n_kaleido(vec2 p, float n) {
float a = atan(p.y, p.x), r = length(p), s = 6.2831853 / max(n, 1.0);
a = mod(a, s); a = abs(a - s * 0.5);
return vec2(cos(a), sin(a)) * r;
}
vec3 n_palette(float t, vec3 a, vec3 b, vec3 c, vec3 d) { return a + b * cos(6.2831853 * (c * t + d)); }
void main() {
// UV
vec2 nn5dn96rfv7_uv = (v_texcoord * 2.0 - 1.0) * vec2(resolution.x / resolution.y, 1.0);
vec2 nn5dn96rfv7_st = v_texcoord;
// Time
float nn5dn96sucu_t = time * 0.25;
// Rotate
vec2 nn5dn96tfes_uv = n_rotate(nn5dn96rfv7_uv, nn5dn96sucu_t);
// Kaleidoscope
vec2 nn5dn96u9oj_uv = n_kaleido(nn5dn96tfes_uv, 8.0);
// Warp
vec2 nn5dn96vfme_uv = nn5dn96u9oj_uv + 0.25 * (vec2(n_noise(nn5dn96u9oj_uv * 2.5 + nn5dn96sucu_t), n_noise(nn5dn96u9oj_uv * 2.5 + vec2(5.2, 1.3) - nn5dn96sucu_t)) - 0.5) * 2.0;
// Clouds (fbm)
float nn5dn96weox_out = n_fbm(nn5dn96vfme_uv * 2.2 + vec2(nn5dn96sucu_t, nn5dn96sucu_t * 0.7), 5.0);
// Add
float nn5dn96y0em_out = (nn5dn96weox_out + nn5dn96sucu_t);
// Palette
vec3 nn5dn96z69q_rgb = n_palette(nn5dn96y0em_out, vec3(0.5), vec3(0.5), vec3(1.0, 1.0, 0.5), vec3(0.8, 0.9, 0.3));
// Length
float nn5dn96xfz9_out = length(nn5dn96rfv7_uv);
// Smoothstep
float nn5dn970jhh_out = smoothstep(1.6, 0.2, nn5dn96xfz9_out);
// Multiply
vec3 nn5dn971fnp_out = (nn5dn96z69q_rgb * vec3(nn5dn970jhh_out));
fragColor = vec4(nn5dn971fnp_out, 1.0);
}More Nodes & glitch examples
Nodes: Neon rings · Nodes: Liquid cells · Nodes: Paint trails · Nodes: Beat tiles · Nodes: Twirl