Files
texturecraft/crates
Simon Hull ac4454bb38 Geom: check indices before computing tangents (#386)
Mesh::from_parts computed normals and tangents before validate(). An
index past the last vertex reads as the origin in the MikkTSpace
callbacks, but the all-degenerate guard compares positions.get() and
counts a missing vertex as different. So two positions with indices
[0, 1, 2] passed the guard while MikkTSpace saw every triangle as
degenerate and underflowed at generated.rs:1100: a panic in debug, an
out-of-bounds walk in release.

compute_tangents now also skips MikkTSpace (using the per-triangle
fallback, which reads with get()) when an index is out of range, and
from_parts refuses such indices before building the mesh, with the
same error validate() gives.
2026-11-26 16:21:07 +00:00
..