{
  "format": "field",
  "version": 1,
  "meta": {
    "name": "Pinched Torus Caustics",
    "author": "Infinite",
    "description": "Topological pinched-torus light field with conformal meridian ribs, spectral violet-teal-copper dispersion, and luminous cusp caustics.",
    "domain": "pixel"
  },
  "device": {
    "code": "# Pinched Torus Caustics (Field Pixel)\nparam float pinch = 0.88 [0.3, 1.0];\nparam float meridians = 14.0 [6.0, 28.0];\nparam float dispersion = 1.15 [0.4, 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# Pinched torus minor-radius profile around polar angle a\nR0 = 0.27;\npFactor = max(0.06, 1.0 - pinch * (0.5 - 0.5 * cos(a + t * 0.35)));\nrTube = 0.135 * pFactor;\n\n# Distance to pinched torus shell\ndShell = abs(r - R0) - rTube;\nbody = smoothstep(0.04, -0.04, dShell);\nrim = smoothstep(0.025, 0.0, abs(dShell));\n\n# Meridian & parallel quad-lattice ribs\nuCoord = a + t * 0.35;\nvCoord = clamp((r - R0) / max(0.02, rTube), -1.0, 1.0);\nribU = smoothstep(0.14, 0.03, abs(fract(uCoord * meridians / 6.2831853) - 0.5));\nribV = smoothstep(0.14, 0.03, abs(fract(vCoord * 4.0) - 0.5));\nribs = clamp(ribU + ribV, 0.0, 1.0) * body;\n\n# Spectral topological gradient (violet -> teal -> copper)\nphase = 0.5 + 0.5 * cos(uCoord);\ncViolet = vec3(0.420, 0.306, 0.608);\ncTeal = vec3(0.240, 0.580, 0.640);\ncCopper = vec3(0.860, 0.560, 0.340);\n\nsurf = mix(cViolet, cTeal, smoothstep(0.0, 0.55, phase));\nsurf = mix(surf, cCopper, smoothstep(0.45, 1.0, phase));\n\n# Internal caustic glow around the pinch cusp\ncuspGlow = exp(-8.5 * length(p - vec2(-R0 * cos(t * 0.35), R0 * sin(t * 0.35)))) * dispersion;\n\nbg = vec3(0.055, 0.063, 0.094) + vec3(0.06, 0.08, 0.12) * exp(-4.5 * r);\nlight = surf * body * (0.65 + 0.35 * (1.0 - abs(vCoord))) + vec3(0.92, 0.90, 0.86) * ribs * 0.48 + cCopper * rim * 0.55 + vec3(0.85, 0.65, 0.95) * cuspGlow * 0.45;\n\ncol = clamp(mix(bg, light, clamp(body + rim + cuspGlow * 0.35, 0.0, 1.0)), 0.0, 1.0);\n",
    "params": {
      "pinch": 0.88,
      "meridians": 14.0,
      "dispersion": 1.15
    }
  }
}
