h1

The pain of threading and bitmap fonts

July 29, 2010

I had forgotten how much i hate using threading. It creates just as many problems as it solves. Although it’s cool that i can load stuff while the game continues to run (and probably just show a loading screen), it has complicated the flow of my code to a fairly unfortunate degree. Ah well, such is the way of things, I guess.

So anyway… my fonts. I have been fighting with these damn fonts for too long now. The mipmaps helped, but ended up making the fonts look quite fuzzy/blurry which, although better that just plain crap, makes you feel like you need to plan a trip to the optometrist to get laser eye correction surgery. I’ve tried a bunch of different filters to create the mipmaps and filter between at render time, but when it boils down to it if you reduce the size of an image, you are losing fidelity and nothing seems to be able to keep it nice and sharp. The best looking the fonts get is when they are rendered at a 1 to 1 ratio, meaning no mipmaps and no filters. 😦 So, my current solution is a sort of mipmap setup but instead of taking the original font image and downscaling that, I’m rendering a number of versions of the font image and different font sizes. My font manager then returns the one that is closest to the size you want. This reduces the amount of mipmapping needed when rendering the font out because you are close to (ideally) a 1 to 1 ratio. Obviously I can’t render out a different texture for every font size possible, but it’s better than it was. I think.

It’s still hardly perfect and I would love to be able to make it better, but as I said I’ve wasted too much time on this thing now. If I really need sharp fonts in my game, I’ll have to make the font images at the sizes I need them. So be it.

Now I’m back onto trying to sort out that whole depth sorting thing with the in game objects.

Leave a comment