Commit eaaf861
committed
simplifier: Use parallel collapses for complex vertices based on loops
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 no effect unless
permissive mode is used); 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.1 parent fa0f478 commit eaaf861
1 file changed
+30
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
1271 | 1271 | | |
1272 | 1272 | | |
1273 | 1273 | | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1274 | 1288 | | |
1275 | 1289 | | |
1276 | 1290 | | |
| |||
1393 | 1407 | | |
1394 | 1408 | | |
1395 | 1409 | | |
1396 | | - | |
1397 | | - | |
| 1410 | + | |
1398 | 1411 | | |
1399 | 1412 | | |
1400 | | - | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1401 | 1418 | | |
1402 | 1419 | | |
1403 | 1420 | | |
1404 | | - | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1405 | 1426 | | |
1406 | 1427 | | |
1407 | 1428 | | |
| |||
1553 | 1574 | | |
1554 | 1575 | | |
1555 | 1576 | | |
1556 | | - | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
1557 | 1580 | | |
1558 | 1581 | | |
1559 | 1582 | | |
| |||
0 commit comments