Unity-Technologies / AutoLOD

Automatic LOD generation + scene optimization
https://blogs.unity3d.com/2018/01/12/unity-labs-autolod-experimenting-with-automatic-performance-improvements/
Other
1.81k stars 213 forks source link

not usable: it creates holes alongside UV boundaries #6

Closed laurentopia closed 6 years ago

laurentopia commented 6 years ago

https://i.imgur.com/rm35rUm.png

amirebrahimi commented 6 years ago

What simplifier are you using?

laurentopia commented 6 years ago

Quadric

amirebrahimi commented 6 years ago

Yes, simulated is just that - a simulation of what gains you could expect, but essentially much quicker at generating. It might need a rename to FakeSimplifier perhaps to be more clear.

Re: the Quadric, that is from this GitHub project: https://github.com/Whinarn/UnityMeshSimplifier. You could post an issue there, but that simplifier is based on https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification, which might be where the actual problem lies.

If you have Simplygon or InstaLOD you may see better results.

The AutoLOD framework is built in such a way that any mesh simplifier could easily plug into the system.

laurentopia commented 6 years ago

which version of simpligon needs to be installed?

amirebrahimi commented 6 years ago

8.2.X, but unfortunately they pulled their existing Unity plugin and still have not published a new one. I pointed this out on their forum and have not heard a response back. The old plugin worked fine in my tests.

If you're registered on their forums, this is the post: https://simplygon.freshdesk.com/support/discussions/topics/5000086159

laurentopia commented 6 years ago

I saw that only ue has an installer, is the old plugin available somewhere?

amirebrahimi commented 6 years ago

Not that I can see. If you happen to find another good simplifier that works well for your model, I'd be willing to write implement an ISimplifier wrapper for it, similar to the other simplifiers.

laurentopia commented 6 years ago

This one is ok https://github.com/wjakob/instant-meshes

amirebrahimi commented 6 years ago

This was suggested in #2, but it looks like there are some concerns about how well it would work for simplification. I haven't looked into it further. Have you tried it with your model to generate LODs?

laurentopia commented 6 years ago

Yes I have used it, it's quite good at simplification as it keeps the flow of the mesh but it doesn't transfer UVs...

laurentopia commented 6 years ago

oh, did you see that? you need to set a flag to keep the borders https://github.com/Whinarn/UnityMeshSimplifier/issues/2

amirebrahimi commented 6 years ago

Yes, I was aware of this. When I talked with @Whinarn it seemed like better results were reached with the preserve borders flag turned off, but I've added an issue #7 into defaulting this to true perhaps and/or providing a way for custom options to be set on a selected simplifier.

Re: instant-meshes, it's great to hear that it does a good job for simplification for you, but without transferring UVs I see that as a big miss for attempting to integrate into AutoLOD. Don't you agree?

Whinarn commented 6 years ago

The reason preserving borders was turned off by default was that it restricted the simplification, and mostly only worked on high poly meshes. But only to a certain polygon count since the border edges are never removed. So while it makes sure that holes doesn't get created, it ends up being bad at the actual mesh simplification in many cases. So I would personally think that providing options would be a better idea instead of defaulting it.

laurentopia commented 6 years ago

@Whinarn improved the quadratic decimation algorithm. See if the WIP branch works for you, I dropped it in and it auto generates empty mesh so I think you need to set things up differently. https://github.com/Whinarn/UnityMeshSimplifier/issues/2#issuecomment-365803966 https://github.com/Whinarn/UnityMeshSimplifier/tree/feature-prevent-holes

Whinarn commented 6 years ago

Oh I don't recommend that they use it just yet, since it's a work in progress. I only meant to show my current progress if you were interested in trying it out yourself. Sorry if I didn't make that clear.

I'm trying to finish it up when I have some time over, but I want to make sure that it works a lot better before I suggest that people start using it.

laurentopia commented 6 years ago

Oh ok.

Whinarn commented 6 years ago

I have created a new vertex linking feature that improves the decimation results a lot with all the meshes I have for testing. There are still some artifacts that can be improved, but it is a huge improvement by itself. More details about the update can be found here: https://github.com/Whinarn/UnityMeshSimplifier/commit/80e5bb0b4b006a15cb15a31d1db1aca4493ce602

@amirebrahimi you might be interested in looking at the latest updates for https://github.com/Unity-Technologies/UnityMeshSimplifier

laurentopia commented 6 years ago

Thank you Whinarn, I will try it as soon as it's in AutoLOD.

amirebrahimi commented 6 years ago

Updated to latest with ed3c61f