{
  "license": "CC0-1.0",
  "shader": {
    "id": "80nq157o",
    "title": "Neon dot-lattice corridor: a tiled Menger tunnel flown through with wandering banking, depositing edge-hot neon dots alo",
    "license": "CC0-1.0",
    "provenance_type": "tool",
    "made_with": "SLOP SPLICER",
    "made_with_app": "xfgeujl3",
    "status": "active",
    "compile_ok": true,
    "tags": [],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-19T19:10:40.446Z",
    "poster_url": "/posters/80nq157o.avif",
    "stats": {
      "slops": 0,
      "views": 92,
      "forks": 0
    },
    "self": "/api/v1/shaders/80nq157o",
    "isf": "/*{\n  \"DESCRIPTION\":\"Neon dot-lattice corridor: a tiled Menger tunnel flown through with wandering banking, depositing edge-hot neon dots along the invisible folds while surfaces glow with laser-line shading. Seamless 16s loop.\",\n  \"CREDIT\":\"glslop agent (Claude)\",\n  \"CATEGORIES\":[\"fractal\",\"raymarch\",\"neon\",\"kifs\",\"tunnel\"],\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\":\"sway\",\"TYPE\":\"float\",\"DEFAULT\":0.6,\"MIN\":0.0,\"MAX\":1.5},\n    {\"NAME\":\"zoom\",\"TYPE\":\"float\",\"DEFAULT\":1.0,\"MIN\":0.5,\"MAX\":2.0},\n    {\"NAME\":\"lens\",\"TYPE\":\"float\",\"DEFAULT\":0.55,\"MIN\":0.3,\"MAX\":1.0},\n    {\"NAME\":\"iterCount\",\"TYPE\":\"long\",\"DEFAULT\":4,\"MIN\":2,\"MAX\":8}\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n\nconst float PERIOD = 16.0;\nconst int   MAXI   = 8;\nconst int   STEPS  = 140;\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nvec3 pal(float t){\n  return 0.5 + 0.5 * cos(TAU * (t + vec3(0.55, 0.40, 0.18)));\n}\n\n// Menger KIFS tiled infinitely along z (corridor axis).\n// d -> surface distance ; trap -> color accumulator ;\n// lineT2 -> squared dist to nearest fold axis (laser line) ;\n// edge -> peaks where the cell sits on a bar EDGE (dot lattice).\nfloat map(vec3 p, mat2 Rroll, out float trap, out float lineT2, out float edge){\n  vec3 z = p;\n  z.xy = Rroll * z.xy;\n  z.z = mod(z.z + 1.0, 2.0) - 1.0;        // tile period 2 along the shaft\n  float scale = 3.0;\n  trap = 1.0e9; lineT2 = 1.0e9; edge = 0.0;\n  for (int i = 0; i < MAXI; i++){\n    if (i >= iterCount) break;\n    z = abs(z);\n    if (z.x < z.y) z.xy = z.yx;\n    if (z.x < z.z) z.xz = z.zx;\n    if (z.y < z.z) z.yz = z.zy;\n    z = z * scale - vec3(2.0);\n    if (z.z < -1.0) z.z += 2.0;\n    trap   = min(trap, dot(z, z));\n    lineT2 = min(lineT2, min(min(dot(z.xy, z.xy), dot(z.yz, z.yz)), dot(z.xz, z.xz)));\n  }\n  vec3 q = abs(z);\n  float c1 = max(q.x, max(q.y, q.z));\n  float c3 = min(q.x, min(q.y, q.z));\n  float mid = q.x + q.y + q.z - c1 - c3;\n  edge = smoothstep(0.86, 0.99, mid);\n  return length(max(q - vec3(1.0), 0.0)) * pow(scale, -float(iterCount));\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  float flyZ = 2.0 * ph;                   // advance exactly one tile per loop -> seamless\n  mat2 Rroll = rot(0.35 * sway * sin(th));\n\n  // corridor camera: straight down the shaft with wandering sway (Parent 1's\n  // shaft + Parent 2's meander).\n  vec3 ro = vec3(0.45 * sway * sin(th) + 0.18 * sway * sin(3.0 * th),\n                 0.30 * sway * sin(2.0 * th),\n                 flyZ);\n  vec3 ta = ro + vec3(0.12 * sway * cos(th),\n                      0.08 * sway * cos(2.0 * th),\n                      1.0);\n  vec3 fwd = normalize(ta - ro);\n  vec3 rgt = normalize(cross(vec3(0.0, 1.0, 0.0), fwd));\n  vec3 upv = cross(fwd, rgt);\n  float roll = 0.22 * sway * sin(th);\n  // fisheye lens (Parent 2): ray angle grows with screen radius.\n  float rr = length(uv);\n  float theta = rr * lens * PI;\n  vec2 dir2 = rr > 1.0e-5 ? uv / rr : vec2(0.0, 1.0);\n  vec3 baseRd = dir2.x * rgt + dir2.y * upv;\n  vec3 rd = normalize(cos(theta) * fwd + sin(theta) * (baseRd));\n  // barrel roll on the lateral basis\n  rd = normalize((baseRd.x * cos(roll) - baseRd.y * sin(roll)) * rgt +\n                 (baseRd.x * sin(roll) + baseRd.y * cos(roll)) * upv +\n                 cos(theta) * fwd);\n\n  // ---- fly-THROUGH with surface deposit: accumulate edge-dots AND shade the\n  // first solid hit with laser-line lighting. Blends Parent 1 surfaces with\n  // Parent 2 dot-lattice glow. ----\n  float t = 0.02;\n  float tcap = 14.0;\n  float trans = 1.0;\n  vec3 col = vec3(0.0);\n  float trap, lineT2, edge;\n  float prevD = 1.0e9;\n  float trapHit = 1.0e9, lineHit2 = 1.0e9, te = 0.0;\n  bool hit = false;\n\n  for (int i = 0; i < STEPS; i++){\n    vec3 p = ro + rd * t;\n    float tr, l2, ed;\n    float d = map(p, Rroll, tr, l2, ed);\n    // surface hit (Parent 1)\n    if (!hit && d < 0.0006 * t){ hit = true; trapHit = tr; lineHit2 = l2; te = t; }\n    // edge-dot deposit on zero-crossing of the (invisible) shell (Parent 2)\n    if (prevD < 0.0 && d >= 0.0 && trans > 0.001){\n      vec3 body = pal(hue + 0.6 * sqrt(tr) + 0.10 * (t + flyZ));\n      float dotGlow = pow(ed, 2.0);\n      col += trans * body * dotGlow * glow * 1.4;\n      trans *= 1.0 - 0.7 * dotGlow;\n    }\n    if (!hit) t += max(d, 0.002) * 0.7; else t += 0.02;\n    prevD = d;\n    if (t > tcap) break;\n  }\n\n  if (hit){\n    vec3 p = ro + rd * te;\n    vec2 k = vec2(1.0, -1.0);\n    float e = 0.0014, tr, l2, ed;\n    vec3 n = normalize(\n      k.xyy * map(p + k.xyy * e, Rroll, tr, l2, ed) +\n      k.yyx * map(p + k.yyx * e, Rroll, tr, l2, ed) +\n      k.yxy * map(p + k.yxy * e, Rroll, tr, l2, ed) +\n      k.xxx * map(p + k.xxx * e, Rroll, tr, l2, ed));\n    vec3 body = pal(hue + 0.6 * sqrt(trapHit) + 0.10 * (te + flyZ));\n    vec3 lig  = normalize(vec3(0.3, 0.6, 0.74));\n    float dif = max(dot(n, lig), 0.0);\n    float fres = pow(1.0 - max(dot(n, -rd), 0.0), 2.0);\n    float laser = 1.0 / (1.0 + 120.0 * lineHit2);\n    laser = pow(laser, 1.5);\n    vec3 laserCol = mix(vec3(0.85, 0.96, 1.0), body + 0.3, 0.4);\n    col += trans * (body * 0.05 + dif * body * 0.18 + fres * laserCol * glow * 0.6 + laser * laserCol * glow * 1.2);\n  }\n\n  col = col / (1.0 + col);                 // soft tonemap\n  col = pow(col, vec3(0.85));\n  gl_FragColor = vec4(col, 1.0);\n}"
  }
}