Configurable Antialiasing #194
-
Hi there, I was using the shader to render some fonts and I really love the overall look, except for one thing: pixelated fonts. I was wondering if you could tell of me a clean way to change the antialiasing behaviour, as I am curently unable to fully understand the entirety of the distance calculations. The most ideal way would be for a float value, indicating the "smoothness". But which of the values would I need to multiply with that value, in order so make the edge aliased. I figured out that if you change the unitRange to 1, it will end up aliased but this is surely not the right way, is it? Also the dot product is what gets me confused. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I don't understand what exactly you mean by "pixelated fonts", "make the edge aliased". Post an example of what you want it to look like. If you want to disable anti-aliasing and just make each pixel fully transparent or opaque (that's what I might call "pixelated"), then do: float sd = median(msd.r, msd.g, msd.b);
float opacity = step(0.5, sd);
return lerp(float4(0, 0, 0, 0), fgColor, opacity); |
Beta Was this translation helpful? Give feedback.
I don't understand what exactly you mean by "pixelated fonts", "make the edge aliased". Post an example of what you want it to look like.
If you want to disable anti-aliasing and just make each pixel fully transparent or opaque (that's what I might call "pixelated"), then do: