Interestingly, the distance fields technique from the previous recipe can be exploited to achieve font effects dynamically, such as outlines, glows, and drop shadows. Can this technique get any more awesome?
No need to generate yet another font texture with prebaked effects; you can turn them off or on as well as tweak and tween their parameters completely at runtime. Consequently, you will be able to achieve a much richer and engaging experience. Moreover, the performance penalty is negligible—you can go crazy!
Just keep in mind that every time you set a shader on a
SpriteBatch object, the latter is automatically flushed with the consequent draw call.
In this recipe, we will start off with an existing distance ...