Graphics Reference
In-Depth Information
Table 9-12
Standard Texture Compression Formats (continued)
Size (bits
per pixel)
internalFormat
Description
GL_COMPRESSED_RGB8_
PUNCHTHROUGH_ALPHA1_ETC2
4
Four-channel unsigned compressed
GL_RGBA format with 1-bit alpha
GL_COMPRESSED_SRGB8_
PUNCHTHROUGH_ALPHA1_ETC2
4
Four-channel unsigned compressed
GL_RGBA format with 1-bit alpha
in sRGB colorspace
GL_COMPRESSED_RGBA8_ ETC2_EAC
8
Four-channel unsigned compressed
GL_RGBA format
GL_COMPRESSED_SRGBA8_ ETC2_EAC
8
Four-channel unsigned compressed
GL_RGBA format in sRGB
colorspace
Once a texture has been loaded as a compressed texture, it can be used for
texturing in exactly the same way as an uncompressed texture. The details
of the ETC2/EAC formats are beyond our scope here, and most developers
will never write their own compressors. Freely available tools for generating
ETC images include the open-source libKTX library from Khronos ( http://
khronos.org/opengles/sdk/tools/KTX/), the rg_etc project ( https://code
. google.com/p/rg-etc1/), the ARM Mali Texture Compression Tool, Qualcomm
TexCompress (included in the Adreno SDK), and Imagination Technologies
PVRTexTool. We would encourage readers to evaluate the available tools and
choose the one that fits best with their development environment/platform.
Note that all implementations of OpenGL ES 3.0 will support the formats
listed in Table 9-12. In addition, some implementations may support vendor-
specific compressed formats not listed in Table 9-12. If you attempt to use a
texture compression format on an OpenGL ES 3.0 implementation that does
not support it, a GL_INVALID_ENUM error will be generated. It is important
that you check that the OpenGL ES 3.0 implementation exports the
extension string for any vendor-specific texture compression format you use.
If it does not, you must fall back to using an uncompressed texture format.
In addition to checking extension strings, there is another method
you can use to determine which texture compression formats
are supported by an implementation. That is, you can query for
GL_NUM_COMPRESSED_TEXTURE_FORMATS using glGetIntegerv to determine
the number of compressed image formats supported. You can then query
for GL_COMPRESSED_TEXTURE_FORMATS using glGetIntegerv , which will
return an array of GLenum values. Each GLenum value in the array will be a
compressed texture format that is supported by the implementation.
 
 
Search WWH ::




Custom Search