zeux / meshoptimizer

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

Verify the triangles are not intersecting each others when simplifying #655

Open Makio64 opened 7 months ago

Makio64 commented 7 months ago

It would improve a lot the quality if the triangles dont intersect each others :

Here an exemple before / after simplifying where the triangles intersect each other making bad result : image

image

Using this model from sketchfab, all credit to his author : https://sketchfab.com/3d-models/wakfu-fanart-female-iop-854b37afca0c44c9a0302b879a95bfca

zeux commented 5 months ago

This request makes sense but this is fairly unlikely to happen. The simplification reasoning process is local so the simplifier is not aware of the rest of the mesh - it's only making decisions with the knowledge of immediate vertex/triangle neighborhood. I'll keep this open for now, maybe it could be viable to explore at some point as an option; it would make simplification dramatically more expensive and more involved from the robustness perspective.