Whinarn / UnityMeshSimplifier

Mesh simplification for Unity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong behavior on combined mesh

Azaberym opened this issue · comments

After generating a level, I'd like to get rid of unnecessary vertices by combining different meshs then using the mesh simplifier.

In this exemple, I'm starting with a grid of 900 square plane merged in one mesh using Mesh.CombineMeshes (3600 Vertices 1800 Triangles):
image

At this point, i'm using SimplifyMesh with the PreserveBorderEdges option to try to get a simplified square.
Here's what result (540 Vertices, 180 triangles):
image

While it is totally possible that there is something that I don't get about the way the API works, this result doesn't feel right.

Hi @Azaberym ,
Sorry for the late reply. It has been a busy few days lately.

I believe this is related to an issue that has been coming up a few times related to planes and boxes tend to have clear visual defects after simplification. You can read more about this in the latest issue about this where I explained it in a bit more detail: #59

Unfortunately I'm not the author of the original algorithm, and quite honestly a lot of it is way about my expertise. I'd recommend this simplification for things like characters, animals, or certain environmental objects. It sucks with boxes and planes. And I have currently no plan to deal with that. I just simply don't have time nor the interest at the time. But I do welcome PRs if anyone is up for the challenge.

But as I said to the other person, if you find that the original algorithm works better in these scenarios, and you believe it to be a bug with my code, then please let me know!
But I'm closing this for now.