Plasma

A classic sum-of-sines plasma: three overlapping sines fed into a four-color loop. The tempo slider (hover the panel in the corner) scales iTime. The palette is iAccent plus three fixed complementary hues, so the plate tracks the site theme.

[glsl]: shader source
// Sum-of-sines plasma cycled through four colors: the site accent
// plus three fixed complementary hues.
// controls-panel slider scales iTime — drag slower for a lava lamp,
// faster for a strobe.
// @slider tempo 0.1 3.0 1.0 0.05
uniform float tempo;

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
  vec2 uv = fragCoord / iResolution.xy;
  float t = iTime * 0.5 * tempo;

  // three overlapping sine plates: value lands in [-3, 3]
  float v = 0.0;
  v += sin( uv.x * 10.0 + t );
  v += sin((uv.y * 10.0 + t) / 2.0);
  v += sin((uv.x * 10.0 + uv.y * 10.0 + t) / 2.0);

  // remap [-3, 3] to [0, 1], then walk a four-color loop
  vec3 c1 = iAccent;
  vec3 c2 = vec3(0.35, 0.75, 1.00);
  vec3 c3 = vec3(1.00, 0.35, 0.55);
  vec3 c4 = vec3(0.55, 0.25, 0.85);
  float n = (v + 3.0) / 6.0;
  float idx = n * 4.0;
  vec3 col;
  if(idx < 1.0)      col = mix(c1, c2, idx);
  else if(idx < 2.0) col = mix(c2, c3, idx - 1.0);
  else if(idx < 3.0) col = mix(c3, c4, idx - 2.0);
  else               col = mix(c4, c1, idx - 3.0);

  fragColor = vec4(col * 0.4, 1.0);
}
// settings
theme:
fx: