zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.49k stars 473 forks source link

Doc missing for VertexLock Simplify #706

Closed Makio64 closed 2 months ago

Makio64 commented 2 months ago

Simplifying using Vertex lock ( excluding some vertex from the simplification process ) looks like a very powerful features.

It was recently merged in a PR but i cant find the doc to use it ?

Also is it accessible through the js/wasm ?

Thanks !

zeux commented 2 months ago

The parameter is part of meshopt_simplifyWithAttributes API, documented here: https://github.com/zeux/meshoptimizer/blob/5158851e86707c00e142103325bd117ffb083a1d/src/meshoptimizer.h#L364-365, and available in JS via vertex_lock parameter of simplifyWithAttributes.

This entire API is currently experimental so it doesn't have full documentation in README; that will change when it becomes more finalized (tracked in #158), but it should be safe to use in the meantime. In JS, the API requires enabling experimental features (by setting https://github.com/zeux/meshoptimizer/blob/5158851e86707c00e142103325bd117ffb083a1d/js/meshopt_simplifier.module.d.ts#L9) because the interface may change until the API is not experimental.