Square Textures

Hello Folks!

I need some hints, or better an official definition, why it is good to use square Textures. Does it somehow accelerate my Texturetransfer on my Graphic-Card or what?

Thanks in advance

In the “classic” OpenGL there is a limitation that you only can use power of 2 values for height and width, but that does not mean that you have to use square textures, a 512x128 texture is perfectly valid. The power of 2 limitation allows you to calculate the final memory address for a given texel by simply using fast bitwise shifts instead of a more expensive integer multiply.

I hope this answers your question.

Thanks for answering! I know about the power of 2 limitation, but i read from time to time that, if you want good performance with your textures, you should use the same dimensions for width and height. Does perhaps glCopyTexSubImage2D or similar calls profit of that?


I haven’t heard of this alleged performance advantage. It sounds specious or antiquated at best. It is probably a misinterpretation of the 2^n limit or the result of some bad measurement.

You could certainly take the wrong lesson away from a bad test of this theory due to texture cache behaviour so be careful what you mesure if you decide to test this.

Alright. Thanks everybody :slight_smile: But after all I’m still not fully convinced that there’s nothing about it. I’m working with textures in respect of Shadow-Mapping, and in quite a lot Example-Implementations, like Paul’s Projects and stuff, the Shadowmap-Texture had width and heigt equal…well, who knows :wink: