Nodes: Colour wheel rings

glint · Examples · Tutorials · Gallery

Visual node mode: the angle round the middle picks the hue (HSV), and rings multiply it, more of them the louder the mids.

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

Nodes: Colour wheel 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_hsv(vec3 c) { vec3 p = abs(fract(c.xxx + vec3(1.0, 2.0 / 3.0, 1.0 / 3.0)) * 6.0 - 3.0); return c.z * mix(vec3(1.0), clamp(p - 1.0, 0.0, 1.0), c.y); }

void main() {
  // UV
  vec2 nn5dnha8k8w_uv = (v_texcoord * 2.0 - 1.0) * vec2(resolution.x / resolution.y, 1.0);
  vec2 nn5dnha8k8w_st = v_texcoord;
  // Polar
  float nn5dnha9fd9_angle = (atan(nn5dnha8k8w_uv.y, nn5dnha8k8w_uv.x) / 6.2831853 + 0.5);
  float nn5dnha9fd9_radius = length(nn5dnha8k8w_uv);
  vec2 nn5dnha9fd9_uv = vec2(atan(nn5dnha8k8w_uv.y, nn5dnha8k8w_uv.x) / 6.2831853 + 0.5, length(nn5dnha8k8w_uv));
  // Time
  float nn5dnhaapm7_t = time * 0.1;
  // Add
  float nn5dnhabx05_out = (nn5dnha9fd9_angle + nn5dnhaapm7_t);
  // HSV
  vec3 nn5dnhacsex_rgb = n_hsv(vec3(nn5dnhabx05_out, 0.8, 1.0));
  // Audio
  float nn5dnhadvv1_bass = spectrum.x;
  float nn5dnhadvv1_mid = spectrum.y;
  float nn5dnhadvv1_treble = spectrum.z;
  float nn5dnhadvv1_beat = beat;
  float nn5dnhadvv1_flow = spectrumIntegrated.x;
  // Multiply
  float nn5dnhae858_out = (nn5dnhadvv1_mid * 14.0);
  // Add
  float nn5dnhaf3uj_out = (nn5dnhae858_out + 6.0);
  // Rings
  float nn5dnhagjgj_out = (0.5 + 0.5 * sin(length(nn5dnha8k8w_uv) * nn5dnhaf3uj_out * 3.14159 - nn5dnhaapm7_t));
  // Multiply
  vec3 nn5dnhahfie_out = (nn5dnhacsex_rgb * vec3(nn5dnhagjgj_out));
  fragColor = vec4(nn5dnhahfie_out, 1.0);
}

More Nodes & glitch examples

Nodes: Neon grid · Nodes: Expression · Nodes: Sunset stripes · Nodes: Spotlight · Nodes: Marble · Nodes: Beat circle · Nodes: Zoom trails · Nodes: Bass twirl