Skip to main content
gamedev.net
🔒 Locked

Bitmapped Font artifacts

Started by TTK-Bandit 4 replies 750+ views
Original Post
TTK-Bandit
TTK-Bandit
hey I get some artifacts when drawing small bitmapped fonts at a position that is not an exact pixel coordinate. For example when x is 50.23 while drawing a string. This happens, when I center align the text I found that I can just round the x/y positions and the problem is gone, but is there any nicer solution ?
ecco_the_dolphin
ecco_the_dolphin
what kind of aritifacts do you have?
Do you use some blending functions? If so try to disable blending.
TTK-Bandit
TTK-Bandit
I use the alphachannel to make the transparency, and also outline effects.
Can't just disable them, need them.
ecco_the_dolphin
ecco_the_dolphin
About what outline effects you are saying? :) You said that you use BITMAPPED fonts.
If I correct, and you use blending functions when drawing bitmap with raster position that is not an exact pixel coordinate, then you get blurring artifacts. It is not realy artifacts, it is how blending works :). but if you dont want this blurring, then the only way to archive that is to specify exact pixel coordinate.
Ravyne
Ravyne
I would just round them, if you're using solid pixels with alpha its going to look a little wierd when a narrow line crosses a pixel boundary if you don't. The user is never going to notice that the text is 1/3 of a pixel off center, and its the solution that already works, no use spending time on a different solution.

There are methods to get sub-pixel accuracy for text (or other high-contrast) rasterization, but you'd have to write a shader for it.
throw table_exception("(? ???)? ? ???");
TTK-Bandit
TTK-Bandit
ecco: ywah, thats the effect i'm getting.
I'll just round'em then.
Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.