zeux / meshoptimizer

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

gltfpack: Simplification take in account the vertex color #652

Closed Makio64 closed 3 months ago

Makio64 commented 7 months ago

Would be nice if the algorithm take in account the vertex color to preserve the shape when of differents vertex color zone, here an example : image image

The mouth area is particulary destroy in this example while there is so many other triangle to collapse,

The model which have no texture is good to test, all copyright to his author from sketchfab - free download : https://sketchfab.com/3d-models/bananya-birbo-900ce1ec328e486296cfee70b9b13a45

zeux commented 7 months ago

Yeah I planned to add this eventually, need to figure out how to activate this from command line and configure best. The simplifier now supports attribute weighted simplification, it just hasn't made its way to gltfpack. Quickly added this just to check what the results on this model would be and they seem good, this is 0.25 simplification ratio (1/4x triangles), current master vs attribute aware simplification.

image

image

Will work on this in the near future.

Makio64 commented 7 months ago

Attribute aware looks so much better and I think this mesh is cool to test it :)