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.
This commit is contained in:
Arseny Kapoulkine
2024-10-18 08:24:31 -07:00
parent 212e9af49d
commit 7bb503fdee
+3 -1
View File
@@ -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: