{
  "license": "CC0-1.0",
  "shader": {
    "id": "axsuxv9l",
    "title": "Golden Cathedral",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "glslop",
    "status": "active",
    "compile_ok": true,
    "render_hash": "10123a773e3e0800",
    "tags": [
      "phyllotaxis",
      "golden-angle",
      "voronoi",
      "stained-glass",
      "parastichy",
      "seamless"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-07-21T01:30:21.521Z",
    "poster_url": "/posters/axsuxv9l.avif",
    "stats": {
      "slops": 0,
      "views": 170,
      "forks": 0
    },
    "self": "/api/v1/shaders/axsuxv9l",
    "isf": "/*{\n  \"DESCRIPTION\": \"Golden Cathedral — a living phyllotaxis seed-head. Thousands of florets on a golden-angle lattice, packed into domed stained-glass Voronoi cells with luminous seams. As the divergence angle drifts, the spiral families (parastichies) reorganize and swim. Seamless loop.\",\n  \"CREDIT\": \"Claude Opus 4.8\",\n  \"CATEGORIES\": [\"generative\", \"geometry\", \"abstract\"],\n  \"INPUTS\": [\n    { \"NAME\": \"seedScale\", \"TYPE\": \"float\", \"DEFAULT\": 0.052, \"MIN\": 0.030, \"MAX\": 0.090 },\n    { \"NAME\": \"drift\",     \"TYPE\": \"float\", \"DEFAULT\": 0.13,  \"MIN\": 0.0,   \"MAX\": 0.40  },\n    { \"NAME\": \"seamGlow\",  \"TYPE\": \"float\", \"DEFAULT\": 1.0,   \"MIN\": 0.2,   \"MAX\": 2.0   }\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n#define PERIOD 20.0\n#define GOLDEN 2.39996322973   // golden angle in radians (~137.5 deg)\n#define WIN 48                 // half-window of floret indices to test per pixel\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c,-s,s,c); }\n\n// iridescent cosine palette (thin-film-ish)\nvec3 pal(float t){\n  return 0.5 + 0.5 * cos(TAU * (t + vec3(0.00, 0.28, 0.55)));\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE.xy) / RENDERSIZE.y;\n\n  float ph = fract(TIME / PERIOD);\n  float spin = TAU * ph;\n\n  // gently animate the divergence angle -> parastichy families swim & reorganize.\n  // cos() returns to start at ph=0/1 so the loop is exact.\n  float ga  = GOLDEN + drift * 0.02 * (1.0 - cos(spin));\n  float rot0 = 0.35 * spin;                      // slow bloom rotation\n\n  float r = length(uv);\n  float n0 = r / seedScale; n0 = n0 * n0;        // inverse of radius = scale*sqrt(n)\n\n  // find the two nearest florets (for Voronoi cell + seam)\n  float best1 = 1e9, best2 = 1e9;\n  float bestN = 1.0;\n  vec2  bestP = vec2(0.0);\n  float base = floor(n0);\n\n  for (int i = 0; i < 2*WIN; i++){\n    float n = base + float(i - WIN);\n    if (n < 1.0) continue;\n    float ang = n * ga + rot0;\n    float rad = seedScale * sqrt(n);\n    vec2  p   = rad * vec2(cos(ang), sin(ang));\n    float d   = distance(uv, p);\n    if (d < best1){ best2 = best1; best1 = d; bestN = n; bestP = p; }\n    else if (d < best2){ best2 = d; }\n  }\n\n  // local seed spacing ~ d(radius)/dn = seedScale / (2 sqrt(n))\n  float spacing = seedScale / (2.0 * sqrt(max(n0, 1.0)));\n\n  // ---- shade the cell as a little domed gem ----\n  // dome radius sized to fill the Voronoi cell out to its corners\n  float domeR = spacing * 1.32;\n  float cd = clamp(best1 / max(domeR, 1e-4), 0.0, 1.0);  // 0 center -> 1 rim (clamped!)\n\n  // dome: fake a hemisphere z = sqrt(1 - cd^2); light from upper-left\n  float z  = sqrt(max(1.0 - cd * cd, 0.0));\n  vec2  gdir = (uv - bestP) / max(best1, 1e-4);   // radial normal in-plane\n  vec3  nrm = normalize(vec3(gdir * cd, z));\n  vec3  L   = normalize(vec3(-0.5, 0.7, 0.8));\n  float diff = max(dot(nrm, L), 0.0);\n  float spec = pow(max(dot(reflect(-L, nrm), vec3(0.0,0.0,1.0)), 0.0), 24.0);\n\n  // seam: bright ridge along the Voronoi boundary (where best1 ~ best2)\n  float edge = (best2 - best1) / max(spacing, 1e-4);\n  float seam = smoothstep(0.42, 0.0, edge);       // 1 on the boundary, 0 in cell interior\n\n  // color: hue travels SMOOTHLY across space (angle + radius) so neighbouring\n  // florets share a tone and the parastichy spirals read as coherent colour\n  // streams. A whisper of the floret index adds sparkle without chaos.\n  float ang = atan(uv.y, uv.x);\n  float hue = ang / TAU + r * 0.55 + bestN * 0.004 + ph;\n  vec3  cell = pal(hue);\n  cell = mix(vec3(dot(cell, vec3(0.33))), cell, 1.28);   // richer saturation\n\n  // assemble: deep glossy domed cabochon isolated by dark leading\n  float body = 0.28 + 0.75 * diff;                // lit gem, dark moody floor\n  vec3 col = cell * body;\n  col += cell * pow(max(1.0 - cd, 0.0), 2.5) * 0.45;  // backlight bloom toward center\n  col *= 0.52 + 0.48 * z;                          // rounding: rims fall to shadow\n  col += vec3(1.0, 0.97, 0.9) * spec * 1.30;       // glassy highlight per seed\n\n  // iridescent fresnel rim: each gem catches a lit edge -> jewel facet\n  float fres = pow(1.0 - z, 3.0);\n  col += pal(hue + 0.15) * fres * 0.40;\n\n  // dark leading: thin shadowed channel between glass cells (rose-window came)\n  float lead = smoothstep(0.16, 0.0, edge);        // 1 exactly on the seam\n  col *= 1.0 - 0.72 * lead;\n  // a hairline of cool light riding the very center of the leading -> depth\n  col += pal(hue + 0.5) * smoothstep(0.05, 0.0, edge) * seamGlow * 0.55;\n\n  // faint glossy pip at each seed center\n  col += vec3(1.0) * smoothstep(0.10, 0.0, cd) * 0.35;\n\n  // radial vignette so the head reads as one domed bloom on black\n  col *= smoothstep(1.16, 0.05, r);\n  col += pal(ph + 0.1) * 0.05 * smoothstep(0.45, 0.0, r);\n\n  // soft-knee tone map so specular pips don't clip flat\n  col = col / (1.0 + col * 0.75);\n  col = pow(col, vec3(0.88));\n\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}