Skip to content

Commit bbfa7ae

Browse files
authored
Merge pull request #635 from ruby0x1/patch-1
add options to simplify example
2 parents 8c3ae2f + 2051715 commit bbfa7ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,12 @@ The first simplification algorithm, `meshopt_simplify`, follows the topology of
263263
float threshold = 0.2f;
264264
size_t target_index_count = size_t(index_count * threshold);
265265
float target_error = 1e-2f;
266+
unsigned int options = 0; // meshopt_SimplifyX flags, 0 is a safe default
266267
267268
std::vector<unsigned int> lod(index_count);
268269
float lod_error = 0.f;
269270
lod.resize(meshopt_simplify(&lod[0], indices, index_count, &vertices[0].x, vertex_count, sizeof(Vertex),
270-
target_index_count, target_error, &lod_error));
271+
target_index_count, target_error, options, &lod_error));
271272
```
272273

273274
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.

0 commit comments

Comments
 (0)