GL_OES_texture_half_float#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT (ES2/3 Only)

Valid APIs#

OpenGL ES 1.x, 2.0

Description#

This extension adds the ability to use 16-bit floating point type (GL_HALF_FLOAT) representations of texture data as a readable texture format when shading an object. This extension does not add linear sampling from this texture type however due to the high cost of such an operation, which is instead enabled by GL_OES_texture_half_float_linear. This extension also does not allow these textures to be used as a colour attachment for a framebuffer. The extension GL_EXT_color_buffer_half_float allows half float textures to be attached to a framebuffer.

The half-float data format consists of 1 sign bit, 5 exponent bits and 10 mantissa bits, and allows greater range than an integer representation would, whilst reducing the memory footprint to that of a short data type.

Note#

This functionality is core to OpenGL ES 3.0.

Example#

// Create a floating-point texture
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1024, 1024, 0, GL_RGBA, GL_HALF_FLOAT_OES, pixelData);
// Only nearest filtering is supported for these textures for this extension. Linear filtering
// is enabled by separate extensions.
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);