« first day (5002 days earlier)   

8:00 AM
@DMGregory Yeah I actually saw him posting, but I guess I finally understood your explanations, except for one last detail, which why does this issue of waviness only happen in diagonal edges and not vertical/horizontal?
like my understanding was that, if we expand the bilinear formula, which is like mix(mix(a0, a1, x), mix(a2, a3, x), y) we get something like a general hyperbola equation (ax +by +cxy + d= e) with e = 0.5 usually, and since a,b,c,d are depending on the alpha values alone which are constant when we sample a particular pixel (since as long as we are sampling in the range [i + 0.5 , i + 1.5) , [j + 0.5 , j + 1.5) those alpha of the 4 nearest pixels are constant) so the equation of hyperbola
repeats and we we get a wavy-like shape, but 1) this should also happen in the case of horizontal sampling and vertical sampling and 2) I don't see how SDF avoids this problem?
A different way to see why SDF does not have this problem is when look at alpha testing, we have 3 delta functions, one is alpha = 1, next alpha = 0.5 and then alpha = 0. (delta as in dirac function)
or more like a square function actually since dirac is only at a particular time but when we sample the texture for alpha, we have 2 cases alpha = 1, alpha = 0 in our texture and this meant the bilinear interpolation when we are sampling near the alpha = 1.0 value, will drop down to 0 in a curvy way. Here are two photos to clarify what I meant
ibb.co/xhWFT3S here we have the alpha values of some pixels in some row, when X<= 2.0, we have alpha = 1, and when X > 2, we have alpha = 0.
This is not to scale drawing of what bilinear interpolation wants to do: ibb.co/XjjF0NT
with alpha testing >= 0.5, we clamp that curve when it reaches y= 0.5 instead of going all the way to y = 0, and this interpretation honestly would make sense why SDF solve the issue, because SDF have more values than just alpha = 0, and alpha = 1, and those continuous values will create a ramp like falloff when using nearest neighboring with SDF,
what I don't understand about this way of interpretation, is why bilinear interpretation without alpha testing creates blurry images in the first place, because valve paper lists 3 cases, blurry without alpha testing and wavy edges with alpha testing, and sharp edges with SDF.
the weird thing to me, is that, it is blurry without alpha testing, since all neighbor pixels of a font texture for a particular glyph should have equal alpha at the pixels we want to render the font and opposite alpha else where, so it would make sense if the edges are blurry, but why would the center of font be blurry as well? (too many questions again..)
sorry for the long message, I was lost in thoughts...
 

« first day (5002 days earlier)