From 7bb503fdee070c8552e89d774a7d30a5c6766dcd Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 18 Oct 2024 08:24:31 -0700 Subject: [PATCH] js: Update README.md Document ErrorAbsolute and Sparse options for simplification. Sparse is probably less useful in JS as the cost of copying the vertex data is paid in full but would still be useful to reduce memory consumption and improve performance; Prune is only available as an experimental option and we currently don't document those. --- js/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/README.md b/js/README.md index b9fded93..19c9734f 100644 --- a/js/README.md +++ b/js/README.md @@ -143,7 +143,9 @@ Upon completion, the function returns the new index buffer as well as the result To control behavior of the algorithm more precisely, `flags` may specify an array of strings that enable various additional options: -- `"LockBorder"` locks the vertices that lie on the topological border of the mesh in place such that they don't move during simplification. This can be valuable to simplify independent chunks of a mesh, for example terrain, to ensure that individual levels of detail can be stitched together later without gaps. +- `'LockBorder'` locks the vertices that lie on the topological border of the mesh in place such that they don't move during simplification. This can be valuable to simplify independent chunks of a mesh, for example terrain, to ensure that individual levels of detail can be stitched together later without gaps. +- `'ErrorAbsolute'` changes the error metric from relative to absolute both for the input error limit as well as for the resulting error. This can be used instead of `getScale`. +- `'Sparse'` improves simplification performance assuming input indices are a sparse subset of the mesh. This can be useful when simplifying small mesh subsets independently. For consistency, it is recommended to use absolute errors when sparse simplification is desired. When the resulting mesh is stored, it might be desireable to remove the redundant vertices from the attribute buffers instead of simply using the original vertex data with the smaller index buffer. For that purpose, the simplifier module provides the `compactMesh` function, which is similar to `reorderMesh` function that the encoder provides, but doesn't perform extra optimizations and merely prepares a new vertex order that can be used to create new, smaller, vertex buffers: