simplifier: Use parallel collapses for complex vertices based on loops #989
+44
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.






Collapsing all wedges into a single wedge for complex-complex collapses
is simple but results in high-error collapses alongside attribute
discontinuities. This is a problem because it either results in poor
attribute quality, or in poor geometric quality elsewhere as the
simplifier is forced to look for lower error collapses.
This change instead adjusts complex collapses to use parallel collapses
if possible: wedges are collapsed individually towards different wedges
along the original edges. This makes complex collapses work similarly to
seam collapses if possible.
To implement this without extra performance issues, we use loop
metadata. Because loops are really tracking a single incoming/outgoing
half-edge in the original (unwelded) topology, a typical attribute
discontinuity will have X wedges (seams only have 2), and each of the
wedges will have their own loop/loopback that correctly trace the
adjoining triangle boundary. Thus we can use these to guide the
collapses.
In some complex topological situations this may not always find the
correct wedge target, but fundamentally complex-complex collapses may
not have a correct wedge target in all cases (if a discontinuity has 3
wedges then any collapse will have to collapse one of them onto a wedge
that was not connected to the original). In the future we could use
error or position patching to resolve these cases but that requires
invasive changes with potentially problematic consequences, whereas
using loop metadata should be cheap and safe.
This has no effect on performance on most meshes (and is only applied
for permissive mode); on meshes where almost every vertex is
complex, this costs under 10% performance but results in much better
quality. In general, after this "soft" protection like normal creases is
mostly unnecessary because the simplifier will do the right thing while
it's possible. Protecting UV edges may still be important to avoid UV
distortion, although even without UV protection the quality can remain
quite high if the UVs are weighted properly.
This contribution is sponsored by Valve.