{
  "license": "CC0-1.0",
  "shader": {
    "id": "gstbkfmm",
    "title": "Can't Find My Way Out",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "Claude",
    "status": "active",
    "compile_ok": true,
    "render_hash": "3f77cec2a6892008",
    "tags": [
      "fractal",
      "neon",
      "maze",
      "3d",
      "zoom",
      "flying",
      "cubes",
      "geometry"
    ],
    "parents": [],
    "author": "u7y1evhf0znj",
    "author_name": "ksin",
    "author_url": "/u/ksin",
    "created_at": "2026-07-22T13:49:48.055Z",
    "poster_url": "/posters/gstbkfmm.avif",
    "stats": {
      "slops": 3,
      "views": 295,
      "forks": 0
    },
    "self": "/api/v1/shaders/gstbkfmm",
    "isf": "/*{\n  \"DESCRIPTION\": \"Infinite neon fractal maze flythrough: a solid universe with corridors carved at three nested scales so every wall is itself a smaller maze. The camera threads the lattice with rounded right-angle turns; convex edges glow, sparse wall panels are lit windows, circuit lines crawl the grooves, a coloured scout light drifts ahead. Every knob exposed.\",\n  \"CREDIT\": \"CC0\",\n  \"CATEGORIES\": [\"generator\", \"abstract\", \"3d\"],\n  \"INPUTS\": [\n    { \"NAME\": \"speed\",     \"TYPE\": \"float\", \"DEFAULT\": 1.00, \"MIN\": 0.0,  \"MAX\": 3.0 },\n    { \"NAME\": \"fov\",       \"TYPE\": \"float\", \"DEFAULT\": 1.39, \"MIN\": 0.4,  \"MAX\": 2.0 },\n    { \"NAME\": \"turns\",     \"TYPE\": \"float\", \"DEFAULT\": 1.63, \"MIN\": 0.0,  \"MAX\": 2.0 },\n    { \"NAME\": \"smoothness\",\"TYPE\": \"float\", \"DEFAULT\": 0.60, \"MIN\": 0.0,  \"MAX\": 1.0 },\n    { \"NAME\": \"randomness\",\"TYPE\": \"float\", \"DEFAULT\": 1.00, \"MIN\": 0.0,  \"MAX\": 1.0 },\n    { \"NAME\": \"corrWidth\", \"TYPE\": \"float\", \"DEFAULT\": 0.91, \"MIN\": 0.5,  \"MAX\": 1.4 },\n    { \"NAME\": \"density\",   \"TYPE\": \"float\", \"DEFAULT\": 1.50, \"MIN\": 0.0,  \"MAX\": 1.5 },\n    { \"NAME\": \"detail\",    \"TYPE\": \"float\", \"DEFAULT\": 0.97, \"MIN\": 0.0,  \"MAX\": 1.0 },\n    { \"NAME\": \"edgeGlow\",  \"TYPE\": \"float\", \"DEFAULT\": 0.10, \"MIN\": 0.0,  \"MAX\": 2.5 },\n    { \"NAME\": \"circuits\",  \"TYPE\": \"float\", \"DEFAULT\": 1.67, \"MIN\": 0.0,  \"MAX\": 2.5 },\n    { \"NAME\": \"windows\",   \"TYPE\": \"float\", \"DEFAULT\": 2.36, \"MIN\": 0.0,  \"MAX\": 2.5 },\n    { \"NAME\": \"headlight\", \"TYPE\": \"float\", \"DEFAULT\": 1.00, \"MIN\": 0.0,  \"MAX\": 2.5 },\n    { \"NAME\": \"hue\",       \"TYPE\": \"float\", \"DEFAULT\": 0.58, \"MIN\": 0.0,  \"MAX\": 1.0 },\n    { \"NAME\": \"hueCycle\",  \"TYPE\": \"float\", \"DEFAULT\": 0.21, \"MIN\": 0.0,  \"MAX\": 0.3 },\n    { \"NAME\": \"depthHue\",  \"TYPE\": \"float\", \"DEFAULT\": 1.28, \"MIN\": 0.0,  \"MAX\": 2.5 },\n    { \"NAME\": \"saturate\",  \"TYPE\": \"float\", \"DEFAULT\": 1.54, \"MIN\": 0.0,  \"MAX\": 2.0 },\n    { \"NAME\": \"fog\",       \"TYPE\": \"float\", \"DEFAULT\": 1.00, \"MIN\": 0.0,  \"MAX\": 2.5 }\n  ]\n}*/\n\n// FRACTAL MAZE — ISF port of the Shadertoy/WebGL2 version.\n// GLSL ES 1.00: constant loop bounds, gl_FragColor, RENDERSIZE/TIME.\n\n#define TAU 6.28318530718\n\n#define uSpeed    speed\n#define uFov      fov\n#define uTurns    turns\n#define uSmooth   smoothness\n#define uRandom   randomness\n#define uWidth    corrWidth\n#define uDensity  density\n#define uDetail   detail\n#define uEdgeGlow edgeGlow\n#define uStrips   circuits\n#define uWindows  windows\n#define uLight    headlight\n#define uHue      hue\n#define uHueCycle hueCycle\n#define uZHue     depthHue\n#define uSat      saturate\n#define uFog      fog\n\n#define iTime TIME\n\nconst float CELL = 3.0;\n\n// ---- hashes / palette --------------------------------------------\nfloat hash21(vec2 p){\n    p = fract(p * vec2(234.34, 435.345));\n    p += dot(p, p + 34.23);\n    return fract(p.x * p.y);\n}\n\nfloat hash31(vec3 p){\n    p = fract(p * 0.1031);\n    p += dot(p, p.zyx + 31.32);\n    return fract((p.x + p.y) * p.z);\n}\n\nvec3 palette(float h){\n    return 0.5 + 0.5 * cos(TAU * (h + vec3(0.0, 0.33, 0.67)));\n}\n\n// 1D value noise for the irregular camera-path wander\nfloat hash11(float p){ return fract(sin(p * 127.1) * 43758.5453123); }\nfloat vnoise(float x){\n    float i = floor(x), f = fract(x);\n    f = f * f * (3.0 - 2.0 * f);\n    return mix(hash11(i), hash11(i + 1.0), f);\n}\n\n// ---- camera path -------------------------------------------------\nfloat stairs(float x){\n    float f = fract(x);\n    float hw = mix(0.14, 0.5, clamp(uSmooth, 0.0, 1.0));\n    return floor(x) + smoothstep(0.5 - hw, 0.5 + hw, f);\n}\n\nvec3 pathPos(float z){\n    float zc = z / CELL;\n    float sgx = 1.0 * sin(zc * 0.19) + 0.7 * sin(zc * 0.47 + 2.7);\n    float sgy = 0.85 * sin(zc * 0.15 + 5.0) + 0.45 * sin(zc * 0.33 + 1.0);\n    float ngx = ((vnoise(zc / 3.5  + 3.0)  - 0.5) + 0.5 * (vnoise(zc / 1.575 + 9.0)  - 0.5)) * 1.60;\n    float ngy = ((vnoise(zc / 3.9  + 21.0) - 0.5) + 0.5 * (vnoise(zc / 1.75  + 40.0) - 0.5)) * 1.35;\n    float gx = mix(sgx, ngx, uRandom) * uTurns;\n    float gy = mix(sgy, ngy, uRandom) * uTurns;\n    return vec3((stairs(gx) + 0.5) * CELL, (stairs(gy) + 0.5) * CELL, z);\n}\n\n// ---- the maze ----------------------------------------------------\n// Corridors reach through any cell face whose symmetric hash rolls\n// open, each half-tube overshooting the shared face by w so adjacent\n// cells describe identical geometry at the seam (continuous field).\nfloat carveScale(vec3 p, float s, float prob, float w, float seed){\n    vec3 id = floor(p / s);\n    vec3 f = p - (id + 0.5) * s;\n    float hs = 0.5 * s;\n    float e = hs + w;\n    float d = 1e9;\n\n    float crx = max(abs(f.y), abs(f.z)) - w;\n    if (hash31(id + vec3( 0.5, 0.0, 0.0) + seed) < prob)\n        d = min(d, max(crx, max( f.x - e, -f.x - w)));\n    if (hash31(id + vec3(-0.5, 0.0, 0.0) + seed) < prob)\n        d = min(d, max(crx, max(-f.x - e,  f.x - w)));\n\n    float sz = seed + 33.17;\n    float crz = max(abs(f.x), abs(f.y)) - w;\n    if (hash31(id + vec3(0.0, 0.0,  0.5) + sz) < prob)\n        d = min(d, max(crz, max( f.z - e, -f.z - w)));\n    if (hash31(id + vec3(0.0, 0.0, -0.5) + sz) < prob)\n        d = min(d, max(crz, max(-f.z - e,  f.z - w)));\n\n    float sy = seed + 71.73;\n    float py = prob * 0.45;\n    float cry = max(abs(f.x), abs(f.z)) - w;\n    if (hash31(id + vec3(0.0,  0.5, 0.0) + sy) < py)\n        d = min(d, max(cry, max( f.y - e, -f.y - w)));\n    if (hash31(id + vec3(0.0, -0.5, 0.0) + sy) < py)\n        d = min(d, max(cry, max(-f.y - e,  f.y - w)));\n\n    return d;\n}\n\nfloat map(vec3 p){\n    float w0 = 0.34 * CELL * uWidth;\n\n    float carve = carveScale(p, CELL, 0.58 * uDensity, w0, 0.0);\n\n    // guaranteed corridor along the camera path; scaled by 0.2 to stay\n    // Lipschitz-safe near turns (keeps the raymarch from over-stepping\n    // and punching sharp \"blade\" shards through the walls). Scaling an\n    // SDF by a positive constant does not move its zero-crossing.\n    vec3 pc = pathPos(p.z);\n    carve = min(carve, (max(abs(p.x - pc.x), abs(p.y - pc.y)) - w0) * 0.2);\n\n    // nested detail: the walls are themselves mazes\n    if (uDetail > 0.25){\n        float s1 = CELL / 3.0;\n        carve = min(carve, carveScale(p, s1, 0.42 * uDensity, 0.30 * s1 * uWidth, 101.3));\n    }\n    if (uDetail > 0.75){\n        float s2 = CELL / 9.0;\n        carve = min(carve, carveScale(p, s2, 0.45 * uDensity, 0.32 * s2 * uWidth, 57.7));\n    }\n    return -carve;\n}\n\nvec3 calcNormal(vec3 p){\n    vec2 e = vec2(0.0015, -0.0015);\n    return normalize(e.xyy * map(p + e.xyy) + e.yyx * map(p + e.yyx) +\n                     e.yxy * map(p + e.yxy) + e.xxx * map(p + e.xxx));\n}\n\nfloat calcAO(vec3 p, vec3 n){\n    float occ = 0.0;\n    float sca = 1.0;\n    for (int i = 0; i < 5; i++){\n        float h = 0.02 + 0.11 * float(i);\n        occ += (h - map(p + n * h)) * sca;\n        sca *= 0.72;\n    }\n    return clamp(1.0 - 1.4 * occ, 0.0, 1.0);\n}\n\nfloat edgeGlowAt(vec3 p, float h){\n    float d0 = map(p);\n    float s = map(p + vec3( h, 0.0, 0.0)) + map(p - vec3( h, 0.0, 0.0))\n            + map(p + vec3(0.0,  h, 0.0)) + map(p - vec3(0.0,  h, 0.0))\n            + map(p + vec3(0.0, 0.0,  h)) + map(p - vec3(0.0, 0.0,  h));\n    return clamp((s / 6.0 - d0) / h * 4.0, 0.0, 1.0);\n}\n\nvec3 shade(vec3 ro, vec3 rd, float t, float zt, float hue0){\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p);\n    float ao = calcAO(p, n);\n    vec3 an = abs(n);\n    float hue = hue0 + p.z * 0.012 * uZHue;\n    float dfade = exp(-t * 0.06);\n\n    float tint = hash31(floor(p / CELL) + 7.7);\n    vec3 alb = mix(vec3(0.16, 0.17, 0.20), vec3(0.23, 0.21, 0.27), tint);\n\n    float gs = 0.5;\n    vec3 fr = fract(p / gs);\n    vec3 dl = gs * min(fr, 1.0 - fr);\n    float lm = 0.0;\n    lm = max(lm, (1.0 - smoothstep(0.006, 0.028, dl.x)) * (1.0 - an.x));\n    lm = max(lm, (1.0 - smoothstep(0.006, 0.028, dl.y)) * (1.0 - an.y));\n    lm = max(lm, (1.0 - smoothstep(0.006, 0.028, dl.z)) * (1.0 - an.z));\n    lm *= dfade;\n\n    float lh = hash31(floor(p / gs) + 13.7);\n    float circuit = lm * step(0.72, lh) * (0.7 + 0.3 * sin(iTime * 2.0 + lh * TAU * 3.0));\n\n    vec3 wq = abs(fract(p) - 0.5);\n    float inset = max(wq.x * (1.0 - an.x), max(wq.y * (1.0 - an.y), wq.z * (1.0 - an.z)));\n    float wh = hash31(floor(p) + 91.7);\n    float thr = 1.0 - 0.11 * uWindows;\n    float wmask = (1.0 - smoothstep(0.27, 0.33, inset)) * step(thr, wh)\n                * (0.65 + 0.35 * sin(iTime * 1.5 + wh * TAU * 5.0));\n\n    float trim = edgeGlowAt(p, 0.06) * uEdgeGlow;\n\n    vec3 lp = ro + vec3(0.0, 0.2, 0.0);\n    vec3 ld = lp - p;\n    float lr = max(length(ld), 1e-3);\n    ld /= lr;\n    float att = 1.0 / (1.0 + 0.14 * lr * lr);\n    float dif = max(dot(n, ld), 0.0) * att;\n    float spe = pow(max(dot(reflect(rd, n), ld), 0.0), 24.0) * att;\n\n    vec3 lp2 = pathPos(zt + 9.0 + 3.0 * sin(iTime * 0.4));\n    vec3 ld2 = lp2 - p;\n    float lr2 = max(length(ld2), 1e-3);\n    float att2 = 1.0 / (1.0 + 0.20 * lr2 * lr2);\n    float dif2 = max(dot(n, ld2 / lr2), 0.0) * att2;\n\n    vec3 neon = palette(hue);\n    vec3 col = alb * (0.05 + 1.5 * dif * uLight) * ao;\n    col += alb * palette(hue + 0.45) * dif2 * 2.2 * uLight;\n    col *= 1.0 - 0.45 * lm;\n    col += vec3(0.9) * spe * 0.5 * uLight * ao;\n    col += neon * trim * 1.5 * (0.3 + 0.7 * ao);\n    col += neon * circuit * 1.1 * uStrips;\n    col += palette(hue + 0.13 + wh * 0.35) * wmask * 2.0;\n    return col;\n}\n\nvoid main(){\n    vec2 fragCoord = gl_FragCoord.xy;\n    vec2 uv = (2.0 * fragCoord - RENDERSIZE.xy) / RENDERSIZE.y;\n\n    float zt = iTime * 3.2 * uSpeed + 0.4;\n    vec3 ro = pathPos(zt);\n    vec3 ta = pathPos(zt + 2.4);\n    vec3 fw = normalize(ta - ro);\n\n    float lean = clamp(-0.22 * (pathPos(zt + 2.8).x - ro.x) / CELL, -0.35, 0.35);\n    vec3 wup = vec3(sin(lean), cos(lean), 0.0);\n    vec3 rt = normalize(cross(fw, wup));\n    vec3 up = cross(rt, fw);\n    float focal = 1.15 / max(uFov, 0.25);\n    vec3 rd = normalize(uv.x * rt + uv.y * up + fw * focal);\n\n    float hue0 = uHue + iTime * uHueCycle;\n\n    const float TMAX = 48.0;\n    float t = 0.0;\n    float d = 0.0;\n    for (int i = 0; i < 150; i++){\n        d = map(ro + rd * t);\n        if (d < 0.0013 * (1.0 + t * 1.2) || t > TMAX) break;\n        t += d * 0.8;\n    }\n\n    bool hit = t < TMAX && d < 0.05;\n    vec3 fogc = palette(hue0 + t * 0.008 * uZHue) * 0.10 + vec3(0.010, 0.012, 0.020);\n    vec3 col;\n    if (hit){\n        col = shade(ro, rd, t, zt, hue0);\n        float fga = 1.0 - exp(-t * t * 0.0014 * uFog);\n        col = mix(col, fogc, fga);\n    } else {\n        col = fogc;\n    }\n\n    float lum = dot(col, vec3(0.299, 0.587, 0.114));\n    col = mix(vec3(lum), col, uSat);\n    col = 1.0 - exp(-col * 1.7);\n    col = pow(col, vec3(0.4545));\n    col *= 1.0 - 0.28 * dot(uv * 0.55, uv * 0.55);\n    col += (hash21(fragCoord + fract(iTime)) - 0.5) / 256.0;\n    gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4.8",
      "provider": null,
      "prompt": null,
      "params": null
    }
  }
}