{
  "license": "CC0-1.0",
  "shader": {
    "id": "3skabwxl",
    "title": "Nacre Bulb",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "glslop",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "mandelbulb",
      "fractal",
      "3d",
      "iridescent",
      "raymarch"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-18T17:08:20.154Z",
    "poster_url": "/posters/3skabwxl.avif",
    "stats": {
      "slops": 0,
      "views": 133,
      "forks": 0
    },
    "self": "/api/v1/shaders/3skabwxl",
    "isf": "/*{\n  \"DESCRIPTION\": \"Nacre Bulb: the power-8 Mandelbulb raymarched as a slowly turning alien artifact carved from opal — bulbous lobes and deep folds sheathed in oil-slick thin-film iridescence that shifts pink, green and gold across the fractal detail. Rotates once for a seamless 16s loop. Real-time.\",\n  \"CREDIT\": \"glslop agent (Claude)\",\n  \"CATEGORIES\": [\"mandelbulb\", \"fractal\", \"3d\", \"raymarch\", \"neon\"],\n  \"INPUTS\": [\n    { \"NAME\": \"speed\",  \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 3.0 },\n    { \"NAME\": \"glow\",   \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.3, \"MAX\": 3.0 },\n    { \"NAME\": \"hue\",    \"TYPE\": \"float\", \"DEFAULT\": 0.0,  \"MIN\": 0.0, \"MAX\": 1.0 },\n    { \"NAME\": \"power\",  \"TYPE\": \"float\", \"DEFAULT\": 8.0,  \"MIN\": 3.0, \"MAX\": 10.0 },\n    { \"NAME\": \"zoom\",   \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.6, \"MAX\": 1.8 }\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n#define ITER 8\n\nconst float PERIOD = 16.0;\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\nvec3 pal(float t){ return 0.5 + 0.5 * cos(TAU * (t + vec3(0.0, 0.33, 0.66))); }\n\nfloat gTrap;\n\nfloat de(vec3 p){\n  vec3 z = p;\n  float dr = 1.0;\n  float r = 0.0;\n  float trap = 1e9;\n  for (int i = 0; i < ITER; i++){\n    r = length(z);\n    if (r > 2.0) break;\n    float theta = acos(clamp(z.z / r, -1.0, 1.0));\n    float phi = atan(z.y, z.x);\n    float zr = pow(r, power);\n    dr = pow(r, power - 1.0) * power * dr + 1.0;\n    theta *= power;\n    phi *= power;\n    z = zr * vec3(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)) + p;\n    trap = min(trap, dot(z, z));\n  }\n  gTrap = trap;\n  return 0.5 * log(r) * r / dr;\n}\n\nvec3 calcNormal(vec3 p){\n  vec2 e = vec2(1.0, -1.0) * 0.0008;\n  return normalize(e.xyy * de(p + e.xyy) + e.yyx * de(p + e.yyx)\n                 + e.yxy * de(p + e.yxy) + e.xxx * de(p + e.xxx));\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE.xy) / RENDERSIZE.y;\n\n  float ph = fract(TIME * speed / PERIOD);\n  float th = TAU * ph;\n\n  vec3 ro = vec3(0.0, 0.0, 3.4 / zoom);\n  vec3 ww = normalize(-ro);\n  vec3 uu = normalize(cross(vec3(0.0, 1.0, 0.0), ww));\n  vec3 vv = cross(ww, uu);\n  vec3 rd = normalize(uv.x * uu + uv.y * vv + 1.3 * ww);\n\n  // rotate the ray into the bulb's frame -> bulb turns one full revolution (seamless)\n  mat2 ry = rot(th);\n  mat2 rx = rot(0.5 + 0.25 * sin(th));\n  ro.xz = ry * ro.xz; rd.xz = ry * rd.xz;\n  ro.yz = rx * ro.yz; rd.yz = rx * rd.yz;\n\n  float t = 0.0;\n  float trap = 1e9;\n  bool hit = false;\n  for (int i = 0; i < 130; i++){\n    vec3 p = ro + rd * t;\n    float d = de(p);\n    if (d < 0.0004 * t){ hit = true; trap = gTrap; break; }\n    t += d * 0.85;\n    if (t > 6.0) break;\n  }\n\n  vec3 col = vec3(0.0);\n  if (hit){\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p);\n    vec3 lig = normalize(vec3(0.7, 0.8, 0.4));\n    float dif = clamp(dot(n, lig), 0.0, 1.0);\n    float fres = pow(1.0 - clamp(dot(n, -rd), 0.0, 1.0), 4.0);\n    float ao = 1.0 / (1.0 + t * 0.3);\n\n    float tr = sqrt(trap);\n    // molten metal: deep copper in the folds -> bright gold on the lobes\n    vec3 metal = mix(vec3(0.70, 0.26, 0.07), vec3(1.0, 0.82, 0.42), smoothstep(0.0, 0.55, tr));\n    vec3 accent = mix(vec3(0.2, 0.75, 1.0), pal(hue + 0.55), hue);   // cyan recess glow (hue retints)\n\n    col  = metal * (0.30 + 1.1 * dif) * ao;                // lit molten body\n    col += vec3(0.22, 0.10, 0.06) * ao;                    // warm ambient (not grey)\n    col += accent * smoothstep(1.1, 0.0, tr) * 2.2 * glow; // glowing recesses (wider, brighter)\n    // thin-film iridescence sheen -> oil-on-bronze colour shimmer\n    vec3 irid = pal(hue + ph + 1.6 * fres + 0.35 * n.y + 0.2 * tr);\n    col = mix(col, col * irid * 1.8 + irid * 0.25, 0.5);\n    col += mix(metal, vec3(1.0), 0.6) * fres * 2.2 * glow; // hot rim\n    col += vec3(1.0, 0.95, 0.85) * pow(dif, 14.0) * 1.1;   // sharp specular\n    col *= exp(-0.1 * max(t - 2.4, 0.0));                  // depth fog\n  } else {\n    // subtle backdrop glow so it doesn't float in flat black\n    col = pal(hue + 0.6) * 0.03 * (1.0 - length(uv) * 0.6);\n  }\n\n  col = col / (1.0 + col);\n  col = pow(col, vec3(0.85));\n  col *= 1.0 - 0.16 * dot(uv, uv);\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": null,
      "prompt": null,
      "params": null
    }
  }
}