2D outline pixel shader on a pixel font

Use signed distance field fonts.

You can do a hell of a lot with them.

Normally you would just test the alpha value and if it greater than a chosen value, set the pixel.

However you can do ranges.

if (alpha > 0.7f)  vResult = outline colour
if (alphs > 0.8f) vRexult = font colour

Would produce outlined chars

Then you can get creative …

float test1 = 0.1f * sin(time);
if (alpha > 0.6f + test1) vResult = outline colour

Would produce an animated outline.

You are really only limited by your imagination.

1 Like