Signed distance field font looks odd I attempted to implement font rendering using signed distance fields.

My program first generates a mono bitmap at font size 64 (using FreeType), then generates an SDF from the bitmap. This is then uploaded into a texture atlas.

The results are not very nice and look nothing like the various papers show:



My guess is that the bitmap does not have a high enough resolution, but
I do not necessarily want to generate SDF's larger than 64px (they have to fit in the atlas). Besides, at 256px, the generated sdf still has artifacts, albeit less noticable unless blown up.

So how can I get better results / how am I applying the algorithm wrong?
Hmm, that SDF doesn't look right. It should be much smoother, like this image for instance:



(image from this blog).

One possible issue I noticed in your description:


  My program first generates a mono bitmap at font size 64 (using FreeType), then generates an SDF from the bitmap.


The initial text needs to be rendered at a much higher resolution than the resulting SDF, so you can get subpixel precision in the distances stored in the SDF. For example, in the original Valve paper, they render the initial mono bitmap at 4096×4096 in order to generate a 64×64 SDF from it.