Non square textures OK?

Blitz3D Forums/Blitz3D Programming/Non square textures OK?

Who was John Galt?(Posted 2004) [#1]
I know I should aim to keep texture width and height to powers of 2, but are there any issues with non square textures, e.g 256*128 etc?


sswift(Posted 2004) [#2]
Yes. Some older cards will scale them vertically or horizontally and that will lead to odd artifacts with the bilinear filtering.

But I think they stopped doing that around the TNT 2. I think.


AdrianT(Posted 2004) [#3]
they work, but I think they get scaled to the nearest square automatically, and blur more than one would like.

Might be mistaken though :)


Who was John Galt?(Posted 2004) [#4]
Thanks guys - think I still need to do some experimentation, though.


Gabriel(Posted 2004) [#5]
It's easy enough to test.

Graphics3d 640,480,0

Texture=CreateTexture(256,128)
w=TextureWidth(Texture)
h=TextureHeight(Texture)
EndGraphics
Print "Width: "+W+" Height: "+H



Ask as many people as possible with old and unusual videocards to test that and report the results.

I'll start you off with it working just fine ( 256,128 ) on a Radeon 9700 Pro.


Mustang(Posted 2004) [#6]
Square textures should be OK with any half modern card - our coders once said to me that it would be best not to exceed 8:1 ratio though.


Who was John Galt?(Posted 2004) [#7]
Good stuff - I'm only aiming @ say a Geforce2 as a base card - me game's going to run too slow on anything older anyways by the look of it.

If anyone is interested in compatibility with older cards, by all means hijack this thread!


AdrianT(Posted 2004) [#8]
hmm, I was under the impression that blitz dynamically scaled non square textures, If it doesn't then thats good news indeed.

From what I understand the whole square texture thing came about due to the early 3dfx voodoo cards, and so long as you don't have a voodoo3 or lower non square textures should be fine so long as they are power of 2 in their dimensions.


skidracer(Posted 2004) [#9]
Evak, you might be getting confused with non squared edge lengths (as in power of 2) which Blitz will dynamically scale to.


AntonyWells(Posted 2004) [#10]
Sure mark even needs to do it? gl never complains when I load any abnormal non-square/non power of 2 texture. It scales the image internally automatically.(And displays fine.)


skidracer(Posted 2004) [#11]
FYI there is a thin blurry line between fine and pixel perfect.


AntonyWells(Posted 2004) [#12]
Yes, but if a texture is non power of 2 in it's original form, there is no way to display it pixel perfect as a texture(Without using nonpower of 2 textures obviously)

As you'd lose the aspect ratio no matter how you scale it. Unless you use a texture bigger than the image...but surely that means having to use dummy uvs in code and fix them as blitz gets them from the 'user'.?


If there is a method I'm not aware of, please do point it out ;)

Actually one way could be to just adjust the texture matrix behind the scenes..so 1 equals 0.7.. That would be decent, but would fall apart when you bring shaders into the equation, as they by-pass gl's matrix tforms of the uvs.