15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OES_vertex_half_float
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OES_vertex_half_float
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Aaftab Munshi (amunshi@ati.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at
165bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciSpecification Update Policy
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
215bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
225bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
235bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
245bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
255bd8deadSopenharmony_ci    described in more detail at
265bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciIP Status
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    None.
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciStatus
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Ratified by the Khronos BOP, July 22, 2005.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciVersion
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    April 22, 2007 (version #3)
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciNumber
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    OpenGL ES Extension #38
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ciDependencies
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    This extension is written against the OpenGL 2.0 specification
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciOverview
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    This extension adds a 16-bit floating pt data type (aka half float) 
515bd8deadSopenharmony_ci    to vertex data specified using vertex arrays.  The 16-bit floating-point
525bd8deadSopenharmony_ci    components have 1 sign bit, 5 exponent bits, and 10 mantissa bits.
535bd8deadSopenharmony_ci    
545bd8deadSopenharmony_ci    The half float data type can be very useful in specifying vertex attribute 
555bd8deadSopenharmony_ci    data such as color, normals, texture coordinates etc.  By using half floats 
565bd8deadSopenharmony_ci    instead of floats, we reduce the memory requirements by half.  Not only does 
575bd8deadSopenharmony_ci    the memory footprint reduce by half, but the memory bandwidth required for
585bd8deadSopenharmony_ci    vertex transformations also reduces by the same amount approximately.
595bd8deadSopenharmony_ci    Another advantage of using half floats over short/byte data types is that we 
605bd8deadSopenharmony_ci    do not needto scale the data.  For example, using SHORT for texture coordinates 
615bd8deadSopenharmony_ci    implies that we need to scale the input texture coordinates in the shader or 
625bd8deadSopenharmony_ci    set an appropriate scale matrix as the texture matrix for fixed function pipeline.
635bd8deadSopenharmony_ci    Doing these additional scaling operations impacts vertex transformation
645bd8deadSopenharmony_ci    performance.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ciIssues
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    1.  Should there be a half-float version of VertexAttrib{1234}[v] functions
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    RESOLUTION: No.  
715bd8deadSopenharmony_ci    
725bd8deadSopenharmony_ci    There is no reason to support this, as these functions are not
735bd8deadSopenharmony_ci    performance or memory footprint critical.  It is much more important that the
745bd8deadSopenharmony_ci    vertex data specified using vertex arrays be able to support half float data
755bd8deadSopenharmony_ci    format.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciNew Procedures and Functions
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    None
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ciNew Tokens
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Accepted by the <type> parameter of VertexPointer, NormalPointer,
845bd8deadSopenharmony_ci    ColorPointer, SecondaryColorPointer, IndexPointer, FogCoordPointer, 
855bd8deadSopenharmony_ci    TexCoordPointer, and VertexAttribPointer
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci        HALF_FLOAT_OES      0x8D61
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Add a new section 2.1.2.  This new section is copied from the 
925bd8deadSopenharmony_ci    ARB_texture_float extension.
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    2.1.2  16-Bit Floating-Point Numbers
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    A 16-bit floating-point number has a 1-bit sign (S), a 5-bit
975bd8deadSopenharmony_ci    exponent (E), and a 10-bit mantissa (M).  The value of a 16-bit
985bd8deadSopenharmony_ci    floating-point number is determined by the following:
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci        (-1)^S * 0.0,                        if E == 0 and M == 0,
1015bd8deadSopenharmony_ci        (-1)^S * 2^-14 * (M / 2^10),         if E == 0 and M != 0,
1025bd8deadSopenharmony_ci        (-1)^S * 2^(E-15) * (1 + M/2^10),    if 0 < E < 31,
1035bd8deadSopenharmony_ci        (-1)^S * INF,                        if E == 31 and M == 0, or
1045bd8deadSopenharmony_ci        NaN,                                 if E == 31 and M != 0,
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    where
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci        S = floor((N mod 65536) / 32768),
1095bd8deadSopenharmony_ci        E = floor((N mod 32768) / 1024), and
1105bd8deadSopenharmony_ci        M = N mod 1024.
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    Implementations are also allowed to use any of the following
1135bd8deadSopenharmony_ci    alternative encodings:
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci        (-1)^S * 0.0,                        if E == 0 and M != 0,
1165bd8deadSopenharmony_ci        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M == 0, or
1175bd8deadSopenharmony_ci        (-1)^S * 2^(E-15) * (1 + M/2^10),    if E == 31 and M != 0,
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Any representable 16-bit floating-point value is legal as input
1205bd8deadSopenharmony_ci    to a GL command that accepts 16-bit floating-point data.  The
1215bd8deadSopenharmony_ci    result of providing a value that is not a floating-point number
1225bd8deadSopenharmony_ci    (such as infinity or NaN) to such a command is unspecified, but
1235bd8deadSopenharmony_ci    must not lead to GL interruption or termination.  Providing a
1245bd8deadSopenharmony_ci    denormalized number or negative zero to GL must yield predictable
1255bd8deadSopenharmony_ci    results.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    Modifications to section 2.8 (Vertex Arrays)
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Add HALF_FLOAT_OES as a valid <type> value in Table 2.4.
1305bd8deadSopenharmony_ci        
1315bd8deadSopenharmony_ci    For <type> the values BYTE, SHORT, INT, FLOAT, and DOUBLE indicate
1325bd8deadSopenharmony_ci    types byte, short, int, float, and double, respectively; and the values
1335bd8deadSopenharmony_ci    UNSIGNED_BYTE, UNSIGNED_SHORT, and UNSIGNED_INT indicate types ubyte,
1345bd8deadSopenharmony_ci    ushort, and uint, respectively.  A <type> value of HALF_FLOAT_OES represents
1355bd8deadSopenharmony_ci    a 16-bit floating point number with 1 sign bits, 5 exponent bits,
1365bd8deadSopenharmony_ci    and 10 mantissa bits.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ciErrors
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    None
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ciNew State
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    None
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ciRevision History
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    June 15, 2005    Aaftab Munshi    First draft of extension.
1505bd8deadSopenharmony_ci    June 22, 2005    Aaftab Munshi    Renamed HALF_FLOAT token to HALF_FLOAT_OES
1515bd8deadSopenharmony_ci    #3, 2007/04/22   Jon Leech        Add version date and extension number.
152