mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +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
2089853e97
commit
252f29d29b
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::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f);
|
||||
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,
|
||||
" 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
|
||||
}
|
||||
|
||||
// Render groups with LOD shell culling
|
||||
glm::vec3 cameraPos = camera.getPosition();
|
||||
// Render groups (culling disabled for debugging)
|
||||
for (uint32_t gi : dl.visibleGroups) {
|
||||
const auto& group = model.groups[gi];
|
||||
|
||||
// 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);
|
||||
renderGroup(model.groups[gi], model, instance.modelMatrix, view, projection);
|
||||
}
|
||||
|
||||
lastPortalCulledGroups += dl.portalCulled;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue