mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 16:03:52 +00:00
Add Z-position logging and disable culling for debugging
Enhanced STORMWIND.WMO logging to show: - centerZ: local Z position of group center - sizeZ: height of the group - worldZ: world Z position after transform Removed all culling logic to see ALL groups rendering. This will help identify which groups are positioned HIGH (floating shell). User reports the shell is 'larger and floating above' the real cathedral, so we need to find groups with unusually high Z positions.
This commit is contained in:
parent
5ac070a65a
commit
6ca4399187
1 changed files with 9 additions and 19 deletions
|
|
@ -1002,31 +1002,21 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm:
|
||||||
glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f;
|
glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f;
|
||||||
glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f);
|
glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f);
|
||||||
float distToGroup = glm::length(cameraPos - glm::vec3(worldCenter));
|
float distToGroup = glm::length(cameraPos - glm::vec3(worldCenter));
|
||||||
|
|
||||||
|
// Log bounding box to identify groups that are positioned HIGH (floating shell)
|
||||||
|
glm::vec3 size = group.boundingBoxMax - group.boundingBoxMin;
|
||||||
LOG_INFO(" Group ", gi, ": flags=0x", std::hex, group.groupFlags, std::dec,
|
LOG_INFO(" Group ", gi, ": flags=0x", std::hex, group.groupFlags, std::dec,
|
||||||
" dist=", distToGroup, " verts=", group.vertexCount);
|
" verts=", group.vertexCount,
|
||||||
|
" centerZ=", groupCenter.z,
|
||||||
|
" sizeZ=", size.z,
|
||||||
|
" worldZ=", worldCenter.z);
|
||||||
}
|
}
|
||||||
loggedStormwindGroups = true; // Only log once to avoid spam
|
loggedStormwindGroups = true; // Only log once to avoid spam
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render groups with LOD shell culling
|
// Render groups (culling disabled for debugging)
|
||||||
glm::vec3 cameraPos = camera.getPosition();
|
|
||||||
for (uint32_t gi : dl.visibleGroups) {
|
for (uint32_t gi : dl.visibleGroups) {
|
||||||
const auto& group = model.groups[gi];
|
renderGroup(model.groups[gi], model, instance.modelMatrix, view, projection);
|
||||||
|
|
||||||
// LOD shell culling: hide distant groups when camera is close to WMO
|
|
||||||
// The "floating cathedral" is likely a distant LOD that should hide when you're near
|
|
||||||
glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f;
|
|
||||||
glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f);
|
|
||||||
float distToGroup = glm::length(cameraPos - glm::vec3(worldCenter));
|
|
||||||
float distToWMO = glm::length(cameraPos - instance.position);
|
|
||||||
|
|
||||||
// Skip groups that are far from camera (>200 units) when you're close to the WMO (<300 units)
|
|
||||||
// This hides the distant cathedral view when you're actually near/inside it
|
|
||||||
if (distToWMO < 300.0f && distToGroup > 200.0f) {
|
|
||||||
continue; // Skip distant LOD when near WMO
|
|
||||||
}
|
|
||||||
|
|
||||||
renderGroup(group, model, instance.modelMatrix, view, projection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lastPortalCulledGroups += dl.portalCulled;
|
lastPortalCulledGroups += dl.portalCulled;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue