summaryrefslogtreecommitdiffstats
path: root/platform/macos/export/export.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2024-07-23 16:27:28 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2024-07-23 16:35:46 -0700
commit18d6ae1161fb0204ead8a7c9395968afab0c4cf7 (patch)
tree1a467320efc6dda678fadb96e5f96c439089841d /platform/macos/export/export.cpp
parent8e36f98ea5b5ab4c1fb5249f94b61a7bbfb379a1 (diff)
downloadredot-engine-18d6ae1161fb0204ead8a7c9395968afab0c4cf7.tar.gz
Fix LOD generation for meshes with tangents & mirrored UVs
When UVs are mirrored in a mesh, collapsing vertices across the mirroring seam can significantly reduce quality in a way that is not apparent to the simplifier. Even if simplifier was given access to UV data, the coordinates would need to be weighted very highly to prevent these collapses, which would penalize overall quality of reasonable models. Normally, well behaved models with mirrored UVs have tangent data that is correctly mirrored, which results in duplicate vertices along the seam. The simplifier automatically recognizes that seam and preserves its structure; typically models have few edge loops where UV winding is flipped so this does not affect simplification quality much. However, pre-processing for LOD data welded vertices when UVs and normals were close, which welds these seams and breaks simplification, creating triangles with distorted UVs. We now take tangent frame sign into account when the input model has tangent data, and only weld vertices when the sign is the same.
Diffstat (limited to 'platform/macos/export/export.cpp')
0 files changed, 0 insertions, 0 deletions