From 16712edc19448d922ae2eddd0432d1c313e4fccc Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 18 Aug 2024 12:58:36 -0700 Subject: [PATCH] gltfpack: Adjust attribute weights for simplification For now just use constant 0.5f; this code should ideally be rewritten now that we can more easily skip unused attributes during actual processing. --- gltf/mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gltf/mesh.cpp b/gltf/mesh.cpp index 99950767..a3dc3394 100644 --- a/gltf/mesh.cpp +++ b/gltf/mesh.cpp @@ -557,7 +557,7 @@ static void simplifyMesh(Mesh& mesh, float threshold, bool attributes, bool aggr const Stream* attr = getStream(mesh, cgltf_attribute_type_color); attr = attr ? attr : getStream(mesh, cgltf_attribute_type_normal); - const float attrw[3] = {1e-2f, 1e-2f, 1e-2f}; + const float attrw[3] = {0.5f, 0.5f, 0.5f}; std::vector indices(mesh.indices.size()); if (attributes && attr)