GL_IMG_texture_npot#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 2.0

Description#

This extension adds MIPMap capable minification filters to OpenGL ES 2 for non-power of two (NPOT) textures. OpenGL ES 2 limits NPOT textures as it does not support MIPMapping for them. This extension allows users to call ‘glGenerateMipMap’ to create a full MIP chain, and then adds minification filters that allow them to be accessed. This extension does not add functionality allowing applications to supply a full NPOT MIP Map chain prior to runtime, however.

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);
// Mip-Maps can't be specified by this extension, but can be auto-generated for non-compressed
// textures
glGenerateMipmap(GL_TEXTURE_2D);
// Any filter mode specified by OpenGL is now valid with this extension, whereas it would not
// have been previously.
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Only the following parameters are specifiable, anything else is invalid (including the
// default texture parameters!).
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);