PDA

View Full Version : Square Textures



Falkenbach
09-04-2004, 08:15 AM
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

lgrosshennig
09-04-2004, 10:10 AM
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.

Falkenbach
09-07-2004, 11:05 AM
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?

Cheers!

dorbie
09-08-2004, 07:42 PM
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.

Falkenbach
09-11-2004, 06:53 AM
Alright. Thanks everybody :) 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 ;)