From 5d78cbb81d0205967ff7f6df16c33847bf9d69db Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 07:06:25 -0700 Subject: [PATCH] fix(wob): scrub NaN/inf doodad position+rotation on load Already had a guard for scale; extending to position/rotation too. A WoB with non-finite doodad transforms produces NaN model matrices that propagate into the M2 instance SSBO and crash the GPU. --- src/pipeline/wowee_building.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pipeline/wowee_building.cpp b/src/pipeline/wowee_building.cpp index 9617983d..b85a4ec2 100644 --- a/src/pipeline/wowee_building.cpp +++ b/src/pipeline/wowee_building.cpp @@ -176,6 +176,12 @@ WoweeBuilding WoweeBuildingLoader::load(const std::string& basePath) { // the field, or NaNs from a partial write). The renderer would // collapse the doodad to a point with scale 0. if (!std::isfinite(dp.scale) || dp.scale <= 0.0001f) dp.scale = 1.0f; + // Same NaN scrub for position/rotation — doodads with non-finite + // transforms produce NaN model matrices and crash the GPU. + for (int k = 0; k < 3; k++) { + if (!std::isfinite(dp.position[k])) dp.position[k] = 0.0f; + if (!std::isfinite(dp.rotation[k])) dp.rotation[k] = 0.0f; + } bld.doodads.push_back(dp); }