• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    OES_vertex_half_float
4
5Name Strings
6
7    GL_OES_vertex_half_float
8
9Contact
10
11    Aaftab Munshi (amunshi@ati.com)
12
13Notice
14
15    Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at
16        http://www.khronos.org/registry/speccopyright.html
17
18Specification Update Policy
19
20    Khronos-approved extension specifications are updated in response to
21    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
22    extensions which have been promoted to a core Specification, fixes will
23    first appear in the latest version of that core Specification, and will
24    eventually be backported to the extension document. This policy is
25    described in more detail at
26        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
27
28IP Status
29
30    None.
31
32Status
33
34    Ratified by the Khronos BOP, July 22, 2005.
35
36Version
37
38    April 22, 2007 (version #3)
39
40Number
41
42    OpenGL ES Extension #38
43
44Dependencies
45
46    This extension is written against the OpenGL 2.0 specification
47
48Overview
49
50    This extension adds a 16-bit floating pt data type (aka half float)
51    to vertex data specified using vertex arrays.  The 16-bit floating-point
52    components have 1 sign bit, 5 exponent bits, and 10 mantissa bits.
53
54    The half float data type can be very useful in specifying vertex attribute
55    data such as color, normals, texture coordinates etc.  By using half floats
56    instead of floats, we reduce the memory requirements by half.  Not only does
57    the memory footprint reduce by half, but the memory bandwidth required for
58    vertex transformations also reduces by the same amount approximately.
59    Another advantage of using half floats over short/byte data types is that we
60    do not needto scale the data.  For example, using SHORT for texture coordinates
61    implies that we need to scale the input texture coordinates in the shader or
62    set an appropriate scale matrix as the texture matrix for fixed function pipeline.
63    Doing these additional scaling operations impacts vertex transformation
64    performance.
65
66Issues
67
68    1.  Should there be a half-float version of VertexAttrib{1234}[v] functions
69
70    RESOLUTION: No.
71
72    There is no reason to support this, as these functions are not
73    performance or memory footprint critical.  It is much more important that the
74    vertex data specified using vertex arrays be able to support half float data
75    format.
76
77New Procedures and Functions
78
79    None
80
81New Tokens
82
83    Accepted by the <type> parameter of VertexPointer, NormalPointer,
84    ColorPointer, SecondaryColorPointer, IndexPointer, FogCoordPointer,
85    TexCoordPointer, and VertexAttribPointer
86
87        HALF_FLOAT_OES      0x8D61
88
89Additions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
90
91    Add a new section 2.1.2.  This new section is copied from the
92    ARB_texture_float extension.
93
94    2.1.2  16-Bit Floating-Point Numbers
95
96    A 16-bit floating-point number has a 1-bit sign (S), a 5-bit
97    exponent (E), and a 10-bit mantissa (M).  The value of a 16-bit
98    floating-point number is determined by the following:
99
100        (-1)^S * 0.0,                        if E == 0 and M == 0,
101        (-1)^S * 2^-14 * (M / 2^10),         if E == 0 and M != 0,
102        (-1)^S * 2^(E-15) * (1 + M/2^10),    if 0 < E < 31,
103        (-1)^S * INF,                        if E == 31 and M == 0, or
104        NaN,                                 if E == 31 and M != 0,
105
106    where
107
108        S = floor((N mod 65536) / 32768),
109        E = floor((N mod 32768) / 1024), and
110        M = N mod 1024.
111
112    Implementations are also allowed to use any of the following
113    alternative encodings:
114
115        (-1)^S * 0.0,                        if E == 0 and M != 0,
116        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M == 0, or
117        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M != 0,
118
119    Any representable 16-bit floating-point value is legal as input
120    to a GL command that accepts 16-bit floating-point data.  The
121    result of providing a value that is not a floating-point number
122    (such as infinity or NaN) to such a command is unspecified, but
123    must not lead to GL interruption or termination.  Providing a
124    denormalized number or negative zero to GL must yield predictable
125    results.
126
127    Modifications to section 2.8 (Vertex Arrays)
128
129    Add HALF_FLOAT_OES as a valid <type> value in Table 2.4.
130
131    For <type> the values BYTE, SHORT, INT, FLOAT, and DOUBLE indicate
132    types byte, short, int, float, and double, respectively; and the values
133    UNSIGNED_BYTE, UNSIGNED_SHORT, and UNSIGNED_INT indicate types ubyte,
134    ushort, and uint, respectively.  A <type> value of HALF_FLOAT_OES represents
135    a 16-bit floating point number with 1 sign bits, 5 exponent bits,
136    and 10 mantissa bits.
137
138
139Errors
140
141    None
142
143New State
144
145    None
146
147Revision History
148
149    June 15, 2005    Aaftab Munshi    First draft of extension.
150    June 22, 2005    Aaftab Munshi    Renamed HALF_FLOAT token to HALF_FLOAT_OES
151    #3, 2007/04/22   Jon Leech        Add version date and extension number.
152