{
  "license": "CC0-1.0",
  "shader": {
    "id": "rtqeyf3s",
    "title": "Pinwheel",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "galaxy",
      "spiral",
      "space",
      "stars",
      "cosmic",
      "deep-sea"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T15:51:14.143Z",
    "poster_url": "/posters/rtqeyf3s.avif",
    "stats": {
      "slops": 0,
      "views": 114,
      "forks": 0
    },
    "self": "/api/v1/shaders/rtqeyf3s",
    "isf": "/*{\n  \"DESCRIPTION\": \"Spiral galaxy — log-spiral arms of blue starlight winding out of a glowing core, threaded with dust lanes.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"arms\",  \"TYPE\": \"float\", \"DEFAULT\": 2.0, \"MIN\": 1.0, \"MAX\": 5.0 },\n    { \"NAME\": \"pitch\", \"TYPE\": \"float\", \"DEFAULT\": 4.0, \"MIN\": 1.5, \"MAX\": 8.0 },\n    { \"NAME\": \"spin\",  \"TYPE\": \"float\", \"DEFAULT\": 0.1, \"MIN\": 0.0, \"MAX\": 0.6 },\n    { \"NAME\": \"tint\",  \"TYPE\": \"float\", \"DEFAULT\": 0.5, \"MIN\": 0.0, \"MAX\": 1.0 }\n  ]\n}*/\n\n#define TAU 6.28318530718\nfloat hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); }\nfloat noise(vec2 p){\n  vec2 i = floor(p), f = fract(p); f = f * f * (3.0 - 2.0 * f);\n  float a = hash(i), b = hash(i + vec2(1.0, 0.0)), c = hash(i + vec2(0.0, 1.0)), d = hash(i + vec2(1.0, 1.0));\n  return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n  uv *= mat2(1.0, 0.0, 0.0, 0.72);                  // slight inclination (elliptical disk)\n  float r = length(uv);\n  float a = atan(uv.y, uv.x) + TIME * spin;\n\n  // logarithmic spiral arms (density wave)\n  float spiral = a * arms - log(r + 0.02) * pitch;\n  float arm = pow(0.5 + 0.5 * cos(spiral), 2.2);\n  float disk = exp(-r * 2.3);                       // galactic disk falloff\n  float density = arm * disk;\n\n  // dust lane: a dark offset copy on the inner edge of each arm\n  float dust = pow(0.5 + 0.5 * cos(spiral + 0.7), 3.0) * disk;\n  density *= 1.0 - 0.6 * dust;\n\n  // clumpy star clouds within the arms (follow the swirl)\n  vec2 sw = vec2(cos(a), sin(a)) * r;\n  float clump = 0.45 + 1.1 * noise(sw * 9.0 + spiral);\n  density *= clump;\n\n  vec3 armCol = mix(vec3(0.2, 0.45, 1.0), vec3(0.35, 0.4, 0.95), tint);   // blue starlight\n  vec3 col = vec3(0.0, 0.01, 0.03);                 // intergalactic dark\n  col += armCol * density * 2.2;\n  col += vec3(0.95, 0.4, 0.6) * pow(density, 2.0) * 0.8 * smoothstep(0.4, 0.9, clump);   // pink HII knots\n  col += vec3(0.85, 0.95, 1.0) * pow(density, 4.0) * 0.6;  // bright OB associations\n\n  // glowing core bulge (warm)\n  float core = exp(-r * r * 22.0);\n  col += vec3(1.0, 0.85, 0.6) * core * 1.4;\n  col += vec3(1.0, 0.95, 0.8) * exp(-r * r * 120.0) * 1.5; // bright nucleus\n\n  // stars — concentrated in the arms + a scattered halo\n  float sf = hash(floor(gl_FragCoord.xy));\n  float starHere = smoothstep(0.985, 1.0, sf) * (0.3 + 1.5 * density) + smoothstep(0.997, 1.0, sf);\n  col += vec3(0.9, 0.95, 1.0) * starHere * (0.6 + 0.4 * sin(TIME * 3.0 + sf * 40.0));\n\n  col *= 1.0 - 0.2 * dot(uv, uv);\n  col = col / (1.0 + 0.4 * col);\n  col = pow(max(col, 0.0), vec3(0.88));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}