-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplification creates holes alongside UV boundaries #2
Comments
This is a known issue with the Fast Quadric Mesh Simplification algorithm (which is the used algorithm in this project), because it doesn't take this into account. However, there is a property called KeepBorders on the MeshSimplifier class. See here: https://github.com/Whinarn/UnityMeshSimplifier/blob/master/Scripts/MeshSimplifier.cs#L195 This will be turned off by default, but once you enable KeepBorders, it will preserve all borders of the mesh, to prevent holes from being created. However, this means that the simplification becomes more restricted and in a lot of cases it might not be able to ensure the desired count of triangles in the mesh. This is the reason why it has been turned off by default. I have been looking into other ways of solving this issue, without restricting the simplification too much, but have not yet found anything that I am happy with. Since you are using this through AutoLOD, you would have to set that property here: https://github.com/Unity-Technologies/AutoLOD/blob/master/Scripts/Editor/MeshSimplifiers/QuadricMeshSimplifier.cs But I will leave this issue open, because I still wish to improve this. |
Thanks, I understand what's going on. UV border is a hard problem, the best decimators I used are also 3d painters so they can massage the UVs no problem. Off those that leave the UV island intact, atangeo balancer is the best, maybe you can be inspired by how they do it. |
I wanted to post an update on this, because I believe that I have found a better way to prevent holes, where the simplification is not limited in any way, but the visuals of the mesh still staying intact (as much as possible). This slows down the algorithm a bit, so I have made sure that the feature can be disabled if desired. But I am planning on having it enabled by default. However I still have issues with the vertex attributes not merging correctly around the actual UV seams. But I have ideas of how to solve this as well. If you are interested in the WIP you can find it in the new feature-prevent-holes branch. There are other issues where undesired holes are being created that are unrelated to UV seams, and I believe that this can be improved with some tweaking of the edge error calculation. But the fixes in this branch should be a huge improvement from before. |
Thanks a lot for that, I'll ping the unity folks so they use this WIP branch! |
Hello again! This work has now been merged into master. There might still be scenarios where holes are created, but those are slightly harder to cover. |
see Unity-Technologies/AutoLOD#6
The text was updated successfully, but these errors were encountered: