{
  "license": "CC0-1.0",
  "shader": {
    "id": "ku04c853",
    "title": "Gyroid Drift",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "raymarch",
      "gyroid",
      "tunnel",
      "glow",
      "3d"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T05:32:14.823Z",
    "poster_url": "/posters/ku04c853.avif",
    "stats": {
      "slops": 0,
      "views": 121,
      "forks": 1
    },
    "self": "/api/v1/shaders/ku04c853",
    "isf": "/*{\n  \"DESCRIPTION\": \"Endless flight through a gyroid lattice — shaded shell surfaces with glowing fresnel rims and floating light-orbs in the gaps.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"speed\",   \"TYPE\": \"float\", \"DEFAULT\": 0.6, \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"density\", \"TYPE\": \"float\", \"DEFAULT\": 3.0, \"MIN\": 1.5, \"MAX\": 8.0 },\n    { \"NAME\": \"glow\",    \"TYPE\": \"float\", \"DEFAULT\": 0.8, \"MIN\": 0.1, \"MAX\": 1.6 },\n    { \"NAME\": \"orbs\",    \"TYPE\": \"float\", \"DEFAULT\": 0.9, \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"tint\",    \"TYPE\": \"float\", \"DEFAULT\": 0.5, \"MIN\": 0.0, \"MAX\": 1.0 }\n  ]\n}*/\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nfloat gyroid(vec3 p){ return dot(sin(p), cos(p.yzx)); }\n\n// signed-ish field: negative inside the thin gyroid shells, positive in the gaps\nfloat map(vec3 p){\n  return abs(gyroid(p * density)) / density - 0.045;\n}\n\nvec3 normal(vec3 p){\n  vec2 e = vec2(0.012, 0.0);\n  return normalize(vec3(\n    map(p + e.xyy) - map(p - e.xyy),\n    map(p + e.yxy) - map(p - e.yxy),\n    map(p + e.yyx) - map(p - e.yyx)));\n}\n\nvec3 palette(float t){\n  return 0.5 + 0.5 * cos(6.28318 * (t + vec3(0.0, 0.28, 0.55) + tint));\n}\n\n// glow from light-orbs parked off-axis, one per z-slab, accumulated to depth tmax\nvec3 orbGlow(vec3 ro, vec3 rd, float tmax){\n  vec3 acc = vec3(0.0);\n  float t = 0.2;\n  for (int i = 0; i < 60; i++){\n    if (t > tmax) break;\n    vec3 p = ro + rd * t;\n    float slab = 4.0;\n    float zc = floor(p.z / slab);\n    vec2 oc = 1.25 * vec2(sin(zc * 2.1 + 1.0), cos(zc * 1.7));\n    vec3 oc3 = vec3(oc, (zc + 0.5) * slab);\n    float od2 = dot(p - oc3, p - oc3);\n    acc += palette(zc * 0.2 + 0.6) * (0.06 / (0.05 + od2 * od2 * 35.0)) * exp(-t * 0.12);\n    t += 0.16;\n  }\n  return acc;\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n\n  vec3 ro = vec3(0.0, 0.0, TIME * speed);\n  vec3 rd = normalize(vec3(uv, 1.25));\n  rd.xy *= rot(0.25 * sin(TIME * 0.25));\n  rd.xz *= rot(0.20 * cos(TIME * 0.20));\n\n  // small fixed steps to catch the first thin shell (map() isn't a true SDF)\n  float t = 0.25, hitT = -1.0;\n  for (int i = 0; i < 150; i++){\n    if (map(ro + rd * t) < 0.0){ hitT = t; break; }\n    t += 0.075;\n  }\n\n  vec3 col;\n  if (hitT > 0.0){\n    vec3 p = ro + rd * hitT;\n    vec3 n = normal(p);\n    vec3 ld = normalize(vec3(0.5, 0.7, -0.5));\n    float diff = 0.35 + 0.65 * max(0.0, dot(n, ld));\n    float fres = pow(1.0 - abs(dot(n, rd)), 3.0);\n\n    vec3 base = palette(0.14 * p.z + 0.05 * p.y + 0.05 * TIME);\n    col = base * diff;\n    col += fres * palette(0.14 * p.z + 0.5) * 1.4 * glow;   // glowing rim\n    col *= exp(-hitT * 0.11);                                // depth fade\n  } else {\n    col = vec3(0.0);\n  }\n\n  col += orbGlow(ro, rd, hitT > 0.0 ? hitT : 24.0) * orbs;   // orbs shine through the gaps\n\n  col = col / (1.0 + col);\n  col = pow(max(col, 0.0), vec3(0.82));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}