POT ofTexture should have equal w/h size?

Most of the examples refer to POT square size textures.
Is it less performant a texture which is a rectangle ie 128x512, even when their w and h are POT respectively?


Hi @kovicic!

Unless you are on seriously old hardware (by which i mean 7+ years old) there should be no performance penalty for using non power of two textures - or non-square textures.

There are some features, like texture compression, which require texture sizes to be multiples of 4, but that’s all i can think of at the moment.

Are you running into a specific performance issue?

Hi @tgfrerer| thanks for responding. Actually it’s for a 2D real time rendering installation. I am aware of the pros and cons of NPOT textures, not to be used when you need mip maps, etc.

My doubt it’s more leaned to the conceptual aspect, I had no luck in the OpenGL forum.
Actually I want to know the difference of performance between squared POT textures and rectangular POT textures.
POT implies square textures?

Text A
w = 2^n
h = 2^n


Text B
w = 2^k
h = 2^m k > m

Both thextures have POT w/h, however one of them is rectangular and the other it isn’t.
I’ve read somewhere that if the texture is rectangular it is padded to fit a square in GPU. I don’t know if is an updated information.

Thanks :slight_smile:

I say it’s fairly safe to believe that any GPUs that supports OpenGL 3+ will not pad to a power of two, and also won’t pad to a square, but if they did, it’s something they (the drivers) do internally, and should not have to touch your code. Non-power of two textures have been promoted a core feature to OpenGL since version 2.0.

Actually, you can use NPOT textures for mipmaps, that’s been possible for quite a while now, and the current openFrameworks:master now supports mipmap generation too, which might come in handy for a 2d realtime installation. Where mipmaps break down is if you want to use GL_TEXTURE_RECTANGLE, since mipmaps want GL_TEXTURE_2D.

Ok then, thanks for your clear response and for pointing out some concepts. Yes, when I thought of the need to pad to a square I figured out that was a driver technique rather than an issue that goes for the programmer. I just was courious by the implicances in the performances of different shapes that have POT dimensions: rectangles or squares.