From 11b7fd5a7c912d8dac7ae2a6d4237374c531c0c2 Mon Sep 17 00:00:00 2001 From: ruby Date: Sun, 26 Nov 2023 17:20:14 -0400 Subject: [PATCH 1/2] add options to simplify example minor API change --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8d233d86..e59d10f1c 100644 --- a/README.md +++ b/README.md @@ -263,11 +263,12 @@ The first simplification algorithm, `meshopt_simplify`, follows the topology of float threshold = 0.2f; size_t target_index_count = size_t(index_count * threshold); float target_error = 1e-2f; +unsigned int options = 0; //meshopt_SimplifyX flags, 0 is a safe default std::vector lod(index_count); float lod_error = 0.f; lod.resize(meshopt_simplify(&lod[0], indices, index_count, &vertices[0].x, vertex_count, sizeof(Vertex), - target_index_count, target_error, &lod_error)); + target_index_count, target_error, options, &lod_error)); ``` Target error is an approximate measure of the deviation from the original mesh using distance normalized to `[0..1]` range (e.g. `1e-2f` means that simplifier will try to maintain the error to be below 1% of the mesh extents). Note that the simplifier attempts to produce the requested number of indices at minimal error, but because of topological restrictions and error limit it is not guaranteed to reach the target index count and can stop earlier. From 20517152a08c32152e545fe51a7d628a40380c26 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 26 Nov 2023 13:29:33 -0800 Subject: [PATCH 2/2] Update README.md Add a missing space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e59d10f1c..fbf576ef6 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ The first simplification algorithm, `meshopt_simplify`, follows the topology of float threshold = 0.2f; size_t target_index_count = size_t(index_count * threshold); float target_error = 1e-2f; -unsigned int options = 0; //meshopt_SimplifyX flags, 0 is a safe default +unsigned int options = 0; // meshopt_SimplifyX flags, 0 is a safe default std::vector lod(index_count); float lod_error = 0.f;