Nodes: Polar rings

glint · Examples · Tutorials · Gallery

Visual node mode: spokes (stripes in polar coordinates) times rings that ride the music, through a neon palette.

Audio-reactive: it moves with music from a microphone, line-in or a file.

Nodes: Polar rings: an audio-reactive 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 float time;
uniform vec3 spectrum;
uniform float beat;
uniform vec3 spectrumIntegrated;

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 nn5dnc8c0nr_uv = (v_texcoord * 2.0 - 1.0) * vec2(resolution.x / resolution.y, 1.0);
  vec2 nn5dnc8c0nr_st = v_texcoord;
  // Polar
  float nn5dnc8da9y_angle = (atan(nn5dnc8c0nr_uv.y, nn5dnc8c0nr_uv.x) / 6.2831853 + 0.5);
  float nn5dnc8da9y_radius = length(nn5dnc8c0nr_uv);
  vec2 nn5dnc8da9y_uv = vec2(atan(nn5dnc8c0nr_uv.y, nn5dnc8c0nr_uv.x) / 6.2831853 + 0.5, length(nn5dnc8c0nr_uv));
  // Time
  float nn5dnc8fnc4_t = time * 0.8;
  // Stripes
  float nn5dnc8e3fi_out = (0.5 + 0.5 * sin(nn5dnc8da9y_uv.x * 16.0 * 3.14159 - nn5dnc8fnc4_t));
  // Audio
  float nn5dnc8gk5n_bass = spectrum.x;
  float nn5dnc8gk5n_mid = spectrum.y;
  float nn5dnc8gk5n_treble = spectrum.z;
  float nn5dnc8gk5n_beat = beat;
  float nn5dnc8gk5n_flow = spectrumIntegrated.x;
  // Add
  float nn5dnc8h5uq_out = (nn5dnc8fnc4_t + nn5dnc8gk5n_flow);
  // Rings
  float nn5dnc8i51b_out = (0.5 + 0.5 * sin(length(nn5dnc8c0nr_uv) * 12.0 * 3.14159 - nn5dnc8h5uq_out));
  // Multiply
  float nn5dnc8jx6h_out = (nn5dnc8e3fi_out * nn5dnc8i51b_out);
  // Palette
  vec3 nn5dnc8kwgv_rgb = n_palette(nn5dnc8jx6h_out, vec3(0.5), vec3(0.5), vec3(2.0, 1.0, 0.0), vec3(0.5, 0.2, 0.25));
  fragColor = vec4(nn5dnc8kwgv_rgb, 1.0);
}

More Nodes & glitch examples

Nodes: Liquid cells · Nodes: Paint trails · Nodes: Beat tiles · Nodes: Twirl · Nodes: Ink clouds · Nodes: Kaleido checker · Nodes: Neon grid · Nodes: Expression