{
  "license": "CC0-1.0",
  "shader": {
    "id": "4bq77im4",
    "title": "Truchet Weave",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "truchet",
      "tiles",
      "pattern",
      "geometric",
      "circuit"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T05:32:16.168Z",
    "poster_url": "/posters/4bq77im4.avif",
    "stats": {
      "slops": 0,
      "views": 96,
      "forks": 0
    },
    "self": "/api/v1/shaders/4bq77im4",
    "isf": "/*{\n  \"DESCRIPTION\": \"Three parallax layers of animated Truchet arcs woven over a glowing plasma backdrop — an endless self-knitting circuit.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"scale\",  \"TYPE\": \"float\", \"DEFAULT\": 5.0, \"MIN\": 2.0, \"MAX\": 12.0 },\n    { \"NAME\": \"thick\",  \"TYPE\": \"float\", \"DEFAULT\": 0.11, \"MIN\": 0.03, \"MAX\": 0.3 },\n    { \"NAME\": \"drift\",  \"TYPE\": \"float\", \"DEFAULT\": 0.4, \"MIN\": 0.0, \"MAX\": 1.5 },\n    { \"NAME\": \"hue\",    \"TYPE\": \"float\", \"DEFAULT\": 0.55, \"MIN\": 0.0, \"MAX\": 1.0 }\n  ]\n}*/\n\nfloat hash(vec2 p){\n  p = fract(p * vec2(127.1, 311.7));\n  p += dot(p, p + 34.5);\n  return fract(p.x * p.y * 95.43);\n}\n\nvec3 palette(float t){\n  return 0.5 + 0.5 * cos(6.28318 * (t + vec3(0.0, 0.33, 0.67) + hue));\n}\n\n// one Truchet layer -> vec2(line coverage, flowing pulse)\nvec2 truchet(vec2 uv, float scl, float seed){\n  uv *= scl;\n  vec2 id = floor(uv);\n  vec2 f = fract(uv) - 0.5;\n  float h = hash(id + seed * 17.0);\n  float flip = step(0.5, fract(h + 0.15 * floor(TIME * 0.5 + h * 3.0)));\n  if (flip > 0.5) f.x = -f.x;\n\n  float d1 = abs(length(f - vec2(0.5, 0.5)) - 0.5);\n  float d2 = abs(length(f - vec2(-0.5, -0.5)) - 0.5);\n  float d = min(d1, d2);\n\n  float t = thick * (0.7 + 0.3 * sin(TIME + h * 6.28));\n  float line = smoothstep(t, t - 0.045, d);\n  float ang = atan(f.y, f.x);\n  float pulse = 0.5 + 0.5 * sin(ang * 4.0 - TIME * 3.0 + h * 6.28);\n  return vec2(line, pulse);\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n\n  // cohesive backdrop so the weave reads as one fabric, not lines on void\n  vec3 col = 0.10 * palette(0.18 * length(uv) - 0.05 * TIME)\n                 * (0.6 + 0.4 * sin(uv.x * 3.0 + uv.y * 2.0 + TIME));\n\n  // three layers at increasing scale, parallax-drifting, sharing one palette\n  for (int L = 0; L < 3; L++){\n    float fl = float(L);\n    float scl = scale * (0.7 + 0.55 * fl);\n    vec2 off = vec2(0.13, 0.09) * TIME * drift * (fl + 1.0) + fl * 1.7;\n    vec2 tr = truchet(uv + off, scl, fl);\n    float depth = 1.0 - 0.22 * fl;                 // nearer layers brighter\n    vec3 c = palette(0.16 * fl + 0.12 * tr.y + 0.05 * TIME);\n    col += tr.x * c * depth * (0.45 + 0.75 * tr.y);\n    col += tr.x * 0.12 * depth;                     // core highlight\n  }\n\n  col *= 1.0 - 0.25 * dot(uv, uv);                  // vignette\n  col = col / (1.0 + 0.6 * col);                    // tonemap layered glow\n  col = pow(max(col, 0.0), vec3(0.9));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}