From afd836cc56a9450e70024383d2820ea289e940a3 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 13 Jun 2020 11:58:16 -0500 Subject: [PATCH] export rounds LODs to the nearest power of 2 prevent submeshes from flickering in and out due to lod mismatches when exporting groups to a singularr model file --- Engine/source/T3D/convexShape.cpp | 3 ++- Engine/source/T3D/tsStatic.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index 8f73b564d..90bb2bc04 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -889,7 +889,8 @@ bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, cons ColladaUtils::ExportData::detailLevel* curDetail = &meshData->meshDetailLevels.last(); //Make sure we denote the size this detail level has - curDetail->size = 512; + curDetail->size = getNextPow2(getObjBox().len()); + } return true; diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 99c969fac..8659046dd 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -1363,7 +1363,7 @@ bool TSStatic::buildExportPolyList(ColladaUtils::ExportData* exportData, const B ColladaUtils::ExportData::detailLevel* curDetail = &meshData->meshDetailLevels.last(); //Make sure we denote the size this detail level has - curDetail->size = detail.size; + curDetail->size = getNextPow2(detail.size); } }