mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
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:
parent
6563eebb60
commit
fb4ff46fe3
6 changed files with 193 additions and 41 deletions
|
|
@ -597,7 +597,17 @@ bool WMOLoader::loadGroup(const std::vector<uint8_t>& groupData,
|
|||
group.liquid.heights.clear();
|
||||
group.liquid.flags.clear();
|
||||
|
||||
if (vertexCount > 0 && bytesRemaining >= vertexCount * sizeof(float)) {
|
||||
// MLIQ vertex data: each vertex is 8 bytes —
|
||||
// 4 bytes flow/unknown data + 4 bytes float height.
|
||||
const size_t VERTEX_STRIDE = 8; // bytes per vertex
|
||||
if (vertexCount > 0 && bytesRemaining >= vertexCount * VERTEX_STRIDE) {
|
||||
group.liquid.heights.resize(vertexCount);
|
||||
for (size_t i = 0; i < vertexCount; i++) {
|
||||
parseOffset += 4; // skip flow/unknown data
|
||||
group.liquid.heights[i] = read<float>(groupData, parseOffset);
|
||||
}
|
||||
} else if (vertexCount > 0 && bytesRemaining >= vertexCount * sizeof(float)) {
|
||||
// Fallback: try reading as plain floats if stride doesn't fit
|
||||
group.liquid.heights.resize(vertexCount);
|
||||
for (size_t i = 0; i < vertexCount; i++) {
|
||||
group.liquid.heights[i] = read<float>(groupData, parseOffset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue