meshoptimizer icon indicating copy to clipboard operation
meshoptimizer copied to clipboard

Vertex remapping/reindexing with approximate equality

Open pablode opened this issue 1 year ago • 1 comments

As the README states,

meshopt_generateVertexRemap uses binary equivalence of vertex data, which is generally a reasonable default; however, in some cases some attributes may have floating point drift causing extra vertices to be generated. For such cases, it may be necessary to quantize some attributes (most importantly, normals and tangents) before generating the remap, or use a custom weld algorithm that supports per-attribute tolerance instead.

Since rolling a custom version of the algorithm for a single-line change also comes with a maintenance cost, would it be possible to provide a variant of the algorithm that allows the specification of custom distance functions?

For instance by extending the meshopt_Stream struct or by passing a function pointer to the signature, which then gets the stream and element?

pablode avatar Sep 26 '24 16:09 pablode