Warm water and low pH each push a coral polyp toward expelling its symbiotic algae (bleaching). Heat stress and acid stress are combined into one 0–1 stress value that drives coral colour, fish abundance and dissolved oxygen:
- heat = max(0, (T − 28°C) / 4)
- acid = max(0, (8.08 − pH) / 0.38)
- stress = min(1, 0.72·heat + 0.55·acid)
- cover = (1 − stress) · (0.72 + 0.22·nutrients)
- O₂ = 5.2 + 2.1·nutrients − 1.8·stress (mg/L)
This mirrors the same formulas used to drive the 3D scene — only the rendering differs.