From bd2eb4f0e45d5ab7e2c4d43f610dbeb14e59e5dc Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 12 Jul 2024 11:15:34 -0700 Subject: [PATCH] simplify: Increase maximum number of attributes to 32 Generally speaking 16 is plenty, but there are some cases where it's not quite enough and having some room would be good for experimentation. --- src/meshoptimizer.h | 2 +- src/simplifier.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshoptimizer.h b/src/meshoptimizer.h index 8b234526..76ce9d36 100644 --- a/src/meshoptimizer.h +++ b/src/meshoptimizer.h @@ -362,7 +362,7 @@ MESHOPTIMIZER_API size_t meshopt_simplify(unsigned int* destination, const unsig * * vertex_attributes should have attribute_count floats for each vertex * attribute_weights should have attribute_count floats in total; the weights determine relative priority of attributes between each other and wrt position. The recommended weight range is [1e-3..1e-1], assuming attribute data is in [0..1] range. - * attribute_count must be <= 16 + * attribute_count must be <= 32 * vertex_lock can be NULL; when it's not NULL, it should have a value for each vertex; 1 denotes vertices that can't be moved * TODO target_error/result_error currently use combined distance+attribute error; this may change in the future */ diff --git a/src/simplifier.cpp b/src/simplifier.cpp index 8fc5f2b9..eb910b2e 100644 --- a/src/simplifier.cpp +++ b/src/simplifier.cpp @@ -521,7 +521,7 @@ static void rescaleAttributes(float* result, const float* vertex_attributes_data } } -static const size_t kMaxAttributes = 16; +static const size_t kMaxAttributes = 32; struct Quadric {