Non square textures OK?
Blitz3D Forums/Blitz3D Programming/Non square textures OK?
| ||
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? |
| ||
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. |
| ||
they work, but I think they get scaled to the nearest square automatically, and blur more than one would like. Might be mistaken though :) |
| ||
Thanks guys - think I still need to do some experimentation, though. |
| ||
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. |
| ||
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. |
| ||
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! |
| ||
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. |
| ||
Evak, you might be getting confused with non squared edge lengths (as in power of 2) which Blitz will dynamically scale to. |
| ||
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.) |
| ||
FYI there is a thin blurry line between fine and pixel perfect. |
| ||
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. |