Page MenuHome

Fix texture paint UV dilation algorithm
ClosedPublic

Authored by Luca Rood (LucaRood) on Mar 2 2019, 2:28 AM.

Details

Summary

This fixes most issues with the dilation algorithm for UV seams.

Two aspects are addressed in this patch:

  1. Correct computation of dilation distance, so that dilated boundaries remain parallel to the original boundaries (and with the actual distance specified as bleed distance).
  2. Dilate with regard to adjacent seams instead of adjacent triangle edges, for a more correct result. This is especially important in the case of concave shapes, where spikes could overlap with actual geometry.

This is a comparison between the existing implementation and the new one:

Note that the pattern being extended at the seams instead of stretched is not caused by this patch, but rather D4345.

One issue that remains is that sharp corners can extend excessively. This is addressed by D4437, though that fix adds yet some more overhead. Here the corner spikes are limited to five times the bleed distance, though this is far from an ideal solution.

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) accepted this revision.EditedMar 4 2019, 3:37 PM

This works nicely, committed rB871248a77d8a9ae7dbb43ef28f3802601cbfe5c6 with only minor changes, use short for faceSeamFlags to save some memory and start flag defines at 0 to make bit-shifting with them make more sense (instead of duplicate matching defines).

This revision is now accepted and ready to land.Mar 4 2019, 3:37 PM