--- a/rts/Rendering/Models/IModelParser.cpp +++ b/rts/Rendering/Models/IModelParser.cpp @@ -505,6 +505,19 @@ if (model->type != MODELTYPE_3DO) CheckPieceNormals(model, model->GetRootPiece()); + #ifdef __EMSCRIPTEN__ + // Native queries use cached bounds/collision data and the first two emission + // vertices after upload. Aggregation, shatter RNG and normal checks above must + // still see the complete geometry. Preserve empty/triangle categories too. + for (auto* p : model->pieceObjects) { + auto& vertices = p->GetVerticesVec(); + auto& indices = p->GetIndicesVec(); + std::vector(vertices.begin(), vertices.begin() + std::min(vertices.size(), 2)).swap(vertices); + if (indices.size() > 3 && indices.size() % 3 == 0) + std::vector(indices.begin(), indices.begin() + 3).swap(indices); + } + #endif + model->uploaded = true; }