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 15, 2023
1 parent 064fcb7 commit 9d56477
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 @@ -561,6 +561,10 @@ private Geometry createGeometry(int index, String name, Mesh mesh, Map<Integer,
// 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 9d56477

Please sign in to comment.