-
Notifications
You must be signed in to change notification settings - Fork 496
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 should prefer more uniformly tessellated meshes #664
Comments
I can't reproduce this in gltfpack. I get the following mesh with simplification factor 0.006 (going lower than this triggers a safety check in gltfpack code that should probably be reworked somehow, so the mesh stays in its original form): In theory this should have gone all the way down to one quad, but I think there's some tricky edge conditions that might be preventing this from happening. On the sphere file, with the error threshold of 1e-2 gltfpack simplifies down to 82 triangles: |
This is not a criteria that the simplifier takes into account. The appearance of a tessellated plane is the same regardless of which interior edges you collapse. The error of every version on this video is close to 0. |
Interesting! I wasn't aware that meshoptimizer doesn't optimize for similarly sized triangles, which to be best of my understanding are another property that is important for efficient GPU utilization (avoiding small triangles and aiming for a uniform triangle distribution on screen). We noticed this issue on other meshes (e.g. spheres in some cases exhibit "nests" of lots of non-optimized triangles) and also in production meshes where in some areas nothing was optimized and other areas got optimized aggressively. A plane was just the easiest to demonstrate. Sounds like we'll need to provide a better mesh that shows the issue if you say that this is essentially by design. |
All things being equal, more uniform triangle density is definitely preferred for efficiency; the simplifier right now is predominantly concerned with appearance. I was considering some sort of edge length metric addition which becomes more important for better attribute treatment but right now the metric is purely "distance from the original surface", which is invariant to density. Introducing additional non-critical factors like this is difficult because they distort the original quality metric, so careful tuning is critical. My experience has been that on production meshes you mostly don't run into this problem - you can still have areas where nothing is optimized of course, but when that happens that usually happens because of topological constraints, not because of error constraints. I'd welcome examples where that's a problem, with exact values of error & target count so that I can reproduce this more easily. |
Based on the papers, this could be helped by adding a pointwise quadric that is the distance to the original point. A=I, b=-p c=p*p, all multiplied by the weight. I don't think this would solve the issue with getting rid of the last few edges down to one quad or triangle. But it would probably help in the intermediate stages. |
Hello, below is a video of a 100 vertices plane simplified with ratios [0.5, 0.25, 0.125, ...] and an error of 1
It seems like the simplification is suddenly stopped once a threshold is reached where areas of the mesh then stay untouched.
We also observed this on a relatively high density sphere where it resulted of dense islands
Expected behavior
Simplification is uniformly applied
assets.zip
20240315-101103_Min_-_Google_Chrome-logo.mp4
The text was updated successfully, but these errors were encountered: