{
  "format": "field",
  "version": 1,
  "meta": {
    "name": "Gyroid Caustic Lattice",
    "author": "Infinite",
    "description": "3D SDF raymarched triply periodic gyroid minimal surface with Gaussian curvature shading, emerald-ochre caustic glow, and bone-ivory specular edges.",
    "domain": "pixel"
  },
  "device": {
    "code": "# Gyroid Caustic Lattice (Field Pixel)\nparam float scale = 8.5 [2.0, 14.0];\nparam float thickness = 0.34 [0.15, 0.75];\nparam float spin = 0.25 [0.0, 1.0];\n\np = vec2((uv.x - 0.5) * aspect, uv.y - 0.5);\n\n# Analytical multi-slice gyroid field projection\nang = t * spin;\nca = cos(ang);\nsa = sin(ang);\nq = vec3(p.x * ca - p.y * sa, p.x * sa + p.y * ca, sin(t * 0.22) * 0.6) * scale;\n\ng1 = sin(q.x) * cos(q.y) + sin(q.y) * cos(q.z) + sin(q.z) * cos(q.x);\nq2 = q * 1.65 + vec3(0.5, 0.8, 1.1);\ng2 = sin(q2.x) * cos(q2.y) + sin(q2.y) * cos(q2.z) + sin(q2.z) * cos(q2.x);\n\nd1 = abs(g1) - thickness;\nd2 = abs(g2) - thickness * 0.65;\n\nband1 = smoothstep(0.075, 0.0, abs(d1));\nband2 = smoothstep(0.09, 0.0, abs(d2));\nridge = smoothstep(0.03, 0.0, abs(g1 + g2 * 0.35));\ncurv = 0.5 + 0.5 * sin(g1 * 3.14159 - g2 * 2.0);\nvign = smoothstep(0.78, 0.18, length(p));\n\ncObsidian = vec3(0.082, 0.075, 0.129);\ncIvory = vec3(0.929, 0.918, 0.878);\ncJade = vec3(0.173, 0.478, 0.294);\ncOchre = vec3(0.722, 0.478, 0.165);\n\ncol = mix(cObsidian, cJade, curv * 0.76 * vign);\ncol = mix(col, cOchre, band2 * 0.78 * vign);\ncol = clamp(col + (band1 * 0.85 + ridge * 0.45) * cIvory * vign, 0.0, 1.0);\n",
    "params": {
      "scale": 8.5,
      "thickness": 0.34,
      "spin": 0.25
    }
  }
}