Fix WMO water rendering: correct MLIQ parsing, tile masking, and depth effects

- Fix MLIQ vertex stride: each vertex is 8 bytes (4 flow + 4 height), not 4
- Use MLIQ tile flags to mask out tiles with no liquid (bridges, covered areas)
- Disable wave displacement on WMO water to prevent edge slosh artifacts
- Convert screen-space depth to vertical depth for shoreline foam and water
  transparency, preventing false shoreline effects on occluding geometry
- Add underwater blue fog overlay and scene fog shift (terrain water only)
- Add getNearestWaterHeightAt to avoid false underwater detection from
  elevated WMO water surfaces
- Tint refracted scene toward water color to mask occlusion edge artifacts
- Lower WMO water by 1 unit to match terrain water level
This commit is contained in:
Kelsi 2026-02-23 00:18:32 -08:00
parent 6563eebb60
commit fb4ff46fe3
6 changed files with 193 additions and 41 deletions

View file

@ -125,7 +125,12 @@ public:
bool isEnabled() const { return renderingEnabled; }
std::optional<float> getWaterHeightAt(float glX, float glY) const;
/// Like getWaterHeightAt but only returns water surfaces whose height is
/// close to the query Z (within maxAbove units above). Avoids false
/// underwater detection from elevated WMO water far above the camera.
std::optional<float> getNearestWaterHeightAt(float glX, float glY, float queryZ, float maxAbove = 15.0f) const;
std::optional<uint16_t> getWaterTypeAt(float glX, float glY) const;
bool isWmoWaterAt(float glX, float glY) const;
int getSurfaceCount() const { return static_cast<int>(surfaces.size()); }