From 0a3d9e6a2882ff36b86b31b1183d3b41cc34c467 Mon Sep 17 00:00:00 2001 From: Qingyou Zhao Date: Tue, 10 Dec 2024 10:50:34 -0800 Subject: [PATCH] RecalculateNormals if submesh has no normals Signed-off-by: Qingyou Zhao --- graphics/src/AssimpLoader.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphics/src/AssimpLoader.cc b/graphics/src/AssimpLoader.cc index d2e3b754..b20bb837 100644 --- a/graphics/src/AssimpLoader.cc +++ b/graphics/src/AssimpLoader.cc @@ -700,6 +700,9 @@ SubMesh AssimpLoader::Implementation::CreateSubMesh( subMesh.AddIndex(face.mIndices[2]); } subMesh.SetMaterialIndex(_assimpMesh->mMaterialIndex); + if (subMesh.NormalCount() == 0u){ + subMesh.RecalculateNormals(); + } return subMesh; }