PDA

View Full Version : GL_TEXTURE_2D dimensions don't have to be POW ?



opengl_fan
09-10-2008, 05:35 PM
To my impression, for GL_TEXTURE_2D type of texture, the dimension must be power of twos.

But it seems now it's not a must.

"glTexImage2D(GL_TEXTURE_2D ... )" function call can accept non-power-of-two width/height without problems .

I just wondering if someone can confirm this change. Thanks. BTW, I am using a Nvidia card.

Seth Hoffert
09-10-2008, 05:46 PM
The ARB_texture_non_power_of_two extension relaxes the power-of-two restriction.

opengl_fan
09-10-2008, 05:54 PM
Thanks. Now I know I don't have to use GL_TEXTURE_RECTANGLE for NPOW dimension textures :)

Leadwerks
09-11-2008, 12:04 AM
FYI, because this extension is core, AMD cards don't include the name in the extensions strings, but it still works.

V-man
09-11-2008, 02:17 PM
http://www.opengl.org/wiki/index.php/NPOT_Textures

opengl_fan
09-11-2008, 02:33 PM
Thanks guys for your kind help :)

NULL_PTR
09-12-2008, 01:21 PM
FYI, because this extension is core, AMD cards don't include the name in the extensions strings, but it still works.
They don't include it, when the extension is not fully supported (fallback in software in some cases). But can be used under some restrictions (Conditional NPOT in DX terminology).
Latest DX10-level AMD cards include GL_ARB_texture_non_power_of_two in extension string.

Eosie
09-14-2008, 06:53 AM
To make sure that the software fallback will not occur and provided your GL implementation is not screwed up, you may check the device ID using WinAPI which tells you exactly what GPU you have (nvidia has a nice table somewhere). Maybe this is the only way of detecting this.