Non-blurry transparent text?

Blitz3D Forums/Blitz3D Programming/Non-blurry transparent text?

JoshK(Posted 2003) [#1]
I am using power of 2 textures, and cleared the texture filters to disable mipmapping, but my 2D in 3D text comes out really blurry. Is there any way around this, or do I have to use a completely different method?




Warren(Posted 2003) [#2]
Bilinear filtering. You can't turn it off, so you either live with it or do the text using 2D commands.


simonh(Posted 2003) [#3]
Try this method for disabling bi-linear filtering on sprites:

http://www.blitzbasic.com/codearcs/codearcs.php?code=773


Bot Builder(Posted 2003) [#4]
hmmm. would using a ^2 sprite work? how about a sprite per letter?


jfk EO-11110(Posted 2003) [#5]
Erh - nothin


simonh(Posted 2003) [#6]
If that is what I think it is Aimon then it will only work if your texture has the same number of pixels as you are covering on the screen. Or maybe you could do twice as many pixels.

Awift: It is Simon Armstrong's pixie code.

The pixie code is pixel-perfect, end of story. As long as your textures are to the power of 2, then everything will be as sharp as can be. Depending on what the screen resolution is set to, the size of the sprites will be scaled accordingly so that they shrink/expand with the screen resolution as normal 2D text commands would.

Of course, you'd probably need something like a 16x16 texture for each character though.

The blurriness is caused by the antialiasing which is done by the trialinear mipmapping.

Huh? 'Trialinear mipmapping'? Halo has stated that he has cleared the texture filters, so that should remove all mipmapping effects.

That only leaves bi-linear filtering, which as mentioned can't really be disabled in Blitz except for the use of Simon's trick with sprites.

There is no reason why 3D graphics shouldn't be as sharp as 2D graphics, blurriness can nearly always be eradicated. Of course, blurriness in some cases is quite desirable.

Edit - according to the Simon's code archive entry it now handles odd-sized textures as well.


sswift(Posted 2003) [#7]
"Awift:"

Ha ha, I just made a typo, don't have to be a smartass. :-)



"The pixie code is pixel-perfect, end of story."

"Depending on what the screen resolution is set to, the size of the sprites will be scaled accordingly so that they shrink/expand with the screen resolution as normal 2D text commands would."

Wait a minute... you're saying that his pixie code makes stuff smaller in higher resolutions just like when you draw with 2D commands?

Eew! :-)

Well in that case, you're absolutely right. It would be perfectly sharp in any resolution. I was wrong, because I assumed that anyone making sprite code in 3D would want the sprites to remain the same size on the screen in any resolution.


Anyway... I do not like the idea of your user interface in a game changing scale depending on the resolution. If you allow the user to select different resolutions, either your text and windows are gonna be huge in 640x480, or tiny in 1600x1200. I find that unacceptable and unprofessional looking in a game interface, except for those game which require tons of text, like a rollercoaster sim.


"Huh? 'Trialinear mipmapping'?"

TRIlinear mipmapping. Stop quoting my typos. :-) I type too fast, and too much, to spend time proofreading. :-)


"Halo has stated that he has cleared the texture filters, so that should remove all mipmapping effects."


That's true, but if he had actually done that then his text would look sharp and have all these ugly jaggies on it because some pixels would get doubled and some would not...

...Unless his texture is so low res that it's being scaled UP, and in that case he'd simply be an idiot for asking why it's so blurry. :-)

So I have to assume that even though he thinks he disabled mipmapping, he did not.


"That only leaves bi-linear filtering, which as mentioned can't really be disabled in Blitz"

It's true that you can't disable bilinear filtering, but as bilinear filtering only occurs when you scale the texture UP, that means that unless Halo's letters are really low res, Bilienar filtering will have nothing to do with how they look in that screenshot above.


"There is no reason why 3D graphics shouldn't be as sharp as 2D graphics"

Yes there is. It's called aliasing.

Draw a 2D diagonal line in 640x480. You will see a line of pixels that looks jagged.

That line is sharp, but it is aliased. And it bears no resemblance to how a string viewed through a screen door would look if you looked at the amount of light coming through each hole in the mesh. The string would be partially behind some squares and completely fill others. Those that are completely filled are what you drew in 2D. But that will look sharp but jagged and not like real life. So you need to draw those pixels which only have a little bit of the string in them too, and you do that by only drawing them a 25% brightness or whatever percentage of the string passes through them. That's antialiasing. And when your screen has big holes in it, like 640x480, then it looks really blurry. But when you have little holes like 1024x768 it looks a lot sharper.

So you can draw 3d scenes to be perfectly sharp, but then stuff will look like ass, like the original Doom looks, with speckles of light dancing about in the distance.

Try making a wire mesh grating and display it without mipmapping, and look at how bad it looks when it moves intothe distance. Moire effect that's called.

Antialiasing = good. Low res = bad. Low res + antialiasing = blurry, low res + no antialiasing = looks sharp but with all kinds of speckle, moire and stairstepping artifacts.

So choose your poison. I suggest just ignoring that your game looks like crap in low res because most people can do at least 1024x768 and will choose that if you give them the option.


_PJ_(Posted 2003) [#8]
I see this same effect on many commercial games too, so I don't think it can be helped much except by the end-user's hardware