{
  "format": "field",
  "version": 1,
  "meta": {
    "name": "Bayer Ditherpunk Wave",
    "author": "Infinite",
    "description": "1-bit ordered 4x4 Bayer matrix halftone dithering over interference waves, rendering stark architectural stipple gradients in bone ivory and obsidian.",
    "domain": "pixel"
  },
  "device": {
    "code": "# Bayer Ditherpunk Wave (Field Pixel)\nparam float scale = 140.0 [48.0, 260.0];\nparam float wave_freq = 7.5 [2.0, 16.0];\nparam float contrast = 1.35 [0.7, 2.2];\n\np = vec2((uv.x - 0.5) * aspect, uv.y - 0.5);\nr = length(p);\na = atan2(p.y, p.x);\n\n# Interference field\nw1 = sin(r * wave_freq * 3.14159 - t * 1.6 + sin(a * 3.0 + t * 0.4) * 1.4);\nw2 = cos((p.x * 1.3 - p.y * 0.9) * wave_freq * 2.1 + t * 0.9);\nlum = clamp(0.5 + 0.34 * w1 + 0.24 * w2 - r * 0.45, 0.0, 1.0);\nlum = clamp((lum - 0.5) * contrast + 0.5, 0.0, 1.0);\n\n# 4x4 Bayer ordered threshold approximation via spatial bit-grid\ngx = floor(uv.x * scale * aspect) % 4.0;\ngy = floor(uv.y * scale) % 4.0;\nbayer = fract(sin(gx * 12.9898 + gy * 78.233) * 43758.5453) * 0.72 + (gx * 0.07 + gy * 0.05);\n\nbit = step(bayer, lum);\nedge = smoothstep(0.08, 0.0, abs(lum - 0.5));\n\ncObsidian = vec3(0.059, 0.063, 0.075);\ncIvory = vec3(0.937, 0.918, 0.878);\ncVermilion = vec3(0.84, 0.27, 0.19);\n\ncol = clamp(mix(cObsidian, cIvory, bit) + edge * cVermilion * 0.55, 0.0, 1.0);\n",
    "params": {
      "scale": 140.0,
      "wave_freq": 7.5,
      "contrast": 1.35
    }
  }
}