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.
This commit is contained in:
Kelsi 2026-02-05 23:33:28 -08:00
parent 5512623d65
commit 4c17b64e41
2 changed files with 17 additions and 11 deletions

View file

@ -905,8 +905,8 @@ void Application::spawnPlayerCharacter() {
// Default geosets for naked human male // Default geosets for naked human male
// Use actual submesh IDs from the model (logged at load time) // Use actual submesh IDs from the model (logged at load time)
std::unordered_set<uint16_t> activeGeosets; std::unordered_set<uint16_t> activeGeosets;
// Body parts (group 0: IDs 0-18) // Body parts (group 0: IDs 0-99) - humanoid models may have many body submeshes
for (uint16_t i = 0; i <= 18; i++) { for (uint16_t i = 0; i < 100; i++) {
activeGeosets.insert(i); activeGeosets.insert(i);
} }
// Equipment groups: "01" = bare skin, "02" = first equipped variant // 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; const auto& extra = itExtra->second;
std::unordered_set<uint16_t> activeGeosets; std::unordered_set<uint16_t> activeGeosets;
// Body parts (group 0: IDs 0-18) // Body parts (group 0: IDs 0-99) - humanoid models may have many body submeshes
for (uint16_t i = 0; i <= 18; i++) { for (uint16_t i = 0; i < 100; i++) {
activeGeosets.insert(i); activeGeosets.insert(i);
} }
@ -1996,9 +1996,15 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x
activeGeosets.erase(static_cast<uint16_t>(101 + extra.hairStyleId)); activeGeosets.erase(static_cast<uint16_t>(101 + extra.hairStyleId));
} }
// TODO: Geoset filtering disabled - submesh IDs don't match expected geoset IDs // Log what geosets we're setting for debugging
// charRenderer->setActiveGeosets(instanceId, activeGeosets); std::string geosetList;
LOG_DEBUG("Humanoid NPC geosets (disabled): hair=", hideHair ? 0 : (101 + extra.hairStyleId), 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, " facial=", 201 + extra.facialHairId,
" chest=", geosetChest, " pants=", geosetPants, " chest=", geosetChest, " pants=", geosetPants,
" boots=", geosetBoots, " gloves=", geosetGloves); " boots=", geosetBoots, " gloves=", geosetGloves);

View file

@ -1171,10 +1171,10 @@ void CharacterRenderer::render(const Camera& camera, const glm::mat4& view, cons
glBindVertexArray(gpuModel.vao); glBindVertexArray(gpuModel.vao);
if (!gpuModel.data.batches.empty()) { if (!gpuModel.data.batches.empty()) {
// One-time debug dump of rendered batches // One-time debug dump of rendered batches per model
static bool dumpedBatches = false; static std::unordered_set<uint32_t> dumpedModels;
if (!dumpedBatches) { if (dumpedModels.find(instance.modelId) == dumpedModels.end()) {
dumpedBatches = true; dumpedModels.insert(instance.modelId);
int bIdx = 0; int bIdx = 0;
int rendered = 0, skipped = 0; int rendered = 0, skipped = 0;
for (const auto& b : gpuModel.data.batches) { for (const auto& b : gpuModel.data.batches) {