View Full Version : power of two size

02-19-2005, 08:38 AM
hey, I was wondering, this rule of texture just images with "power of two size" sux.... does someone know a way to use images without this kind of size?

02-19-2005, 08:55 AM
There's an ARB extension for that. Something like ARB_NONPOWEROFTWO. Do a search on google.

02-19-2005, 09:11 AM
This extension is called ARB_texture_non_power_of_two, and it is a core feature of OpenGL 2.0. AFAIK the GF 6800 is the only card that supports this extension.

There is another way though. With the ARB_texture_rectangle you can have arbitrary sized 2D textures, but with some limitations (no mipmapping, no repeating, no border if i remember correctly). It is supported by most modern cards.

02-19-2005, 09:11 AM
Just round up to the next power of 2 higher and change your texture coordinates. Pack another texture in the extra space if you are really hard up...

02-19-2005, 02:57 PM
I heard about a function called gluScaleImage
what this function's job ?

02-21-2005, 09:58 AM
As far as I know this takes a MxN textures and scales it to WxH.
This is what most people does when having npotd textures.
I heard this function is often slow... I don't know if this is true but I just wanted to tell you, anyway it's not in a performance path so it really does not care.

02-21-2005, 11:40 AM
whats MxN ???

02-24-2005, 08:47 AM
Originally posted by Obli:
As far as I know this takes a MxN textures and scales it to WxH.What I meant to say is that it takes a texture which is MxN pixels and resizes it to WxH (width x height).
Maybe WxH should be power of two dimensioned. I don't remember.

02-25-2005, 07:34 AM
BTW my GF 6600 just loads textures with non power of 2 sizes without any codechanges! :rolleyes: I just discovered this fact when I tried my application on an older card where I got a GLerror. Quite nice not to think about the images sizes. :D