-
MSDF is awesome. I have read your code and I don't understand the latest error correction. Before this, I have read about #74 and #106. It seems to me that this is a problem caused by irrelevant pixel interpolation. (+,+,-) and (-,+,+) interpolate out (-,+,-), which leads to the wrong sign of the pseudo-distance. Your original solution was to detect this and change (+,+,-) or (-,+,+) to (mid, mid, mid).The latest error correction looks overly complicated for me to understand. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry, I missed this question. You are exactly right about the nature of the problem and my "original" solution, and while it sounds pretty straight-forward, finding where the interpolation goes wrong is not so easy. The latest version is still this exact same solution, but with a more advanced method to predict the interpolation error locations. I have determined that all bilinear interpolation errors will manifest on horizontal, vertical, or diagonal lines connecting adjacent pixels. Therefore, the algorithm analytically finds the extreme values of the interpolation on these lines and for those points, checks if the sign of the distance is evaluated wrong. However, comparing it to the correct value would require computing the exact signed distance for all those points (which there are more than pixels), and that would be expensive, so there are some heuristics to determine the correct sign for most cases based just on the computed SDF pixels, but (depending on the configuration) if that is unsuccessful, the distance is still computed for a small minority of the cases. Unfortunately, the solution still isn't perfect and I think I might review it sometime in the future. |
Beta Was this translation helpful? Give feedback.
Sorry, I missed this question. You are exactly right about the nature of the problem and my "original" solution, and while it sounds pretty straight-forward, finding where the interpolation goes wrong is not so easy. The latest version is still this exact same solution, but with a more advanced method to predict the interpolation error locations. I have determined that all bilinear interpolation errors will manifest on horizontal, vertical, or diagonal lines connecting adjacent pixels. Therefore, the algorithm analytically finds the extreme values of the interpolation on these lines and for those points, checks if the sign of the distance is evaluated wrong. However, comparing it to the c…