Skip to content

Commit

Permalink
gltfpack: Enable pruning during simplification
Browse files Browse the repository at this point in the history
This should probably be unambiguously a good idea, especially given the
default low error target. If this ends up being a bad idea, we can
revert this or expose a separate option; for now, -slb will disable this
because pruning doesn't respect locked borders.
  • Loading branch information
zeux committed Sep 25, 2024
1 parent d05c73a commit 0bfa3bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gltf/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,13 @@ static void simplifyMesh(Mesh& mesh, float threshold, float error, bool attribut
size_t target_index_count = size_t(double(mesh.indices.size() / 3) * threshold) * 3;
float target_error = error;
float target_error_aggressive = 1e-1f;

unsigned int options = 0;
if (lock_borders)
options |= meshopt_SimplifyLockBorder;
else
options |= meshopt_SimplifyPrune;

if (debug)
options |= meshopt_SimplifyInternalDebug;

Expand Down

0 comments on commit 0bfa3bd

Please sign in to comment.