Nodes: Zoom trails

glint · Examples · Tutorials · Gallery

Visual node mode: feedback with the Image node. Last frame, scaled towards the middle and dimmed, under a circle going round: its trail spirals outwards.

Nodes: Zoom trails: a GLSL shader

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 sampler2D feedback;
uniform float time;

in vec2 v_texcoord;
out vec4 fragColor;

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 nn5dnkb34tw_uv = (v_texcoord * 2.0 - 1.0) * vec2(resolution.x / resolution.y, 1.0);
  vec2 nn5dnkb34tw_st = v_texcoord;
  // Move
  vec2 nn5dnkb4w5j_uv = nn5dnkb34tw_st - vec2(-0.5);
  // Scale
  vec2 nn5dnkb5dhw_uv = nn5dnkb4w5j_uv * 0.97;
  // Move
  vec2 nn5dnkb60lf_uv = nn5dnkb5dhw_uv - vec2(0.5);
  // Image
  vec3 nn5dnkb7zv9_rgb = texture(feedback, nn5dnkb60lf_uv).rgb;
  float nn5dnkb7zv9_a = texture(feedback, nn5dnkb60lf_uv).a;
  // Multiply
  vec3 nn5dnkb84g3_out = (nn5dnkb7zv9_rgb * vec3(0.96));
  // Time
  float nn5dnkb9uck_t = time * 1.5;
  // Palette
  vec3 nn5dnkbdvqc_rgb = n_palette(nn5dnkb9uck_t, vec3(0.5), vec3(0.5), vec3(1.0), vec3(0.0, 0.33, 0.67));
  // Expression
  vec2 nn5dnkbafvx_out = vec2(vec2(cos((nn5dnkb9uck_t)), sin((nn5dnkb9uck_t))) * 0.4);
  // Subtract
  vec2 nn5dnkbbk5j_out = (nn5dnkb34tw_uv - nn5dnkbafvx_out);
  // Circle
  float nn5dnkbc43t_mask = (1.0 - smoothstep(0.05 - 0.02, 0.05 + 0.02, length(nn5dnkbbk5j_out)));
  float nn5dnkbc43t_dist = (length(nn5dnkbbk5j_out) - 0.05);
  // Multiply
  vec3 nn5dnkbe7qj_out = (nn5dnkbdvqc_rgb * vec3(nn5dnkbc43t_mask));
  // Max
  vec3 nn5dnkbfbyd_out = max(nn5dnkb84g3_out, nn5dnkbe7qj_out);
  fragColor = vec4(nn5dnkbfbyd_out, 1.0);
}

More Nodes & glitch examples

Nodes: Spotlight · Nodes: Colour wheel rings · Nodes: Marble · Nodes: Beat circle · Nodes: Bass twirl · Nodes: Colour drift · Nodes: Crystal · Nodes: Spectrum bars