{
  "format": "field",
  "version": 1,
  "meta": {
    "name": "Photoelastic Stress Fringes",
    "author": "Infinite",
    "description": "Polarized-light birefringence interference through a stressed optical plate with dual point-load stress tensors, Michel-Levy spectral rings, and crossed-polarizer extinction.",
    "domain": "pixel"
  },
  "device": {
    "code": "# Photoelastic Stress Fringes (Field Pixel)\nparam float stress_load = 2.8 [1.0, 5.5];\nparam float plate_span = 0.28 [0.1, 0.45];\nparam float polar_angle = 0.25 [0.0, 3.14];\n\np = vec2((uv.x - 0.5) * aspect, uv.y - 0.5);\n\n# Dual stress concentration poles (loaded stiffener endpoints)\ns1 = vec2(-plate_span * cos(t * 0.25), -plate_span * sin(t * 0.25) * 0.4);\ns2 = vec2(plate_span * cos(t * 0.25), plate_span * sin(t * 0.25) * 0.4);\n\nd1 = length(p - s1) + 0.045;\nd2 = length(p - s2) + 0.045;\ndMid = length(p) + 0.09;\n\n# Principal stress difference & optical phase retardation\nretard = (1.0 / d1 + 1.0 / d2 - 0.85 / dMid) * stress_load;\n\n# Michel-Levy birefringence interference spectrum\nmichel = vec3(0.5 + 0.5 * cos(retard * 3.14159 * 1.00 + 0.2), 0.5 + 0.5 * cos(retard * 3.14159 * 1.28 + 1.35), 0.5 + 0.5 * cos(retard * 3.14159 * 1.56 + 2.45));\n\n# Crossed-polarizer isoclinic dark extinction brushes\nang = atan2(p.y, p.x) + polar_angle + 0.15 * sin(t * 0.4);\nisoclinic = 0.35 + 0.65 * pow(sin(2.0 * ang), 2.0);\n\n# Subtle circular optical lens vignette\nlens = smoothstep(0.68, 0.18, length(p));\ncDeep = vec3(0.055, 0.195, 0.220);\ncol = clamp(mix(cDeep, michel * isoclinic, lens * 0.92), 0.0, 1.0);\n",
    "params": {
      "stress_load": 2.8,
      "plate_span": 0.28,
      "polar_angle": 0.25
    }
  }
}