BRAINFART: question on image sizes

BlitzMax Forums/BlitzMax Beginners Area/BRAINFART: question on image sizes

GfK(Posted 2011) [#1]
Not sure what's wrong with my brain lately. Must get it out of its box one day and have a look.

Anyway... I always try to keep image sizes ^2, like you do. But are non-square images OK on most hardware these days? To put it another way, if I were to have a single image that was, say, 64x1024, would that be considered "safe"? Or would dDX9/GL decree that it must upscale it internally to 1024x1024 or something stupid like that?


JaviCervera(Posted 2011) [#2]
Graphics cards that force you to use power-of-two image sizes demand that the texture has a power-of-two width and power-of-two height, but they don't need to be of the same size.

Last edited 2011


Kryzon(Posted 2011) [#3]
Yeah, 'non-square' textures can still have power-of-2 sides: 64x1024 for instance.


ima747(Posted 2011) [#4]
it should be noted just for the record that SQUARE pow 2 is not totally dead, lots of mobile hardware (such as first gen iPhone, I think they changed it with the 3GS and support for openGL ES 2.0 but not 100% sure on that) still requires SQUARE pow 2. desktops not so much (e.g. blitzmax targets) but good to know if you plan to take your stuff elsewhere. (most graphics libs etc. will handle auto pow 2ing and auto squaring as needed, including bmax, assuming you're not doing the texture handling yourself...)


Jesse(Posted 2011) [#5]
Bmax images do not have have to be pow 2 square. the textures created from non power of 2 images conform to what Kryzon points out. ex: an image(pixmap) 33x129 is copied in to a a texture 64x256.

Last edited 2011


Gabriel(Posted 2011) [#6]
it should be noted just for the record that SQUARE pow 2 is not totally dead, lots of mobile hardware (such as first gen iPhone, I think they changed it with the 3GS and support for openGL ES 2.0 but not 100% sure on that) still requires SQUARE pow 2.

Depends on the format you use. If you use uncompressed textures, they don't need to be square. If they're compressed, they certainly do need to be square. Given that you almost always do want to be using compressed textures with iOS, I'd say that square images were a must if you intend to port to that platform.

To put it another way, if I were to have a single image that was, say, 64x1024, would that be considered "safe"?

There's a 8:1 or 1:8 width/height ratio which needs to be considered too. On desktops, non-square textures work on virtually everything. I doubt there are any old voodoo 2's left floating around. However, I can't remember the level of hardware which exhibits problems with textures which have a greater than 8:1 or 1:8 w/h ratio.

If you could get away with 128x1024, I would use that, if I were you.


Czar Flavius(Posted 2011) [#7]
How can I store and draw compressed textures on Windows? Performance loss is acceptable.


Kryzon(Posted 2011) [#8]
Gabriel, what did you mean with compressed textures? just DDS or JPEG, PNG etc?