non-square textures?

Blitz3D Forums/Blitz3D Beginners Area/non-square textures?

rsbrowndog(Posted 2003) [#1]
All,

What happens in Blitz if I want to use a non-square texture? e.g. 32 x 96?

Cheers,

Ryan


Gabriel(Posted 2003) [#2]
That's two questions in one really. If you use 32x96, it'll be resized to 32x128. There's nothing wrong with non square textures, not since the days of the voodoo cards. But you have to use powers of 2, or the texture will be resized. The rule seems to be ( ie: I don't know this, I've observed it ) that textures are resized always upwards and always to the next power of 2. It makes things very blurry, so I strongly advise against using any texture that isn't a power of 2.

If the image absolutely has to be a size which is not power of 2, load the image, create a texture of a power of 2 size, copy the texture to the top left corner of the texture and adjust the UV coordinates to fit the texture correctly.


Mustang(Posted 2003) [#3]
Blitz scaling is ugly (but fast), so do the stretching using Photoshop if you have odd-sized texture. And avoid very high width*height ratios, keep it under 8:1 (or 1:8). And do not use very small textures like 2*2... 8*8 is lowest I would ever use.


rsbrowndog(Posted 2003) [#4]
Thanks guys.

Shows how poor my maths must be, as I thought 32x96 WAS power of 2... oh dear!

Cheers,

Ryan


ford escort(Posted 2003) [#5]
2
4
8
16
32
64
128
256
512
1024
2048
4096
are powers of 2 :)


FlameDuck(Posted 2003) [#6]
On some cards, the textures don't need to be a power of 2 either. On some they only need to be a power of two wide. On some they have to be square.

TextureWidth and TextureHeight are your friends, and the documentation includes an incredibly useful example for determining the texture abilities of any given card.