{
  "format": "field",
  "version": 1,
  "meta": {
    "name": "Sashiko Indigo Weave",
    "author": "Infinite",
    "description": "Procedural aizome indigo warp-and-weft textile interference with rhythmic ivory running-stitch bands and warm weathered linen undertones.",
    "domain": "pixel"
  },
  "device": {
    "code": "# Sashiko Indigo Weave (Field Pixel)\nparam float scale = 18.0 [6.0, 36.0];\nparam float stitchFreq = 7.5 [2.0, 16.0];\nparam float dyeWash = 0.45 [0.1, 1.0];\n\np = vec2((uv.x - 0.5) * aspect, uv.y - 0.5);\n\n# Subtle organic cloth ripple\nwarpX = p.x + 0.025 * sin(p.y * 8.0 + t * 0.6);\nwarpY = p.y + 0.025 * cos(p.x * 7.5 - t * 0.5);\n\n# Woven cotton warp & weft threads\nthreadX = 0.5 + 0.5 * sin(warpX * scale * 12.566 + sin(warpY * scale * 6.283));\nthreadY = 0.5 + 0.5 * sin(warpY * scale * 12.566 + cos(warpX * scale * 6.283));\nweave = 0.5 * (threadX + threadY);\n\n# Patched indigo & linen dye zones\nzone = sin(warpX * 4.2 + 0.6) * cos(warpY * 3.8 - 0.4);\nbaseIndigo = vec3(0.063, 0.137, 0.259);\nmidIndigo = vec3(0.180, 0.341, 0.549);\nlinenOchre = vec3(0.580, 0.490, 0.365);\n\ndyeMix = clamp(0.5 + 0.5 * zone * dyeWash, 0.0, 1.0);\ncloth = mix(baseIndigo, midIndigo, dyeMix);\ncloth = mix(cloth, linenOchre, smoothstep(0.68, 0.92, zone) * 0.55);\ncloth = cloth * (0.76 + 0.36 * weave);\n\n# Rhythmic sashiko running-stitch bands (horizontal & vertical dashed threads)\ngridU = abs(fract(warpX * stitchFreq) - 0.5);\ngridV = abs(fract(warpY * stitchFreq * 2.0 + t * 0.15) - 0.5);\ndashV = smoothstep(0.32, 0.24, gridV);\nlineX = smoothstep(0.055, 0.015, gridU) * dashV;\n\ngridV2 = abs(fract(warpY * stitchFreq) - 0.5);\ngridU2 = abs(fract(warpX * stitchFreq * 2.0 - t * 0.12) - 0.5);\ndashU = smoothstep(0.32, 0.24, gridU2);\nlineY = smoothstep(0.055, 0.015, gridV2) * dashU;\n\nstitch = clamp(lineX + lineY, 0.0, 1.0);\nivory = vec3(0.937, 0.914, 0.859);\n\nvig = clamp(1.05 - 0.55 * dot(p, p), 0.35, 1.0);\ncol = clamp(mix(cloth, ivory, stitch * 0.88) * vig, 0.0, 1.0);\n",
    "params": {
      "scale": 18.0,
      "stitchFreq": 7.5,
      "dyeWash": 0.45
    }
  }
}
