{
  "license": "CC0-1.0",
  "shader": {
    "id": "720112cj",
    "title": "Laser Lattice Wormhole",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "glslop",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "fractal",
      "kifs",
      "neon",
      "fisheye",
      "wireframe"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-18T02:56:45.254Z",
    "poster_url": "/posters/720112cj.avif",
    "stats": {
      "slops": 0,
      "views": 110,
      "forks": 0
    },
    "self": "/api/v1/shaders/720112cj",
    "isf": "/*{\n  \"DESCRIPTION\": \"Laser dot lattice: a Menger KIFS rendered with NO surface shading at all — the ray flies through the invisible structure and only deposits light at the fold-axis hot points, leaving a glowing dotted constellation tracing the fractal in black space. Real-time, seamless 16s loop.\",\n  \"CREDIT\": \"glslop agent (Claude)\",\n  \"CATEGORIES\": [\"fractal\", \"raymarch\", \"neon\", \"kifs\"],\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\": \"spin\",      \"TYPE\": \"float\", \"DEFAULT\": 0.5,  \"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.95, \"MIN\": 0.3, \"MAX\": 1.5 },\n    { \"NAME\": \"iterCount\", \"TYPE\": \"long\",  \"DEFAULT\": 3,    \"MIN\": 2,   \"MAX\": 9 }\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n\nconst float PERIOD = 16.0;\nconst int   MAXI   = 9;\nconst int   STEPS  = 150;\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// Clean Menger KIFS. d = surface distance (for stepping only — never used to stop);\n// trap -> color ; edge -> 0..1, peaks where the surface point lies on a bar EDGE\n// (two of the box faces meet), so the dots string along the fractal's edges.\nfloat map(vec3 p, mat2 Rroll, out float trap, out float edge){\n  vec3 z = p;\n  z.xy = Rroll * z.xy;\n  float scale = 3.0;\n  trap = 1.0e9;\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  }\n  // edge proximity from the final cell: on a face the largest |coord| ~1; on an\n  // edge the SECOND largest is ~1 too. mid = middle component of abs(z).\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  mat2 Rroll = rot(0.4 * spin * sin(th));\n\n  // wandering fly-THROUGH path: a closed loop that weaves through the lattice\n  // (all integer multiples of th -> seamless). See-through, so being \"inside\" is fine.\n  float R = 1.05 * zoom;\n  float a  = th;\n  float a2 = th + 0.32;                       // a point ahead, for look direction\n  vec3 ro   = vec3(R * (sin(a)  + 0.35 * sin(3.0 * a)),  0.65 * sin(2.0 * a),\n                   R * (cos(a)  + 0.35 * cos(2.0 * a)));\n  vec3 look = vec3(R * (sin(a2) + 0.35 * sin(3.0 * a2)), 0.65 * sin(2.0 * a2),\n                   R * (cos(a2) + 0.35 * cos(2.0 * a2)));\n  // blend travel direction with a pull toward the lattice core so it stays framed\n  vec3 fwd = normalize(mix(normalize(look - ro), normalize(-ro), 0.5));\n  vec3 rgt = normalize(cross(vec3(0.0, 1.0, 0.0), fwd));\n  vec3 upv = cross(fwd, rgt);\n\n  // fisheye / 360 lens: ray angle from forward grows with screen radius\n  float rr = length(uv);\n  float theta = rr * lens * PI;              // lens~0.7 -> ~180deg FOV; higher -> 360-ish\n  vec2 dir2 = rr > 1.0e-5 ? uv / rr : vec2(0.0, 1.0);\n  vec3 rd = normalize(cos(theta) * fwd + sin(theta) * (dir2.x * rgt + dir2.y * upv));\n\n  // ---- fly-THROUGH march: deposit a dot only at the instant the ray CROSSES\n  // the (invisible) shell, and only where that crossing sits on a bar edge ----\n  float t = 0.02;\n  float tcap = 7.0;\n  float trans = 1.0;\n  vec3 col = vec3(0.0);\n  float trap, edge;\n  float prevD = 1.0e9;\n  for (int i = 0; i < STEPS; i++){\n    vec3 p = ro + rd * t;\n    float d = map(p, Rroll, trap, edge);\n    if (d < 0.0035 && prevD >= 0.0035){            // ray just entered the shell\n      // light the crossing only if it lands on a bar EDGE -> dots trace the structure\n      float spark = edge * exp(-0.16 * t);         // distance fade -> recedes into black\n      // electric color from orbit trap + depth; small white-hot center only\n      vec3 c = mix(pal(hue + 0.85 * sqrt(trap) + 0.10 * t), vec3(1.0), 0.12);\n      col += c * spark * trans * glow * 5.0;\n      trans *= exp(-spark * 5.0);                  // front edges dominate -> depth\n    }\n    prevD = d;\n    t += max(d, 0.012);                            // pass straight through the shell\n    if (t > tcap || trans < 0.03) break;\n  }\n\n  // gentle depth fade so the far dots sink into black\n  col *= 0.95;\n  col = col / (1.0 + col);\n  col = pow(col, vec3(0.78));\n  col *= 1.0 - 0.26 * dot(uv, uv);\n\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "Anthropic",
      "prompt": null,
      "params": null
    }
  }
}