15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci OES_texture_half_float 45bd8deadSopenharmony_ci OES_texture_float 55bd8deadSopenharmony_ci 65bd8deadSopenharmony_ciName Strings 75bd8deadSopenharmony_ci 85bd8deadSopenharmony_ci GL_OES_texture_half_float, GL_OES_texture_float 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciContact 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci Benj Lipchak, Apple (lipchak 'at' apple.com) 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciNotice 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at 175bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciSpecification Update Policy 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 225bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 235bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 245bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 255bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 265bd8deadSopenharmony_ci described in more detail at 275bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciIP Status 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci Please refer to the ARB_texture_float extension. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciStatus 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Ratified by the Khronos BOP, July 22, 2005. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciVersion 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci Last Modified Date: November 9, 2011 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciNumber 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci OpenGL ES Extension #36 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciDependencies 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci This extension is written against the OpenGL ES 2.0 Specification. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci OES_texture_3D affects the definition of this extension. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ciOverview 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci These extensions add texture formats with 16- (aka half float) and 32-bit 545bd8deadSopenharmony_ci floating-point components. The 32-bit floating-point components 555bd8deadSopenharmony_ci are in the standard IEEE float format. The 16-bit floating-point 565bd8deadSopenharmony_ci components have 1 sign bit, 5 exponent bits, and 10 mantissa bits. 575bd8deadSopenharmony_ci Floating-point components are clamped to the limits of the range 585bd8deadSopenharmony_ci representable by their format. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci The OES_texture_half_float extension string indicates that the 615bd8deadSopenharmony_ci implementation supports 16-bit floating pt texture formats. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci The OES_texture_float extension string indicates that the 645bd8deadSopenharmony_ci implementation supports 32-bit floating pt texture formats. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci Both these extensions only require NEAREST magnification filter and 675bd8deadSopenharmony_ci NEAREST, and NEAREST_MIPMAP_NEAREST minification filters to be supported. 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ciIssues 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci 1. What should we do if magnification filter for a texture with half-float 725bd8deadSopenharmony_ci or float channels is set to LINEAR. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci RESOLUTION: The texture will be marked as incomplete. 755bd8deadSopenharmony_ci Only the NEAREST filter is supported. 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci The cost of doing a LINEAR filter for these texture formats can be 785bd8deadSopenharmony_ci quite prohibitive. There was a discussion on having the shader 795bd8deadSopenharmony_ci generate code to do LINEAR filter by making individual texture calls with a 805bd8deadSopenharmony_ci NEAREST filter but again the computational and memory b/w costs decided 815bd8deadSopenharmony_ci against mandating this approach. The decision was that this extension 825bd8deadSopenharmony_ci would only enable NEAREST magnification filter. Support for LINEAR 835bd8deadSopenharmony_ci magnification filter would be done through a separate extension. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci 2. What should we do if minification filter is set to LINEAR or 865bd8deadSopenharmony_ci LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR and LINEAR_MIPMAP_LINEAR. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci RESOLUTION: The texture will be marked as incomplete. Only the NEAREST 895bd8deadSopenharmony_ci and NEAREST_MIPMAP_NEAREST minification filters are supported. 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci This was decided for the same reasons given in issue #1. The decision 925bd8deadSopenharmony_ci was that this extension would only enable NEAREST and NEAREST_MIPMAP_NEAREST 935bd8deadSopenharmony_ci minification filters, and the remaining OpenGL ES minification filters 945bd8deadSopenharmony_ci would be supported through a separate extension. 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci 3. Should CopyTexImage2D, CopyTexSubImage{2D|3D} be supported for textures 975bd8deadSopenharmony_ci with half-float and float channels? 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci RESOLUTION: No. 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ciNew Procedures and Functions 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci None 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciNew Tokens 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Accepted by the <type> parameter of TexImage2D, TexSubImage2D, 1085bd8deadSopenharmony_ci TexImage3D, and TexSubImage3D 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci HALF_FLOAT_OES 0x8D61 1115bd8deadSopenharmony_ci FLOAT 0x1406 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation) 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci Add a new section called 16-Bit Floating-Point Numbers 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci "A 16-bit floating-point number has a 1-bit sign (S), a 5-bit 1185bd8deadSopenharmony_ci exponent (E), and a 10-bit mantissa (M). The value of a 16-bit 1195bd8deadSopenharmony_ci floating-point number is determined by the following: 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci (-1)^S * 0.0, if E == 0 and M == 0, 1225bd8deadSopenharmony_ci (-1)^S * 2^-14 * (M / 2^10), if E == 0 and M != 0, 1235bd8deadSopenharmony_ci (-1)^S * 2^(E-15) * (1 + M/2^10), if 0 < E < 31, 1245bd8deadSopenharmony_ci (-1)^S * INF, if E == 31 and M == 0, or 1255bd8deadSopenharmony_ci NaN, if E == 31 and M != 0, 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci where 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci S = floor((N mod 65536) / 32768), 1305bd8deadSopenharmony_ci E = floor((N mod 32768) / 1024), and 1315bd8deadSopenharmony_ci M = N mod 1024. 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Implementations are also allowed to use any of the following 1345bd8deadSopenharmony_ci alternative encodings: 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci (-1)^S * 0.0, if E == 0 and M != 0, 1375bd8deadSopenharmony_ci (-1)^S * 2^(E-15) * (1 + M/2^10), if E == 31 and M == 0, or 1385bd8deadSopenharmony_ci (-1)^S * 2^(E-15) * (1 + M/2^10), if E == 31 and M != 0, 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci Any representable 16-bit floating-point value is legal as input 1415bd8deadSopenharmony_ci to a GL command that accepts 16-bit floating-point data. The 1425bd8deadSopenharmony_ci result of providing a value that is not a floating-point number 1435bd8deadSopenharmony_ci (such as infinity or NaN) to such a command is unspecified, but 1445bd8deadSopenharmony_ci must not lead to GL interruption or termination. Providing a 1455bd8deadSopenharmony_ci denormalized number or negative zero to GL must yield predictable 1465bd8deadSopenharmony_ci results." 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci Add to Table 2.2, p. 12: 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci Minimum 1515bd8deadSopenharmony_ci GL Type Bit Width Description 1525bd8deadSopenharmony_ci ------- --------- ----------------------------------- 1535bd8deadSopenharmony_ci half 16 Half-precision floating-point value 1545bd8deadSopenharmony_ci encoded in an unsigned scalar 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci Add to Table 3.2, p. 62: 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci type Parameter Corresponding Special 1615bd8deadSopenharmony_ci Token Name GL Data Type Interpretation 1625bd8deadSopenharmony_ci -------------- ------------- -------------- 1635bd8deadSopenharmony_ci HALF_FLOAT_OES half No 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci Modify first sentence of "Unpacking", p. 62: 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci "Data are taken from client memory as a sequence of one of the GL data 1685bd8deadSopenharmony_ci types listed in Table 3.2. These elements are..." 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Add to Table 3.4, p. 63: 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci Format Type Bytes per Pixel 1735bd8deadSopenharmony_ci --------- -------------- --------------- 1745bd8deadSopenharmony_ci RGBA FLOAT 16 1755bd8deadSopenharmony_ci RGB FLOAT 12 1765bd8deadSopenharmony_ci LUMINANCE_ALPHA FLOAT 8 1775bd8deadSopenharmony_ci LUMINANCE FLOAT 4 1785bd8deadSopenharmony_ci ALPHA FLOAT 4 1795bd8deadSopenharmony_ci RGBA HALF_FLOAT_OES 8 1805bd8deadSopenharmony_ci RGB HALF_FLOAT_OES 6 1815bd8deadSopenharmony_ci LUMINANCE_ALPHA HALF_FLOAT_OES 4 1825bd8deadSopenharmony_ci LUMINANCE HALF_FLOAT_OES 2 1835bd8deadSopenharmony_ci ALPHA HALF_FLOAT_OES 2 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci Modify fifth paragraph of 3.7.1 Texture Image Specification, p. 67: 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci "The selected groups are processed as described in section 3.6.2, stopping 1885bd8deadSopenharmony_ci after final expansion to RGBA. If the internal format of the texture is 1895bd8deadSopenharmony_ci fixed-point, components are clamped to [0,1]. Otherwise, values are not 1905bd8deadSopenharmony_ci modified." 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ciInteractions with OES_texture_3D 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci If OES_texture_3D is not supported, ignore references to TexImage3D and 1955bd8deadSopenharmony_ci TexSubImage3D. 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ciRevision History 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci 04/29/2005 0.1 Original draft. 2005bd8deadSopenharmony_ci 06/29/2005 0.2 Added issues on why only NEAREST and 2015bd8deadSopenharmony_ci NEAREST_MIPMAP_NEAREST filters are required. 2025bd8deadSopenharmony_ci 04/21/2006 0.3 Added TexSubImage2D and TexSubImage3D as 2035bd8deadSopenharmony_ci functions that take the new tokens. 2045bd8deadSopenharmony_ci 06/14/2006 0.4 CopyTexImage2D, CopyTexSubImag{2D|3D} are 2055bd8deadSopenharmony_ci not supported. 2065bd8deadSopenharmony_ci 07/26/2011 0.5 Fix several omissions discovered while writing 2075bd8deadSopenharmony_ci EXT_color_buffer_half_float. 2085bd8deadSopenharmony_ci 11/09/2011 0.6 Fix missing FLOAT entries in Table 3.4, 2095bd8deadSopenharmony_ci add interaction with OES_texture_3D. 210