I’m really new to hlsl and I’ve been experimenting with it lately. I use a custom pixel font in my projects with multiple outlines, as seen below. I’m curious if it’s possible to recreate these examples using a hlsl pixel shader on a single spritebatch.drawstring result. The outlines are now drawn using many spritebatch.drawstring calls which is not so optimal. A shader would probably be faster, especially in the second example.
- I saw that each character is drawn as its own texture. I would have to draw pixels outside the texture box of characters. I don’t know if this is possible.
- The texture size of each string/character would be needed to check the color of neighbouring pixels. (to create the outline(s), as far as I know)
- I need to know how many pixels actually represent one “font pixel”.
- Some outlines need to be layered on top of others (see example 2).
Is a shader like this possible?
Thanks in advance.