• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    OES_texture_half_float
4    OES_texture_float
5
6Name Strings
7
8    GL_OES_texture_half_float, GL_OES_texture_float
9
10Contact
11
12    Benj Lipchak, Apple (lipchak 'at' apple.com)
13
14Notice
15
16    Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at
17        http://www.khronos.org/registry/speccopyright.html
18
19Specification Update Policy
20
21    Khronos-approved extension specifications are updated in response to
22    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
23    extensions which have been promoted to a core Specification, fixes will
24    first appear in the latest version of that core Specification, and will
25    eventually be backported to the extension document. This policy is
26    described in more detail at
27        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
28
29IP Status
30
31    Please refer to the ARB_texture_float extension.
32
33Status
34
35    Ratified by the Khronos BOP, July 22, 2005.
36
37Version
38
39    Last Modified Date:  November 9, 2011
40
41Number
42
43    OpenGL ES Extension #36
44
45Dependencies
46
47    This extension is written against the OpenGL ES 2.0 Specification.
48
49    OES_texture_3D affects the definition of this extension.
50
51Overview
52
53    These extensions add texture formats with 16- (aka half float) and 32-bit
54    floating-point components.  The 32-bit floating-point components
55    are in the standard IEEE float format.  The 16-bit floating-point
56    components have 1 sign bit, 5 exponent bits, and 10 mantissa bits.
57    Floating-point components are clamped to the limits of the range
58    representable by their format.
59
60    The OES_texture_half_float extension string indicates that the
61    implementation supports 16-bit floating pt texture formats.
62
63    The OES_texture_float extension string indicates that the
64    implementation supports 32-bit floating pt texture formats.
65
66    Both these extensions only require NEAREST magnification filter and
67    NEAREST, and NEAREST_MIPMAP_NEAREST minification filters to be supported.
68
69Issues
70
71    1.  What should we do if magnification filter for a texture with half-float
72        or float channels is set to LINEAR.
73
74        RESOLUTION: The texture will be marked as incomplete.
75        Only the NEAREST filter is supported.
76
77        The cost of doing a LINEAR filter for these texture formats can be
78        quite prohibitive.  There was a discussion on having the shader
79        generate code to do LINEAR filter by making individual texture calls with a
80        NEAREST filter but again the computational and memory b/w costs decided
81        against mandating this approach.  The decision was that this extension
82        would only enable NEAREST magnification filter.  Support for LINEAR
83        magnification filter would be done through a separate extension.
84
85    2.  What should we do if minification filter is set to LINEAR or
86        LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR and LINEAR_MIPMAP_LINEAR.
87
88        RESOLUTION: The texture will be marked as incomplete.  Only the NEAREST
89        and NEAREST_MIPMAP_NEAREST minification filters are supported.
90
91        This was decided for the same reasons given in issue #1.  The decision
92        was that this extension would only enable NEAREST and NEAREST_MIPMAP_NEAREST
93        minification filters, and the remaining OpenGL ES minification filters
94        would be supported through a separate extension.
95
96    3.  Should CopyTexImage2D, CopyTexSubImage{2D|3D} be supported for textures
97        with half-float and float channels?
98
99        RESOLUTION: No.
100
101New Procedures and Functions
102
103   None
104
105New Tokens
106
107    Accepted by the <type> parameter of TexImage2D,  TexSubImage2D,
108    TexImage3D, and TexSubImage3D
109
110        HALF_FLOAT_OES                0x8D61
111        FLOAT                         0x1406
112
113Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation)
114
115    Add a new section called 16-Bit Floating-Point Numbers
116
117    "A 16-bit floating-point number has a 1-bit sign (S), a 5-bit
118    exponent (E), and a 10-bit mantissa (M).  The value of a 16-bit
119    floating-point number is determined by the following:
120
121        (-1)^S * 0.0,                        if E == 0 and M == 0,
122        (-1)^S * 2^-14 * (M / 2^10),         if E == 0 and M != 0,
123        (-1)^S * 2^(E-15) * (1 + M/2^10),    if 0 < E < 31,
124        (-1)^S * INF,                        if E == 31 and M == 0, or
125        NaN,                                 if E == 31 and M != 0,
126
127    where
128
129        S = floor((N mod 65536) / 32768),
130        E = floor((N mod 32768) / 1024), and
131        M = N mod 1024.
132
133    Implementations are also allowed to use any of the following
134    alternative encodings:
135
136        (-1)^S * 0.0,                        if E == 0 and M != 0,
137        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M == 0, or
138        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M != 0,
139
140    Any representable 16-bit floating-point value is legal as input
141    to a GL command that accepts 16-bit floating-point data.  The
142    result of providing a value that is not a floating-point number
143    (such as infinity or NaN) to such a command is unspecified, but
144    must not lead to GL interruption or termination.  Providing a
145    denormalized number or negative zero to GL must yield predictable
146    results."
147
148    Add to Table 2.2, p. 12:
149
150                Minimum
151       GL Type  Bit Width  Description
152       -------  ---------  -----------------------------------
153       half     16         Half-precision floating-point value
154                           encoded in an unsigned scalar
155
156Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
157
158    Add to Table 3.2, p. 62:
159
160        type Parameter  Corresponding  Special
161        Token Name      GL Data Type   Interpretation
162        --------------  -------------  --------------
163        HALF_FLOAT_OES  half           No
164
165    Modify first sentence of "Unpacking", p. 62:
166
167    "Data are taken from client memory as a sequence of one of the GL data
168    types listed in Table 3.2. These elements are..."
169
170    Add to Table 3.4, p. 63:
171
172        Format           Type            Bytes per Pixel
173        ---------        --------------  ---------------
174        RGBA             FLOAT           16
175        RGB              FLOAT           12
176        LUMINANCE_ALPHA  FLOAT           8
177        LUMINANCE        FLOAT           4
178        ALPHA            FLOAT           4
179        RGBA             HALF_FLOAT_OES  8
180        RGB              HALF_FLOAT_OES  6
181        LUMINANCE_ALPHA  HALF_FLOAT_OES  4
182        LUMINANCE        HALF_FLOAT_OES  2
183        ALPHA            HALF_FLOAT_OES  2
184
185    Modify fifth paragraph of 3.7.1 Texture Image Specification, p. 67:
186
187    "The selected groups are processed as described in section 3.6.2, stopping
188    after final expansion to RGBA. If the internal format of the texture is
189    fixed-point, components are clamped to [0,1]. Otherwise, values are not
190    modified."
191
192Interactions with OES_texture_3D
193
194    If OES_texture_3D is not supported, ignore references to TexImage3D and
195    TexSubImage3D.
196
197Revision History
198
199    04/29/2005    0.1    Original draft.
200    06/29/2005    0.2    Added issues on why only NEAREST and
201                         NEAREST_MIPMAP_NEAREST filters are required.
202    04/21/2006    0.3    Added TexSubImage2D and TexSubImage3D as
203                         functions that take the new tokens.
204    06/14/2006    0.4    CopyTexImage2D, CopyTexSubImag{2D|3D} are
205                         not supported.
206    07/26/2011    0.5    Fix several omissions discovered while writing
207                         EXT_color_buffer_half_float.
208    11/09/2011    0.6    Fix missing FLOAT entries in Table 3.4,
209                         add interaction with OES_texture_3D.
210