GL_OES_texture_npot#

Supported Hardware#

Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 1.x, 2.0

Description#

This extension removes almost all of the limitations surrounding non-power of two textures in OpenGL ES 1.x and 2.0. MIP Map specification is now allowed, and minification filters that include a MIP Map filter will now work as expected for Power of Two textures. All available wrap modes will now work as well, rather than just GL_CLAMP. The only restriction that this extension does not lift is that in OpenGL ES 1.x, glGenerateMIPMaps will not work unless GL_OES_framebuffer_object is also supported.

Note#

This functionality is core to OpenGL ES 3.0.

Example#

// Upload a texture with dimensions of 15 by 47. Typically, this isn't supported without
// extension support.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 15, 47, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixelData);
// This extension lifts any restrictions on non-power of two textures, and all filter/wrap
// modes can be used.
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);