GL_OES_compressed_ETC1_RGB8_texture#
Supported Hardware#
Series5, Series5XT, Series6, Series6XE, Series6XT
Valid APIs#
OpenGL ES 1.x, 2.0, 3.x
Description#
This extension adds support for loading textures that have been compressed with the ETC1 texture compression scheme, directly into the API via glCompressedTexImage2D. This format provides RGB texture encoding at a lower bitrate than would otherwise be available, whilst still providing reasonable quality.
As this specification was written against OpenGL ES1, when used in ES2, some features applicable to ES2 are not available due to the non-trivial nature of colour read back from an ETC texture. In particular; Non-power of two ETC1 is not directly supported in some first generation ES2 hardware, so it’s generally best to ensure that all ETC1 textures are encoded with square, power-of-two dimensions.
Note#
Whilst this functionality can be exposed in OpenGL ES 3.0, it is effectively enabled anyway by the inclusion in core 3.0 of ETC2, which is backwards compatible. By passing the same data with the new enum “GL_COMPRESSED_RGB8_ETC2” the behaviour can be replicated.
Registry Link#
http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
Example#
// Upload an ETC1 texture.
GLuint bitsPerPixel = 4;
glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB8_ETC2, 1024, 1024, 0,
(width*height*bitsPerPixel)/8, pixelData);