Skip to content

Commit

Permalink
fix tonihele#415 tangent generation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Trass3r committed Apr 16, 2023
1 parent eba1d78 commit ae191a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/toniarts/openkeeper/tools/convert/KmfModelLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ private Geometry createGeometry(int subMeshIndex, String meshName, Mesh mesh, Ma
// Update bounds
geom.updateModelBound();

// prevent the warnings caused by the tangent generation on "empty" main index buffers
if (mesh.getTriangleCount() == 0)
return geom;

// Try to generate tangents
try {
MikktspaceTangentGenerator.generate(geom);
Expand Down

0 comments on commit ae191a9

Please sign in to comment.