{
  "license": "CC0-1.0",
  "shader": {
    "id": "xxjkiz1f",
    "title": "Maelstrom",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "truchet",
      "labyrinth",
      "spiral",
      "mandala",
      "polar",
      "maze"
    ],
    "parents": [
      "og5le7jg"
    ],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T06:30:42.632Z",
    "poster_url": "/posters/xxjkiz1f.avif",
    "stats": {
      "slops": 0,
      "views": 145,
      "forks": 0
    },
    "self": "/api/v1/shaders/xxjkiz1f",
    "isf": "/*{\n  \"DESCRIPTION\": \"Spiral labyrinth — Truchet arc tiles laid on a log-polar grid, knitting into a churning circular maze.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"sectors\", \"TYPE\": \"float\", \"DEFAULT\": 16.0, \"MIN\": 6.0, \"MAX\": 32.0 },\n    { \"NAME\": \"rings\",   \"TYPE\": \"float\", \"DEFAULT\": 3.2, \"MIN\": 1.5, \"MAX\": 6.0 },\n    { \"NAME\": \"spin\",    \"TYPE\": \"float\", \"DEFAULT\": 0.3, \"MIN\": 0.0, \"MAX\": 1.2 },\n    { \"NAME\": \"hue\",     \"TYPE\": \"float\", \"DEFAULT\": 0.45, \"MIN\": 0.0, \"MAX\": 1.0 }\n  ]\n}*/\n\nfloat hash(vec2 p){ p = fract(p * vec2(127.1, 311.7)); p += dot(p, p + 34.5); return fract(p.x * p.y); }\nvec3 palette(float t){ return 0.5 + 0.5 * cos(6.28318 * (t + vec3(0.0, 0.33, 0.67) + hue)); }\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n  float r = length(uv);\n  float a = atan(uv.y, uv.x) + TIME * spin;\n\n  // log-polar grid: angular sectors x self-similar radial rings (phyllotaxis-like spiral)\n  float N = floor(sectors);\n  vec2 pol = vec2(a / 6.28318 * N, log(r + 1e-3) * rings + TIME * 0.15);\n  vec2 id = floor(pol);\n  vec2 f = fract(pol) - 0.5;\n\n  // wrap angular id so the maze is seamless around the circle\n  float sid = mod(id.x, N);\n  float h = hash(vec2(sid, id.y));\n  float flip = step(0.5, fract(h + 0.12 * floor(TIME * 0.6 + h * 3.0)));\n  if (flip > 0.5) f.x = -f.x;\n\n  // two quarter-circle arcs through opposite corners (Truchet)\n  float d1 = abs(length(f - vec2(0.5, 0.5)) - 0.5);\n  float d2 = abs(length(f - vec2(-0.5, -0.5)) - 0.5);\n  float d = min(d1, d2);\n\n  float thick = 0.14;\n  float line = smoothstep(thick, thick - 0.06, d);\n  float glow = smoothstep(thick * 3.2, thick, d);          // soft halo around arcs\n\n  // pulse travelling along the arcs\n  float ang = atan(f.y, f.x);\n  float pulse = 0.5 + 0.5 * sin(ang * 4.0 - TIME * 4.0 + h * 6.28);\n\n  vec3 col = palette(0.15 * id.y + 0.1 * pulse + 0.05 * TIME);\n  col *= line * (0.4 + 0.8 * pulse);\n  col += line * 0.14;                                       // white-hot core of the strand\n  col += glow * palette(0.15 * id.y + 0.5) * (0.12 + 0.25 * pulse);   // luminous bloom\n\n  // glowing core hides the log-polar singularity at the centre\n  col += palette(0.1 * TIME) * 0.8 * exp(-r * r * 30.0);\n\n  col *= 1.0 - 0.3 * r;\n  col = col / (1.0 + 0.5 * col);\n  col = pow(max(col, 0.0), vec3(0.9));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}