Graphics Reference
In-Depth Information
Table 9-4
Valid Unsized Internal Format Combinations for glTexImage2D
internalFormat
format
type
Input Data
GL_RGB
GL_RGB
GL_UNSIGNED_BYTE
8/8/8 RGB 24-bit
GL_RGB
GL_RGB
GL_UNSIGNED_SHORT_5_6_5
5/6/5 RGB 16-bit
GL_RGBA
GL_RGBA
GL_UNSIGNED_BYTE
8/8/8/8 RGBA 32-bit
GL_RGBA
GL_RGBA
GL_UNSIGNED_SHORT_4_4_4_4 4/4/4/4 RGBA 16-bit
GL_RGBA
GL_RGBA
GL_UNSIGNED_SHORT_5_5_5_1 5/5/5/1 RGBA 16-bit
GL_
LUMINANCE_
ALPHA
GL_
LUMINANCE_
ALPHA
GL_UNSIGNED_BYTE
8/8 LA 16-bit
GL_
LUMINANCE
GL_LUMINANCE GL_UNSIGNED_BYTE
8L 8-bit
GL_ALPHA
GL_ALPHA
GL_UNSIGNED_BYTE
8A 8-bit
To explain the large variety of texture formats in OpenGL ES 3.0, we have
organized them into the following categories: normalized texture formats,
floating-point textures, integer textures, shared exponent textures, sRGB
textures, and depth textures.
Normalized Texture Formats
Table 9-5 lists the set of internal format combinations that can be used
to specify normalized texture formats. By “normalized,” we mean that
the results when fetched from the texture in the fragment shader will
be in the [0.0, 1.0] range (or [-1.0, 1.0] range in the case of *_SNORM
formats). For example, a GL_R8 image specified with GL_UNSIGNED_BYTE
data will take each 8-bit unsigned byte value in the range from  [0, 255]
and map it to [0.0, 1.0] when fetched in the fragment shader. A
GL_R8_SNORM image specified with GL_BYTE data will take each 8-bit
signed byte value in the range from [-128, 127] and map it to [-1.0, 1.0]
when fetched.
The normalized formats can be specified with between one and four
components per texel (R, RG, RGB, or RGBA). OpenGL ES 3.0 also
introduces GL_RGB10_A2 , which allows the specification of texture
image data with 10 bits for each (R, G, B) value and 2 bits for each alpha
value.
 
 
Search WWH ::




Custom Search