Port BuildSmoothingGroups from ZDray

This commit is contained in:
RaveYard 2023-09-02 16:49:37 +02:00 committed by Magnus Norddahl
commit c2ded2796f
2 changed files with 48 additions and 11 deletions

View file

@ -627,17 +627,7 @@ void DoomLevelMesh::SetupLightmapUvs()
surface.texPixels.resize(surface.texWidth * surface.texHeight);
}
{
LevelMeshSmoothingGroup smoothing;
for (auto& surface : Surfaces)
{
surface.smoothingGroupIndex = 0;
smoothing.surfaces.push_back(&surface);
}
SmoothingGroups.Push(std::move(smoothing));
}
BuildSmoothingGroups();
std::sort(sortedSurfaces.begin(), sortedSurfaces.end(), [](LevelMeshSurface* a, LevelMeshSurface* b) { return a->texHeight != b->texHeight ? a->texHeight > b->texHeight : a->texWidth > b->texWidth; });