mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
chore(editor): remove debug logging now that NPC rendering works
This commit is contained in:
parent
687923c885
commit
ca630c4e87
2 changed files with 6 additions and 30 deletions
|
|
@ -945,12 +945,6 @@ void M2Renderer::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const
|
||||||
|
|
||||||
auto mdlIt = models.find(groupModelId);
|
auto mdlIt = models.find(groupModelId);
|
||||||
if (mdlIt == models.end() || !mdlIt->second.vertexBuffer || !mdlIt->second.indexBuffer) {
|
if (mdlIt == models.end() || !mdlIt->second.vertexBuffer || !mdlIt->second.indexBuffer) {
|
||||||
if (forceNoCull_ && mdlIt != models.end()) {
|
|
||||||
LOG_WARNING("M2 skip model ", groupModelId, " '", mdlIt->second.name,
|
|
||||||
"': vb=", (void*)mdlIt->second.vertexBuffer,
|
|
||||||
" ib=", (void*)mdlIt->second.indexBuffer,
|
|
||||||
" batches=", mdlIt->second.batches.size());
|
|
||||||
}
|
|
||||||
visStart = groupEnd;
|
visStart = groupEnd;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1010,13 +1004,7 @@ void M2Renderer::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const
|
||||||
pending.push_back({entry.index, instanceFadeAlpha, needsBones, targetLOD});
|
pending.push_back({entry.index, instanceFadeAlpha, needsBones, targetLOD});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pending.empty()) {
|
if (pending.empty()) { visStart = groupEnd; continue; }
|
||||||
if (forceNoCull_) {
|
|
||||||
LOG_WARNING("M2 render: model '", model.name, "' all ",
|
|
||||||
(groupEnd - visStart), " instances filtered out (bones?)");
|
|
||||||
}
|
|
||||||
visStart = groupEnd; continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort by targetLOD so each sub-group occupies a contiguous SSBO range
|
// Sort by targetLOD so each sub-group occupies a contiguous SSBO range
|
||||||
std::sort(pending.begin(), pending.end(),
|
std::sort(pending.begin(), pending.end(),
|
||||||
|
|
|
||||||
|
|
@ -269,9 +269,8 @@ void EditorViewport::rebuildObjects(const std::vector<PlacedObject>& objects,
|
||||||
|
|
||||||
// Render NPC creatures as M2 instances
|
// Render NPC creatures as M2 instances
|
||||||
if (m2Renderer_ && !npcs.empty()) {
|
if (m2Renderer_ && !npcs.empty()) {
|
||||||
LOG_WARNING("NPC rebuild: ", npcs.size(), " creatures to load");
|
|
||||||
for (const auto& npc : npcs) {
|
for (const auto& npc : npcs) {
|
||||||
if (npc.modelPath.empty()) { LOG_WARNING("NPC has empty modelPath: ", npc.name); continue; }
|
if (npc.modelPath.empty()) continue;
|
||||||
uint32_t modelId;
|
uint32_t modelId;
|
||||||
auto it = m2ModelIds.find(npc.modelPath);
|
auto it = m2ModelIds.find(npc.modelPath);
|
||||||
if (it != m2ModelIds.end()) {
|
if (it != m2ModelIds.end()) {
|
||||||
|
|
@ -315,7 +314,7 @@ void EditorViewport::rebuildObjects(const std::vector<PlacedObject>& objects,
|
||||||
pipeline::M2Material mat; mat.flags = 0; mat.blendMode = 0;
|
pipeline::M2Material mat; mat.flags = 0; mat.blendMode = 0;
|
||||||
model.materials.push_back(mat);
|
model.materials.push_back(mat);
|
||||||
loaded = true;
|
loaded = true;
|
||||||
LOG_WARNING("NPC loaded from WOM: ", prefix, womBase);
|
LOG_DEBUG("NPC loaded from WOM: ", prefix, womBase);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -345,7 +344,7 @@ void EditorViewport::rebuildObjects(const std::vector<PlacedObject>& objects,
|
||||||
" (verts=", model.vertices.size(), " idx=", model.indices.size(), ")");
|
" (verts=", model.vertices.size(), " idx=", model.indices.size(), ")");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOG_WARNING("NPC M2 OK: ", npc.modelPath, " (",
|
LOG_DEBUG("NPC M2 OK: ", npc.modelPath, " (",
|
||||||
model.vertices.size(), "v ", model.indices.size(), "i ",
|
model.vertices.size(), "v ", model.indices.size(), "i ",
|
||||||
model.batches.size(), "b)");
|
model.batches.size(), "b)");
|
||||||
if (model.boundRadius < 1.0f) model.boundRadius = 50.0f;
|
if (model.boundRadius < 1.0f) model.boundRadius = 50.0f;
|
||||||
|
|
@ -385,14 +384,9 @@ void EditorViewport::rebuildObjects(const std::vector<PlacedObject>& objects,
|
||||||
}
|
}
|
||||||
for (const auto& npc : npcs) {
|
for (const auto& npc : npcs) {
|
||||||
auto it = m2ModelIds.find(npc.modelPath);
|
auto it = m2ModelIds.find(npc.modelPath);
|
||||||
if (it == m2ModelIds.end()) {
|
if (it == m2ModelIds.end()) continue;
|
||||||
LOG_WARNING("NPC instance skip — no loaded model for: ", npc.modelPath);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
glm::vec3 rotRad = glm::radians(glm::vec3(0, 0, npc.orientation));
|
glm::vec3 rotRad = glm::radians(glm::vec3(0, 0, npc.orientation));
|
||||||
uint32_t instId = m2Renderer_->createInstance(it->second, npc.position, rotRad, npc.scale);
|
m2Renderer_->createInstance(it->second, npc.position, rotRad, npc.scale);
|
||||||
LOG_WARNING("NPC instance created: id=", instId, " modelId=", it->second,
|
|
||||||
" pos=(", npc.position.x, ",", npc.position.y, ",", npc.position.z, ")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update NPC markers via dedicated method
|
// Update NPC markers via dedicated method
|
||||||
|
|
@ -644,12 +638,6 @@ void EditorViewport::render(VkCommandBuffer cmd) {
|
||||||
terrainRenderer_->render(cmd, perFrameSet, *camera_);
|
terrainRenderer_->render(cmd, perFrameSet, *camera_);
|
||||||
|
|
||||||
if (m2Renderer_) {
|
if (m2Renderer_) {
|
||||||
static int diagCounter = 0;
|
|
||||||
if (m2Renderer_->getInstanceCount() > 0 && (diagCounter++ % 300) == 0) {
|
|
||||||
LOG_WARNING("M2 render: ", m2Renderer_->getModelCount(), " models, ",
|
|
||||||
m2Renderer_->getInstanceCount(), " instances, ",
|
|
||||||
m2Renderer_->getDrawCallCount(), " draws");
|
|
||||||
}
|
|
||||||
m2Renderer_->prepareRender(frame, *camera_);
|
m2Renderer_->prepareRender(frame, *camera_);
|
||||||
m2Renderer_->render(cmd, perFrameSet, *camera_);
|
m2Renderer_->render(cmd, perFrameSet, *camera_);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue