Skip to content

Commit

Permalink
RecalculateNormals if submesh has no normals
Browse files Browse the repository at this point in the history
Signed-off-by: Qingyou Zhao <[email protected]>
  • Loading branch information
qingyouzhao committed Dec 10, 2024
1 parent 7303c04 commit 0a3d9e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0a3d9e6

Please sign in to comment.