Distance Map Generator
a Unity tool
I have released a neat little tool for Unity. It's a distance map generator that's available right inside Unity's editor. You can access it through scripting as well.
What's the use?
Distance maps are useful when you want to display a texture with sharp contours in it and want it to look good when magnified. Bitmap text a prime example.
Using a distance map and the right shaders, you can get nice looking edges even when zoomed in a lot. You can also add effects like outlines, glows, and shadows.
Note that a thin font with sharp edges, like Times New Roman that I used here, is especially nasty to magnify.
What's special about it?
I'm not the first to make a distance map generator, even for Unity. What's good about this one is that is produces very good distance maps from low-resolution anti-aliased textures. Basically, any plain font atlas will do. In contrast, most naive approaches requires high-resolution bitmaps without anti-aliasing. It's also really fast too.I did not invent this stuff, I merely ported it to C# and made a nice Unity editor for it. The algorithm used by the generator is the anti-aliased Euclidean distance transform described by Stefan Gustavson and Robin Strand. See here and here for further information.