From 9c5e2fb93d51e95bc395c324fedec0991517d5da Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 5 Feb 2026 23:33:28 -0800 Subject: [PATCH] Fix geoset filtering with expanded body range and debug logging Expanded body part geoset range from 0-18 to 0-99 to cover all humanoid submesh IDs. Added per-model debug logging to track submesh IDs and geoset filtering behavior. --- src/core/application.cpp | 20 +++++++++++++------- src/rendering/character_renderer.cpp | 8 ++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index 799299ee..d5db47be 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -905,8 +905,8 @@ void Application::spawnPlayerCharacter() { // Default geosets for naked human male // Use actual submesh IDs from the model (logged at load time) std::unordered_set activeGeosets; - // Body parts (group 0: IDs 0-18) - for (uint16_t i = 0; i <= 18; i++) { + // Body parts (group 0: IDs 0-99) - humanoid models may have many body submeshes + for (uint16_t i = 0; i < 100; i++) { activeGeosets.insert(i); } // Equipment groups: "01" = bare skin, "02" = first equipped variant @@ -1893,8 +1893,8 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x const auto& extra = itExtra->second; std::unordered_set activeGeosets; - // Body parts (group 0: IDs 0-18) - for (uint16_t i = 0; i <= 18; i++) { + // Body parts (group 0: IDs 0-99) - humanoid models may have many body submeshes + for (uint16_t i = 0; i < 100; i++) { activeGeosets.insert(i); } @@ -1996,9 +1996,15 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x activeGeosets.erase(static_cast(101 + extra.hairStyleId)); } - // TODO: Geoset filtering disabled - submesh IDs don't match expected geoset IDs - // charRenderer->setActiveGeosets(instanceId, activeGeosets); - LOG_DEBUG("Humanoid NPC geosets (disabled): hair=", hideHair ? 0 : (101 + extra.hairStyleId), + // Log what geosets we're setting for debugging + std::string geosetList; + for (uint16_t g : activeGeosets) { + if (!geosetList.empty()) geosetList += ","; + geosetList += std::to_string(g); + } + LOG_INFO("NPC geosets for instance ", instanceId, ": [", geosetList, "]"); + charRenderer->setActiveGeosets(instanceId, activeGeosets); + LOG_DEBUG("Set humanoid geosets: hair=", hideHair ? 0 : (101 + extra.hairStyleId), " facial=", 201 + extra.facialHairId, " chest=", geosetChest, " pants=", geosetPants, " boots=", geosetBoots, " gloves=", geosetGloves); diff --git a/src/rendering/character_renderer.cpp b/src/rendering/character_renderer.cpp index 96b854f5..e0091300 100644 --- a/src/rendering/character_renderer.cpp +++ b/src/rendering/character_renderer.cpp @@ -1171,10 +1171,10 @@ void CharacterRenderer::render(const Camera& camera, const glm::mat4& view, cons glBindVertexArray(gpuModel.vao); if (!gpuModel.data.batches.empty()) { - // One-time debug dump of rendered batches - static bool dumpedBatches = false; - if (!dumpedBatches) { - dumpedBatches = true; + // One-time debug dump of rendered batches per model + static std::unordered_set dumpedModels; + if (dumpedModels.find(instance.modelId) == dumpedModels.end()) { + dumpedModels.insert(instance.modelId); int bIdx = 0; int rendered = 0, skipped = 0; for (const auto& b : gpuModel.data.batches) {