15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_texture_compression_rgtc 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_texture_compression_rgtc 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Mark J. Kilgard, NVIDIA 125bd8deadSopenharmony_ci Pat Brown, NVIDIA 135bd8deadSopenharmony_ci Yanjun Zhang, S3 145bd8deadSopenharmony_ci Attila Barsi, Holografika 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ciContact 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ci Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com) 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ciNotice 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci Copyright (c) 2008-2013 The Khronos Group Inc. Copyright terms at 235bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciSpecification Update Policy 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 285bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 295bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 305bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 315bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 325bd8deadSopenharmony_ci described in more detail at 335bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciStatus 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci Approved by the ARB on July 11, 2008 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciVersion 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Last Modified Date: January 27, 2015 425bd8deadSopenharmony_ci Revision: 1.7 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciNumber 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci ARB Extension #52 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciDependencies 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci OpenGL 1.3 or ARB_texture_compression required 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci This extension is written against the OpenGL 2.0 (September 7, 535bd8deadSopenharmony_ci 2004) specification. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci This extension interacts with OpenGL 2.0 and ARB_texture_non_power_of_two. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ciOverview 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci This extension introduces four new block-based texture compression 605bd8deadSopenharmony_ci formats suited for unsigned and signed red and red-green textures 615bd8deadSopenharmony_ci (hence the name "rgtc" for Red-Green Texture Compression). 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci These formats are designed to reduce the storage requirements 645bd8deadSopenharmony_ci and memory bandwidth required for red and red-green textures by 655bd8deadSopenharmony_ci a factor of 2-to-1 over conventional uncompressed luminance and 665bd8deadSopenharmony_ci luminance-alpha textures with 8-bit components (GL_LUMINANCE8 and 675bd8deadSopenharmony_ci GL_LUMINANCE8_ALPHA8). 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci The compressed signed red-green format is reasonably suited for 705bd8deadSopenharmony_ci storing compressed normal maps. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci This extension uses the same compression format as the 735bd8deadSopenharmony_ci EXT_texture_compression_latc extension except the color data is stored 745bd8deadSopenharmony_ci in the red and green components rather than luminance and alpha. 755bd8deadSopenharmony_ci Representing compressed red and green components is consistent with 765bd8deadSopenharmony_ci the BC4 and BC5 compressed formats supported by DirectX 10. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ciNew Procedures and Functions 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci None. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ciNew Tokens 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of TexImage2D, 855bd8deadSopenharmony_ci CopyTexImage2D, and CompressedTexImage2D and the <format> parameter 865bd8deadSopenharmony_ci of CompressedTexSubImage2D: 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1 0x8DBB 895bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1 0x8DBC 905bd8deadSopenharmony_ci COMPRESSED_RG_RGTC2 0x8DBD 915bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2 0x8DBE 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation) 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci None. 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci -- Section 3.8.1, Texture Image Specification 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci Add to Table 3.17 (page 155): Specific compressed internal formats 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Compressed Internal Format Base Internal Format 1045bd8deadSopenharmony_ci --------------------------------- -------------------- 1055bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1 RED 1065bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1 RED 1075bd8deadSopenharmony_ci COMPRESSED_RG_RGTC2 RG 1085bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2 RG 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci -- Section 3.8.2, Alternative Texture Image Specification Commands 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Add to the end of the section (page 163): 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci "If the internal format of the texture image 1155bd8deadSopenharmony_ci being modified is COMPRESSED_RED_RGTC1, 1165bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, 1175bd8deadSopenharmony_ci or COMPRESSED_SIGNED_RG_RGTC2, the texture is stored 1185bd8deadSopenharmony_ci using one of the two RGTC compressed texture image encodings (see 1195bd8deadSopenharmony_ci appendix). Such images are easily edited along 4x4 texel boundaries, 1205bd8deadSopenharmony_ci so the limitations on TexSubImage2D or CopyTexSubImage2D parameters 1215bd8deadSopenharmony_ci are relaxed. TexSubImage2D and CopyTexSubImage2D will result in 1225bd8deadSopenharmony_ci an INVALID_OPERATION error only if one of the following conditions 1235bd8deadSopenharmony_ci occurs: 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci * <width> is not a multiple of four, <width> plus <xoffset> is not 1265bd8deadSopenharmony_ci equal to TEXTURE_WIDTH, and either <xoffset> or <yoffset> is 1275bd8deadSopenharmony_ci non-zero; 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci * <height> is not a multiple of four, <height> plus <yoffset> is not 1305bd8deadSopenharmony_ci equal to TEXTURE_HEIGHT, and either <xoffset> or <yoffset> is 1315bd8deadSopenharmony_ci non-zero; or 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci The contents of any 4x4 block of texels of an RGTC compressed texture 1365bd8deadSopenharmony_ci image that does not intersect the area being modified are preserved 1375bd8deadSopenharmony_ci during valid TexSubImage2D and CopyTexSubImage2D calls." 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci -- Section 3.8.3, Compressed Texture Images 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci Add after the 4th paragraph (page 164) at the end of the 1425bd8deadSopenharmony_ci CompressedTexImage discussion: 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci "If <internalformat> is COMPRESSED_RED_RGTC1, 1455bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, 1465bd8deadSopenharmony_ci or COMPRESSED_SIGNED_RG_RGTC2, the compressed texture is 1475bd8deadSopenharmony_ci stored using one of several RGTC compressed texture image formats. 1485bd8deadSopenharmony_ci The RGTC texture compression algorithm supports only 2D images 1495bd8deadSopenharmony_ci without borders. CompressedTexImage1D and CompressedTexImage3D 1505bd8deadSopenharmony_ci produce an INVALID_ENUM error if <internalformat> is an RGTC format. 1515bd8deadSopenharmony_ci CompressedTexImage2D will produce an INVALID_OPERATION error if 1525bd8deadSopenharmony_ci <border> is non-zero. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci Add to the end of the section (page 166) at the end of the 1555bd8deadSopenharmony_ci CompressedTexSubImage discussion: 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci "If the internal format of the texture image 1585bd8deadSopenharmony_ci being modified is COMPRESSED_RED_RGTC1, 1595bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, 1605bd8deadSopenharmony_ci or COMPRESSED_SIGNED_RG_RGTC2, the texture is stored 1615bd8deadSopenharmony_ci using one of the several RGTC compressed texture image formats. 1625bd8deadSopenharmony_ci Since the RGTC texture compression algorithm supports only 2D images, 1635bd8deadSopenharmony_ci CompressedTexSubImage1D and CompressedTexSubImage3D produce an 1645bd8deadSopenharmony_ci INVALID_ENUM error if <format> is an RGTC format. Since RGTC images 1655bd8deadSopenharmony_ci are easily edited along 4x4 texel boundaries, the limitations on 1665bd8deadSopenharmony_ci CompressedTexSubImage2D are relaxed. CompressedTexSubImage2D will 1675bd8deadSopenharmony_ci result in an INVALID_OPERATION error only if one of the following 1685bd8deadSopenharmony_ci conditions occurs: 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci * <width> is not a multiple of four, and <width> plus <xoffset> is not 1715bd8deadSopenharmony_ci equal to TEXTURE_WIDTH; 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci * <height> is not a multiple of four, and <height> plus <yoffset> is 1745bd8deadSopenharmony_ci not equal to TEXTURE_HEIGHT; or 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci The contents of any 4x4 block of texels of an RGTC compressed texture 1795bd8deadSopenharmony_ci image that does not intersect the area being modified are preserved 1805bd8deadSopenharmony_ci during valid TexSubImage2D and CopyTexSubImage2D calls." 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci -- Section 3.8.8, Texture Minification 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci Add a sentence to the last paragraph (page 174) just prior to the 1855bd8deadSopenharmony_ci "Mipmapping" subheading: 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci "If the texture's internal format lacks components that exist in 1885bd8deadSopenharmony_ci the texture's base internal format, such components are considered 1895bd8deadSopenharmony_ci zero when the texture border color is sampled. (So despite the 1905bd8deadSopenharmony_ci RGB base internal format of the COMPRESSED_RED_RGTC1 and 1915bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1 formats, the green and blue 1925bd8deadSopenharmony_ci components of the texture border color are always considered 1935bd8deadSopenharmony_ci zero. Likewise for the COMPRESSED_RG_RGTC2, and 1945bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2 formats, the blue component 1955bd8deadSopenharmony_ci is always considered zero.)" 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment 1985bd8deadSopenharmony_ciOperations and the Frame Buffer) 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci None. 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci None. 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and 2075bd8deadSopenharmony_ciState Requests) 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci None. 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance) 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci None. 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci None. 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ciGLX Protocol 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci None. 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ciDependencies on ARB_texture_compression 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci If ARB_texture_compression is supported, all the 2265bd8deadSopenharmony_ci errors and accepted tokens for CompressedTexImage1D, 2275bd8deadSopenharmony_ci CompressedTexImage2D, CompressedTexImage3D, CompressedTexSubImage1D, 2285bd8deadSopenharmony_ci CompressedTexSubImage2D, and CompressedTexSubImage3D also apply 2295bd8deadSopenharmony_ci respectively to the ARB-suffixed CompressedTexImage1DARB, 2305bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB, 2315bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage2DARB, and 2325bd8deadSopenharmony_ci CompressedTexSubImage3DARB. 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ciDependencies on OpenGL 2.0 or ARB_texture_non_power_of_two 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci If OpenGL 2.0 or ARB_texture_non_power_of_two is supported, compressed 2375bd8deadSopenharmony_ci texture images can have sizes that are neither multiples of four nor small 2385bd8deadSopenharmony_ci values like one or two. The original version of this specification didn't 2395bd8deadSopenharmony_ci allow TexSubImage2D and CompressedTexSubImage2D to update only a portion 2405bd8deadSopenharmony_ci of such images. The spec has been updated to allow such edits in the 2415bd8deadSopenharmony_ci spirit of the resolution of issue (3) of the EXT_texture_compression_s3tc 2425bd8deadSopenharmony_ci specification. See the "Implementation Note" section for more details. 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ciErrors 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage1D 2475bd8deadSopenharmony_ci or CompressedTexImage3D if <internalformat> is 2485bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1, COMPRESSED_SIGNED_RED_RGTC1, 2495bd8deadSopenharmony_ci COMPRESSED_RG_RGTC2, or 2505bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexImage2D 2535bd8deadSopenharmony_ci if <internalformat> is COMPRESSED_RED_RGTC1, 2545bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, 2555bd8deadSopenharmony_ci or COMPRESSED_SIGNED_RG_RGTC2 and <border> is not equal 2565bd8deadSopenharmony_ci to zero. 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexSubImage1D 2595bd8deadSopenharmony_ci or CompressedTexSubImage3D if 2605bd8deadSopenharmony_ci <format> is COMPRESSED_RED_RGTC1, 2615bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, 2625bd8deadSopenharmony_ci or COMPRESSED_SIGNED_RG_RGTC2. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci INVALID_OPERATION is generated by TexSubImage2D or CopyTexSubImage2D if 2655bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT is COMPRESSED_RED_RGTC1, 2665bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, or 2675bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2 and any of the following apply: 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci * <width> is not a multiple of four, <width> plus <xoffset> is not 2705bd8deadSopenharmony_ci equal to TEXTURE_WIDTH, and either <xoffset> or <yoffset> is 2715bd8deadSopenharmony_ci non-zero; 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci * <height> is not a multiple of four, <height> plus <yoffset> is not 2745bd8deadSopenharmony_ci equal to TEXTURE_HEIGHT, and either <xoffset> or <yoffset> is 2755bd8deadSopenharmony_ci non-zero; or 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage2D if 2805bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT is COMPRESSED_RED_RGTC1, 2815bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1, COMPRESSED_RG_RGTC2, or 2825bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2 and any of the following apply: 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci * <width> is not a multiple of four, and <width> plus <xoffset> is not 2855bd8deadSopenharmony_ci equal to TEXTURE_WIDTH; 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci * <height> is not a multiple of four, and <height> plus <yoffset> is 2885bd8deadSopenharmony_ci not equal to TEXTURE_HEIGHT; or 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci The following restrictions from the ARB_texture_compression 2935bd8deadSopenharmony_ci specification do not apply to RGTC texture formats, since subimage 2945bd8deadSopenharmony_ci modification is straightforward as long as the subimage is properly 2955bd8deadSopenharmony_ci aligned. 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci DELETE: INVALID_OPERATION is generated by TexSubImage1D, TexSubImage2D, 2985bd8deadSopenharmony_ci DELETE: TexSubImage3D, CopyTexSubImage1D, CopyTexSubImage2D, or 2995bd8deadSopenharmony_ci DELETE: CopyTexSubImage3D if the internal format of the texture image is 3005bd8deadSopenharmony_ci DELETE: compressed and <xoffset>, <yoffset>, or <zoffset> does not equal 3015bd8deadSopenharmony_ci DELETE: -b, where b is value of TEXTURE_BORDER. 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci DELETE: INVALID_VALUE is generated by CompressedTexSubImage1D, 3045bd8deadSopenharmony_ci DELETE: CompressedTexSubImage2D, or CompressedTexSubImage3D if the 3055bd8deadSopenharmony_ci DELETE: entire texture image is not being edited: if <xoffset>, 3065bd8deadSopenharmony_ci DELETE: <yoffset>, or <zoffset> is greater than -b, <xoffset> + <width> is 3075bd8deadSopenharmony_ci DELETE: less than w+b, <yoffset> + <height> is less than h+b, or <zoffset> 3085bd8deadSopenharmony_ci DELETE: + <depth> is less than d+b, where b is the value of 3095bd8deadSopenharmony_ci DELETE: TEXTURE_BORDER, w is the value of TEXTURE_WIDTH, h is the value of 3105bd8deadSopenharmony_ci DELETE: TEXTURE_HEIGHT, and d is the value of TEXTURE_DEPTH. 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ci See also errors in the GL_ARB_texture_compression specification. 3135bd8deadSopenharmony_ci 3145bd8deadSopenharmony_ciNew State 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci 4 new state values are added for the per-texture object 3175bd8deadSopenharmony_ci GL_TEXTURE_INTERNAL_FORMAT state. 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci In the "Textures" state table( page 278), increment the 3205bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT subscript for Z by 4 in the "Type" row. 3215bd8deadSopenharmony_ci 3225bd8deadSopenharmony_ci [NOTE: The OpenGL 2.0 specification actually should read "n x Z48*" 3235bd8deadSopenharmony_ci because of the 6 generic compressed internal formats in table 3.18.] 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ciNew Implementation Dependent State 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci None 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ciAppendix 3305bd8deadSopenharmony_ci 3315bd8deadSopenharmony_ci RGTC Compressed Texture Image Formats 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci Compressed texture images stored using the RGTC compressed image 3345bd8deadSopenharmony_ci encodings are represented as a collection of 4x4 texel blocks, 3355bd8deadSopenharmony_ci where each block contains 64 or 128 bits of texel data. The image 3365bd8deadSopenharmony_ci is encoded as a normal 2D raster image in which each 4x4 block is 3375bd8deadSopenharmony_ci treated as a single pixel. If an RGTC image has a width or height 3385bd8deadSopenharmony_ci that is not a multiple of four, the data corresponding to texels 3395bd8deadSopenharmony_ci outside the image are irrelevant and undefined. 3405bd8deadSopenharmony_ci 3415bd8deadSopenharmony_ci When an RGTC image with a width of <w>, height of <h>, and block 3425bd8deadSopenharmony_ci size of <blocksize> (8 or 16 bytes) is decoded, the corresponding 3435bd8deadSopenharmony_ci image size (in bytes) is: 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci ceil(<w>/4) * ceil(<h>/4) * blocksize. 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci When decoding an RGTC image, the block containing the texel at offset 3485bd8deadSopenharmony_ci (<x>, <y>) begins at an offset (in bytes) relative to the base of the 3495bd8deadSopenharmony_ci image of: 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci blocksize * (ceil(<w>/4) * floor(<y>/4) + floor(<x>/4)). 3525bd8deadSopenharmony_ci 3535bd8deadSopenharmony_ci The data corresponding to a specific texel (<x>, <y>) are extracted 3545bd8deadSopenharmony_ci from a 4x4 texel block using a relative (x,y) value of 3555bd8deadSopenharmony_ci 3565bd8deadSopenharmony_ci (<x> modulo 4, <y> modulo 4). 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci There are four distinct RGTC image formats: 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1: Each 4x4 block of texels consists of 3625bd8deadSopenharmony_ci 64 bits of unsigned red image data. 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci Each red image data block is encoded as a sequence of 8 bytes, called 3655bd8deadSopenharmony_ci (in order of increasing address): 3665bd8deadSopenharmony_ci 3675bd8deadSopenharmony_ci red0, red1, bits_0, bits_1, bits_2, bits_3, bits_4, bits_5 3685bd8deadSopenharmony_ci 3695bd8deadSopenharmony_ci The 6 "bits_*" bytes of the block are decoded into a 48-bit bit 3705bd8deadSopenharmony_ci vector: 3715bd8deadSopenharmony_ci 3725bd8deadSopenharmony_ci bits = bits_0 + 3735bd8deadSopenharmony_ci 256 * (bits_1 + 3745bd8deadSopenharmony_ci 256 * (bits_2 + 3755bd8deadSopenharmony_ci 256 * (bits_3 + 3765bd8deadSopenharmony_ci 256 * (bits_4 + 3775bd8deadSopenharmony_ci 256 * bits_5)))) 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci red0 and red1 are 8-bit unsigned integers that are unpacked to red 3805bd8deadSopenharmony_ci values RED0 and RED1 as though they were pixels with a <format> 3815bd8deadSopenharmony_ci of LUMINANCE and a type of UNSIGNED_BTYE. 3825bd8deadSopenharmony_ci 3835bd8deadSopenharmony_ci bits is a 48-bit unsigned integer, from which a three-bit control 3845bd8deadSopenharmony_ci code is extracted for a texel at location (x,y) in the block 3855bd8deadSopenharmony_ci using: 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci code(x,y) = bits[3*(4*y+x)+2..3*(4*y+x)+0] 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci where bit 47 is the most significant and bit 0 is the least 3905bd8deadSopenharmony_ci significant bit. 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ci The red value R for a texel at location (x,y) in the block is 3935bd8deadSopenharmony_ci given by: 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci RED0, if red0 > red1 and code(x,y) == 0 3965bd8deadSopenharmony_ci RED1, if red0 > red1 and code(x,y) == 1 3975bd8deadSopenharmony_ci (6*RED0+ RED1)/7, if red0 > red1 and code(x,y) == 2 3985bd8deadSopenharmony_ci (5*RED0+2*RED1)/7, if red0 > red1 and code(x,y) == 3 3995bd8deadSopenharmony_ci (4*RED0+3*RED1)/7, if red0 > red1 and code(x,y) == 4 4005bd8deadSopenharmony_ci (3*RED0+4*RED1)/7, if red0 > red1 and code(x,y) == 5 4015bd8deadSopenharmony_ci (2*RED0+5*RED1)/7, if red0 > red1 and code(x,y) == 6 4025bd8deadSopenharmony_ci ( RED0+6*RED1)/7, if red0 > red1 and code(x,y) == 7 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci RED0, if red0 <= red1 and code(x,y) == 0 4055bd8deadSopenharmony_ci RED1, if red0 <= red1 and code(x,y) == 1 4065bd8deadSopenharmony_ci (4*RED0+ RED1)/5, if red0 <= red1 and code(x,y) == 2 4075bd8deadSopenharmony_ci (3*RED0+2*RED1)/5, if red0 <= red1 and code(x,y) == 3 4085bd8deadSopenharmony_ci (2*RED0+3*RED1)/5, if red0 <= red1 and code(x,y) == 4 4095bd8deadSopenharmony_ci ( RED0+4*RED1)/5, if red0 <= red1 and code(x,y) == 5 4105bd8deadSopenharmony_ci MINRED, if red0 <= red1 and code(x,y) == 6 4115bd8deadSopenharmony_ci MAXRED, if red0 <= red1 and code(x,y) == 7 4125bd8deadSopenharmony_ci 4135bd8deadSopenharmony_ci MINRED and MAXRED are 0.0 and 1.0 respectively. 4145bd8deadSopenharmony_ci 4155bd8deadSopenharmony_ci Since the decoded texel has a red format, the resulting RGBA value 4165bd8deadSopenharmony_ci for the texel is (R,0,0,1). 4175bd8deadSopenharmony_ci 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1: Each 4x4 block of texels consists of 4205bd8deadSopenharmony_ci 64 bits of signed red image data. The red values of a texel are 4215bd8deadSopenharmony_ci extracted in the same way as COMPRESSED_RED_RGTC1 except red0, red1, 4225bd8deadSopenharmony_ci RED0, RED1, MINRED, and MAXRED are signed values defined as follows: 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ci red0 and red1 are 8-bit signed (two's complement) integers. 4255bd8deadSopenharmony_ci 4265bd8deadSopenharmony_ci { red0 / 127.0, red0 > -128 4275bd8deadSopenharmony_ci RED0 = { 4285bd8deadSopenharmony_ci { -1.0, red0 == -128 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci { red1 / 127.0, red1 > -128 4315bd8deadSopenharmony_ci RED1 = { 4325bd8deadSopenharmony_ci { -1.0, red1 == -128 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci MINRED = -1.0 4355bd8deadSopenharmony_ci 4365bd8deadSopenharmony_ci MAXRED = 1.0 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci CAVEAT for signed red0 and red1 values: the expressions "red0 > 4395bd8deadSopenharmony_ci red1" and "red0 <= red1" above are considered undefined (read: may 4405bd8deadSopenharmony_ci vary by implementation) when red0 equals -127 and red1 equals -128, 4415bd8deadSopenharmony_ci This is because if red0 were remapped to -127 prior to the comparison 4425bd8deadSopenharmony_ci to reduce the latency of a hardware decompressor, the expressions 4435bd8deadSopenharmony_ci would reverse their logic. Encoders for the signed LA formats should 4445bd8deadSopenharmony_ci avoid encoding blocks where red0 equals -127 and red1 equals -128. 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ci COMPRESSED_RG_RGTC2: Each 4x4 block of texels consists of 4485bd8deadSopenharmony_ci 64 bits of compressed unsigned red image data followed by 64 bits 4495bd8deadSopenharmony_ci of compressed unsigned green image data. 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ci The first 64 bits of compressed red are decoded exactly like 4525bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1 above. 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci The second 64 bits of compressed green are decoded exactly like 4555bd8deadSopenharmony_ci COMPRESSED_RED_RGTC1 above except the decoded value R for this 4565bd8deadSopenharmony_ci second block is considered the resulting green value G. 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci Since the decoded texel has a red-green format, the resulting RGBA 4595bd8deadSopenharmony_ci value for the texel is (R,G,0,1). 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci 4625bd8deadSopenharmony_ci COMPRESSED_SIGNED_RG_RGTC2: Each 4x4 block of texels consists 4635bd8deadSopenharmony_ci of 64 bits of compressed signed red image data followed by 64 bits 4645bd8deadSopenharmony_ci of compressed signed green image data. 4655bd8deadSopenharmony_ci 4665bd8deadSopenharmony_ci The first 64 bits of compressed red are decoded exactly like 4675bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1 above. 4685bd8deadSopenharmony_ci 4695bd8deadSopenharmony_ci The second 64 bits of compressed green are decoded exactly like 4705bd8deadSopenharmony_ci COMPRESSED_SIGNED_RED_RGTC1 above except the decoded value R 4715bd8deadSopenharmony_ci for this second block is considered the resulting green value G. 4725bd8deadSopenharmony_ci 4735bd8deadSopenharmony_ci Since this image has a red-green format, the resulting RGBA value is 4745bd8deadSopenharmony_ci (R,G,0,1). 4755bd8deadSopenharmony_ci 4765bd8deadSopenharmony_ciIssues 4775bd8deadSopenharmony_ci 4785bd8deadSopenharmony_ci 1) What should these new formats be called? 4795bd8deadSopenharmony_ci 4805bd8deadSopenharmony_ci RESOLVED: "rgtc" for Red-Green Texture Compression. 4815bd8deadSopenharmony_ci 4825bd8deadSopenharmony_ci 2) How should the uncompressed and filtered texels be returned by 4835bd8deadSopenharmony_ci texture fetches? 4845bd8deadSopenharmony_ci 4855bd8deadSopenharmony_ci RESOLVED: Red values show up as (R,0,0,1) where R is the red 4865bd8deadSopenharmony_ci value, green and blue are forced to 0, and alpha is forced to 1. 4875bd8deadSopenharmony_ci Likewise, red-green values show up as (R,G,0,1) where G is the 4885bd8deadSopenharmony_ci green value. 4895bd8deadSopenharmony_ci 4905bd8deadSopenharmony_ci Prior extensions such as NV_float_buffer and NV_texture_shader 4915bd8deadSopenharmony_ci have introduced formats such as GL_FLOAT_R_NV and GL_DSDT_NV where 4925bd8deadSopenharmony_ci one- and two-component texture formats show up as (X,0,0,1) or 4935bd8deadSopenharmony_ci (X,Y,0,1) RGBA texels. The RGTC formats mimic these two-component 4945bd8deadSopenharmony_ci formats. 4955bd8deadSopenharmony_ci 4965bd8deadSopenharmony_ci The (X,Y,0,1) convention, particularly with signed components, 4975bd8deadSopenharmony_ci is nice for normal maps because a normalized vector can be 4985bd8deadSopenharmony_ci formed by a shader program by computing sqrt(abs(1-X*X-Y*Y)) 4995bd8deadSopenharmony_ci for the Z component. 5005bd8deadSopenharmony_ci 5015bd8deadSopenharmony_ci While GL_RED is a valid external format, core OpenGL provides 5025bd8deadSopenharmony_ci no GL_RG external format. Applications can either use 5035bd8deadSopenharmony_ci GL_RGB or GL_RGBA and pad out the blue and alpha components, 5045bd8deadSopenharmony_ci or use the two-component GL_LUMINANCE_ALPHA color format and 5055bd8deadSopenharmony_ci use the color matrix functionality to swizzle the luminance and 5065bd8deadSopenharmony_ci alpha values into red and green respectively. 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci 3) Should red and red-green compression formats with signed 5095bd8deadSopenharmony_ci components be introduced when the core specification lacked 5105bd8deadSopenharmony_ci uncompressed red and red-green texture formats? 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ci RESOLVED: Yes, signed red and red-green compression formats 5135bd8deadSopenharmony_ci should be added. 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci Signed red-green formats are suited for compressed normal maps. 5165bd8deadSopenharmony_ci Compressed normal maps may well be the dominant use of this 5175bd8deadSopenharmony_ci extension. 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ci Unsigned red-green formats require an extra "expand normal" 5205bd8deadSopenharmony_ci operation to convert [0,1] to [-1,+1]. Direct support for signed 5215bd8deadSopenharmony_ci red-green formats avoids this step in a shader program. 5225bd8deadSopenharmony_ci 5235bd8deadSopenharmony_ci 4) Should there be a mix of signed red and unsigned green or 5245bd8deadSopenharmony_ci vice versa? 5255bd8deadSopenharmony_ci 5265bd8deadSopenharmony_ci RESOLVED: No. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci NV_texture_shader provided an internal format 5295bd8deadSopenharmony_ci (GL_SIGNED_RGB_UNSIGNED_ALPHA_NV) with mixed signed and unsigned 5305bd8deadSopenharmony_ci components. The format saw little usage. There's no reason to 5315bd8deadSopenharmony_ci think a GL_SIGNED_RED_UNSIGNED_GREEN format would be any more 5325bd8deadSopenharmony_ci useful or popular. 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci 5) How are signed integer values mapped to floating-point values? 5355bd8deadSopenharmony_ci 5365bd8deadSopenharmony_ci RESOLVED: A signed 8-bit two's complement value X is computed to 5375bd8deadSopenharmony_ci a floating-point value Xf with the formula: 5385bd8deadSopenharmony_ci 5395bd8deadSopenharmony_ci { X / 127.0, X > -128 5405bd8deadSopenharmony_ci Xf = { 5415bd8deadSopenharmony_ci { -1.0, X == -128 5425bd8deadSopenharmony_ci 5435bd8deadSopenharmony_ci This conversion means -1, 0, and +1 are all exactly representable, 5445bd8deadSopenharmony_ci however -128 and -127 both map to -1.0. Mapping -128 to -1.0 5455bd8deadSopenharmony_ci avoids the numerical awkwardness of have a representable value 5465bd8deadSopenharmony_ci slightly more negative than -1.0. 5475bd8deadSopenharmony_ci 5485bd8deadSopenharmony_ci This conversion is intentionally NOT the "byte" conversion listed 5495bd8deadSopenharmony_ci in Table 2.9 for component conversions. That conversion says: 5505bd8deadSopenharmony_ci 5515bd8deadSopenharmony_ci Xf = (2*X + 1) / 255.0 5525bd8deadSopenharmony_ci 5535bd8deadSopenharmony_ci The Table 2.9 conversion is incapable of exactly representing 5545bd8deadSopenharmony_ci zero. 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci 6) How will signed components resulting 5575bd8deadSopenharmony_ci from GL_COMPRESSED_SIGNED_RED_RGTC1 and 5585bd8deadSopenharmony_ci GL_COMPRESSED_SIGNED_RG_RGTC2 texture fetches interact 5595bd8deadSopenharmony_ci with fragment coloring? 5605bd8deadSopenharmony_ci 5615bd8deadSopenharmony_ci RESOLVED: The specification language for this extension is silent 5625bd8deadSopenharmony_ci about clamping behavior leaving this to the core specification 5635bd8deadSopenharmony_ci and other extensions. The clamping or lack of clamping is left 5645bd8deadSopenharmony_ci to the core specification and other extensions. 5655bd8deadSopenharmony_ci 5665bd8deadSopenharmony_ci For assembly program extensions supporting texture fetches 5675bd8deadSopenharmony_ci (ARB_fragment_program, NV_fragment_program, NV_vertex_program3, 5685bd8deadSopenharmony_ci etc.) or the OpenGL Shading Language, these signed formats will 5695bd8deadSopenharmony_ci appear as expected with unclamped signed components as a result 5705bd8deadSopenharmony_ci of a texture fetch instruction. 5715bd8deadSopenharmony_ci 5725bd8deadSopenharmony_ci If ARB_color_buffer_float is supported, its clamping controls 5735bd8deadSopenharmony_ci will apply. 5745bd8deadSopenharmony_ci 5755bd8deadSopenharmony_ci NV_texture_shader extension, if supported, adds support for 5765bd8deadSopenharmony_ci fixed-point textures with signed components and relaxed the 5775bd8deadSopenharmony_ci fixed-function texture environment clamping appropriately. If the 5785bd8deadSopenharmony_ci NV_texture_shader extension is supported, its specified behavior 5795bd8deadSopenharmony_ci for the texture environment applies where intermediate values 5805bd8deadSopenharmony_ci are clamped to [-1,1] unless stated otherwise as in the case 5815bd8deadSopenharmony_ci of explicitly clamped to [0,1] for GL_COMBINE. or clamping the 5825bd8deadSopenharmony_ci linear interpolation weight to [0,1] for GL_DECAL and GL_BLEND. 5835bd8deadSopenharmony_ci 5845bd8deadSopenharmony_ci Otherwise, the conventional core texture environment clamps 5855bd8deadSopenharmony_ci incoming, intermediate, and output color components to [0,1]. 5865bd8deadSopenharmony_ci 5875bd8deadSopenharmony_ci This implies that the conventional texture environment 5885bd8deadSopenharmony_ci functionality of unextended OpenGL 1.5 or OpenGL 2.0 without 5895bd8deadSopenharmony_ci using GLSL (and with none of the extensions referred to above) 5905bd8deadSopenharmony_ci is unable to make proper use of the signed texture formats added 5915bd8deadSopenharmony_ci by this extension because the conventional texture environment 5925bd8deadSopenharmony_ci requires texture source colors to be clamped to [0,1]. Texture 5935bd8deadSopenharmony_ci filtering of these signed formats would be still signed, but 5945bd8deadSopenharmony_ci negative values generated post-filtering would be clamped to 5955bd8deadSopenharmony_ci zero by the core texture environment functionality. The 5965bd8deadSopenharmony_ci expectation is clearly that this extension would be co-implemented 5975bd8deadSopenharmony_ci with one of the previously referred to extensions or used with 5985bd8deadSopenharmony_ci GLSL for the new signed formats to be useful. 5995bd8deadSopenharmony_ci 6005bd8deadSopenharmony_ci 7) Should a specific normal map compression format be added? 6015bd8deadSopenharmony_ci 6025bd8deadSopenharmony_ci RESOLVED: No. 6035bd8deadSopenharmony_ci 6045bd8deadSopenharmony_ci It's probably short-sighted to design a format just for normal 6055bd8deadSopenharmony_ci maps. Indeed, NV_texture_shader added a GL_SIGNED_HILO_NV 6065bd8deadSopenharmony_ci format with exactly the kind of "hemisphere remap" useful for 6075bd8deadSopenharmony_ci normal maps and the format went basically unused. Instead, 6085bd8deadSopenharmony_ci this extension provides the mechanism for compressed normal maps 6095bd8deadSopenharmony_ci based on the more conventional red-green format. 6105bd8deadSopenharmony_ci 6115bd8deadSopenharmony_ci The GL_COMPRESSED_RG_RGTC2 and 6125bd8deadSopenharmony_ci GL_COMPRESSED_SIGNED_RG_RGTC2 formats are sufficient 6135bd8deadSopenharmony_ci for normal maps with additional shader instructions used to 6145bd8deadSopenharmony_ci generate the 3rd component. 6155bd8deadSopenharmony_ci 6165bd8deadSopenharmony_ci 8) Should uncompressed signed red and red-green formats be added 6175bd8deadSopenharmony_ci by this extension? 6185bd8deadSopenharmony_ci 6195bd8deadSopenharmony_ci RESOLVED: No, this extension is focused on just adding compressed 6205bd8deadSopenharmony_ci texture formats. 6215bd8deadSopenharmony_ci 6225bd8deadSopenharmony_ci The NV_texture_shader extension adds such uncompressed signed 6235bd8deadSopenharmony_ci texture formats. A distinct multi-vendor extension for signed 6245bd8deadSopenharmony_ci fixed-point texture formats could provide all or a subset of 6255bd8deadSopenharmony_ci the signed fixed-point uncompressed texture formats introduced 6265bd8deadSopenharmony_ci by NV_texture_shader. 6275bd8deadSopenharmony_ci 6285bd8deadSopenharmony_ci 9) What compression ratios does this extension provide? 6295bd8deadSopenharmony_ci 6305bd8deadSopenharmony_ci The RGTC1 formats are 8 bytes (64 bits) per 4x4 pixel block. 6315bd8deadSopenharmony_ci A 4x4 block of GL_LUMINANCE8 data requires 16 bytes (1 byte 6325bd8deadSopenharmony_ci per texel). This is a 2-to-1 compression ratio. 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci The RGTC2 formats are 16 bytes (128 bits) per 4x4 pixel block. 6355bd8deadSopenharmony_ci A 4x4 block of GL_LUMINANCE8_ALPHA8 data requires 32 bytes 6365bd8deadSopenharmony_ci (2 bytes per texel). This is again a 2-to-1 compression ratio. 6375bd8deadSopenharmony_ci 6385bd8deadSopenharmony_ci In contrast, the comparable compression ratio for the S3TC 6395bd8deadSopenharmony_ci formats is 4-to-1. 6405bd8deadSopenharmony_ci 6415bd8deadSopenharmony_ci Arguably, the lower compression ratio allows better compression 6425bd8deadSopenharmony_ci quality particularly because the RGTC formats compress each 6435bd8deadSopenharmony_ci component separately. 6445bd8deadSopenharmony_ci 6455bd8deadSopenharmony_ci 10) How do these new formats compare with the existing GL_LUMINANCE4, 6465bd8deadSopenharmony_ci GL_LUMINANCE4_ALPHA4, and GL_LUMINANCE6_ALPHA2 internal formats? 6475bd8deadSopenharmony_ci 6485bd8deadSopenharmony_ci RESOLVED: The existing GL_LUMINANCE4, GL_LUMINANCE4_ALPHA4, 6495bd8deadSopenharmony_ci and GL_LUMINANCE6_ALPHA2 internal formats provide a similar 6505bd8deadSopenharmony_ci 2-to-1 compression ratio but mandate a uniform quantization 6515bd8deadSopenharmony_ci for all components. In contrast, this extension provides a 6525bd8deadSopenharmony_ci compression format with 3-bit quantization over a specifiable 6535bd8deadSopenharmony_ci min/max range that can vary per 4x4 texel tile. 6545bd8deadSopenharmony_ci 6555bd8deadSopenharmony_ci Additionally, many OpenGL implementations do not natively support 6565bd8deadSopenharmony_ci the GL_LUMINANCE4, GL_LUMINANCE4_ALPHA4, and GL_LUMINANCE6_ALPHA2 6575bd8deadSopenharmony_ci internal formats but rather silently promote these formats 6585bd8deadSopenharmony_ci to store 8 bits per component, thereby eliminating any 6595bd8deadSopenharmony_ci storage/bandwidth advantage for these formats. 6605bd8deadSopenharmony_ci 6615bd8deadSopenharmony_ci 11) Does this extension require EXT_texture_compression_s3tc? 6625bd8deadSopenharmony_ci 6635bd8deadSopenharmony_ci RESOLVED: No. 6645bd8deadSopenharmony_ci 6655bd8deadSopenharmony_ci As written, this specification does not rely on wording of the 6665bd8deadSopenharmony_ci EXT_texture_compression_s3tc extension. For example, certain 6675bd8deadSopenharmony_ci discussion added to Sections 3.8.2 and 3.8.3 is quite similar 6685bd8deadSopenharmony_ci to corresponding EXT_texture_compression_s3tc language. 6695bd8deadSopenharmony_ci 6705bd8deadSopenharmony_ci 12) Should anything be said about the precision of texture filtering 6715bd8deadSopenharmony_ci for these new formats? 6725bd8deadSopenharmony_ci 6735bd8deadSopenharmony_ci RESOLVED: No precision requirements are part of the specification 6745bd8deadSopenharmony_ci language since OpenGL extensions typically leave precision 6755bd8deadSopenharmony_ci details to the implementation. 6765bd8deadSopenharmony_ci 6775bd8deadSopenharmony_ci Realistically, at least 8-bit filtering precision can be expected 6785bd8deadSopenharmony_ci from implementations (and probably more). 6795bd8deadSopenharmony_ci 6805bd8deadSopenharmony_ci 13) Should these formats be allowed to specify 3D texture images 6815bd8deadSopenharmony_ci when NV_texture_compression_vtc is supported? 6825bd8deadSopenharmony_ci 6835bd8deadSopenharmony_ci RESOLVED: The NV_texture_compression_vtc stacks 4x4 blocks into 6845bd8deadSopenharmony_ci 4x4x4 bricks. It may be more desirable to represent compressed 6855bd8deadSopenharmony_ci 3D textures as simply slices of 4x4 blocks. 6865bd8deadSopenharmony_ci 6875bd8deadSopenharmony_ci However the NV_texture_compression_vtc extension expects data 6885bd8deadSopenharmony_ci passed to the glCompressedTexImage commands to be "bricked" 6895bd8deadSopenharmony_ci rather than blocked slices. 6905bd8deadSopenharmony_ci 6915bd8deadSopenharmony_ci 14) How is the texture border color handled for the blue component 6925bd8deadSopenharmony_ci of an RGTC2 texture and the green and blue components of an 6935bd8deadSopenharmony_ci RGTC1 texture? 6945bd8deadSopenharmony_ci 6955bd8deadSopenharmony_ci RESOLVED: The base texture format is RGB for the RGTC1 and 6965bd8deadSopenharmony_ci RGTC2 texture formats. This would mean table 3.15 would be 6975bd8deadSopenharmony_ci used to determine how the texture border color is interpreted 6985bd8deadSopenharmony_ci and which components are considered. 6995bd8deadSopenharmony_ci 7005bd8deadSopenharmony_ci However since only red or red/green components exist for the 7015bd8deadSopenharmony_ci RGTC1 and RGTC2 formats, it makes little sense to require 7025bd8deadSopenharmony_ci the blue component be supplied by the texture border color and 7035bd8deadSopenharmony_ci hence be involved (meaningfully only when the border is sampled) 7045bd8deadSopenharmony_ci in texture filtering. 7055bd8deadSopenharmony_ci 7065bd8deadSopenharmony_ci For this reason, a statement is added to section 3.8.8 says that 7075bd8deadSopenharmony_ci if a texture's internal format lacks components that exist in 7085bd8deadSopenharmony_ci the texture's base internal format, such components contain 7095bd8deadSopenharmony_ci zero (ignoring the texture's corresponding texture border color 7105bd8deadSopenharmony_ci component value) when the texture border color is sampled. 7115bd8deadSopenharmony_ci 7125bd8deadSopenharmony_ci So the green and blue components of the filtered result of a 7135bd8deadSopenharmony_ci RGTC1 texture are always zero, even when the border is sampled. 7145bd8deadSopenharmony_ci Similarly the blue component of the filtered result of a RGTC2 7155bd8deadSopenharmony_ci texture is always zero, even when the border is sampled. 7165bd8deadSopenharmony_ci 7175bd8deadSopenharmony_ci 15) What should glGetTexLevelParameter return for 7185bd8deadSopenharmony_ci GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1 7195bd8deadSopenharmony_ci formats? What should glGetTexLevelParameter return for 7205bd8deadSopenharmony_ci GL_TEXTURE_BLUE_SIZE for the RGTC2 formats? 7215bd8deadSopenharmony_ci 7225bd8deadSopenharmony_ci RESOLVED: Zero bits. 7235bd8deadSopenharmony_ci 7245bd8deadSopenharmony_ci These formats always return 0.0 for these respective components 7255bd8deadSopenharmony_ci and have no bits devoted to these components. 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ci Returning 8 bits for red size of RGTC1 and the red and green 7285bd8deadSopenharmony_ci sizes of RGTC2 makes sense because that's the maximum potential 7295bd8deadSopenharmony_ci precision for the uncompressed texels. 7305bd8deadSopenharmony_ci 7315bd8deadSopenharmony_ci 16) Should the token names contain R and RG or RED and RED_GREEN? 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci RESOLVED: RED and RG. See issue #3 in the ARB_texture_rg 7345bd8deadSopenharmony_ci specification. 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ci 17) Can you use the GL_RED external format with glTexImage2D and other 7375bd8deadSopenharmony_ci such commands to load textures with the 7385bd8deadSopenharmony_ci GL_COMPRESSED_RED_RGTC1 or GL_COMPRESSED_SIGNED_RED_RGTC1 7395bd8deadSopenharmony_ci internal formats? 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ci RESOLVED: Yes. 7425bd8deadSopenharmony_ci 7435bd8deadSopenharmony_ci GL_RED has been a valid external format parameter to glTexImage 7445bd8deadSopenharmony_ci and similar commands since OpenGL 1.0. 7455bd8deadSopenharmony_ci 7465bd8deadSopenharmony_ci 18) Should any of the generic compression GL_COMPRESSED_* tokens in 7475bd8deadSopenharmony_ci OpenGL 2.1 map to RGTC formats? 7485bd8deadSopenharmony_ci 7495bd8deadSopenharmony_ci RESOLVED: No. The RGTC formats are missing color components 7505bd8deadSopenharmony_ci so are not adequate implementations for any of the generic 7515bd8deadSopenharmony_ci compression formats. 7525bd8deadSopenharmony_ci 7535bd8deadSopenharmony_ci 19) Should the GL_NUM_COMPRESSED_TEXTURE_FORMATS and 7545bd8deadSopenharmony_ci GL_COMPRESSED_TEXTURE_FORMATS queries return the RGTC formats? 7555bd8deadSopenharmony_ci 7565bd8deadSopenharmony_ci RESOLVED: No. 7575bd8deadSopenharmony_ci 7585bd8deadSopenharmony_ci The OpenGL 2.1 specification says "The only values returned 7595bd8deadSopenharmony_ci by this query [GL_COMPRESSED_TEXTURE_FORMATS"] are those 7605bd8deadSopenharmony_ci corresponding to formats suitable for general-purpose usage. 7615bd8deadSopenharmony_ci The renderer will not enumerate formats with restrictions that 7625bd8deadSopenharmony_ci need to be specifically understood prior to use." 7635bd8deadSopenharmony_ci 7645bd8deadSopenharmony_ci Compressed textures with just red or red-green components are 7655bd8deadSopenharmony_ci not general-purpose so should not be returned by these queries 7665bd8deadSopenharmony_ci because they have restrictions. 7675bd8deadSopenharmony_ci 7685bd8deadSopenharmony_ci Applications that seek to use the RGTC formats should do so 7695bd8deadSopenharmony_ci by looking for this extension's name in the string returned by 7705bd8deadSopenharmony_ci glGetString(GL_EXTENSIONS) rather than 7715bd8deadSopenharmony_ci what GL_NUM_COMPRESSED_TEXTURE_FORMATS and 7725bd8deadSopenharmony_ci GL_COMPRESSED_TEXTURE_FORMATS return. 7735bd8deadSopenharmony_ci 7745bd8deadSopenharmony_ci 20) Why don't the new tokens and entry points in this extension have 7755bd8deadSopenharmony_ci "ARB" suffixes like other ARB extensions? 7765bd8deadSopenharmony_ci 7775bd8deadSopenharmony_ci RESOLVED: Unlike most ARB extensions, this is a strict subset 7785bd8deadSopenharmony_ci of functionality already approved in OpenGL 3.0. This extension 7795bd8deadSopenharmony_ci exists only to support that functionality on older hardware that 7805bd8deadSopenharmony_ci cannot implement a full OpenGL 3.0 driver. Since there are no 7815bd8deadSopenharmony_ci possible behavior changes between the ARB extension and core 7825bd8deadSopenharmony_ci features, source code compatibility is improved by not using 7835bd8deadSopenharmony_ci suffixes on the extension. 7845bd8deadSopenharmony_ci 7855bd8deadSopenharmony_ciImplementation Note 7865bd8deadSopenharmony_ci 7875bd8deadSopenharmony_ci This extension allows TexSubImage2D and CompressedTexSubImage2D to perform 7885bd8deadSopenharmony_ci partial updates to compressed images, but generally requires that the 7895bd8deadSopenharmony_ci updated area be aligned to 4x4 block boundaries. If the width or height 7905bd8deadSopenharmony_ci is not a multiple of four, there will be 4x4 blocks at the edge of the 7915bd8deadSopenharmony_ci image that contain "extra" texels that are not part of the image. This 7925bd8deadSopenharmony_ci spec has an exception allowing edits that partially cover such blocks as 7935bd8deadSopenharmony_ci long as the edit covers all texels in the block belonging to the image. 7945bd8deadSopenharmony_ci For example, in a 2D texture of size 70x50, it is legal to update the 7955bd8deadSopenharmony_ci single partial block covering the four texels from (68,48) to (69,49) by 7965bd8deadSopenharmony_ci setting (<xoffset>, <yoffset>) to (68,48) and <width> and <height> to 2. 7975bd8deadSopenharmony_ci 7985bd8deadSopenharmony_ci This specification derived some of its language from the 7995bd8deadSopenharmony_ci EXT_texture_compression_s3tc specification. When that extension was 8005bd8deadSopenharmony_ci originally written, non-bordered textures were required to have widths and 8015bd8deadSopenharmony_ci heights that were powers of two. Therefore, the only cases where partial 8025bd8deadSopenharmony_ci blocks could occur were if the width or height of the texture image was 8035bd8deadSopenharmony_ci one or two. The original spec language allowed partial block edits only 8045bd8deadSopenharmony_ci if the width or height of the region edited was equal to the full texture 8055bd8deadSopenharmony_ci size. That language didn't handle cases such as the 70x50 example above. 8065bd8deadSopenharmony_ci 8075bd8deadSopenharmony_ci This specification was updated in May, 2009 to allow such edits. 8085bd8deadSopenharmony_ci Multiple OpenGL implementers correctly implemented the original 8095bd8deadSopenharmony_ci restriction, and partial edits that include partially covered tiles will 8105bd8deadSopenharmony_ci result in INVALID_OPERATION errors on older drivers. 8115bd8deadSopenharmony_ci 8125bd8deadSopenharmony_ciRevision History 8135bd8deadSopenharmony_ci 8145bd8deadSopenharmony_ci Revision 1.1, April 24, 2007: mjk 8155bd8deadSopenharmony_ci - Add caveat about how signed LA decompression happens when 8165bd8deadSopenharmony_ci lum0 equals -127 and lum1 equals -128. This caveat matches 8175bd8deadSopenharmony_ci a decoding allowance in DirectX 10. 8185bd8deadSopenharmony_ci 8195bd8deadSopenharmony_ci Revision 1.2, January 21, 2008: mjk 8205bd8deadSopenharmony_ci - Add issues #18 and #19. 8215bd8deadSopenharmony_ci 8225bd8deadSopenharmony_ci Revision 1.3, June 30, 2008: js 8235bd8deadSopenharmony_ci - trivial conversion to ARB from EXT 8245bd8deadSopenharmony_ci 8255bd8deadSopenharmony_ci Revision 1.4, August 7, 2008: jleech 8265bd8deadSopenharmony_ci - Remove ARB suffixes. 8275bd8deadSopenharmony_ci 8285bd8deadSopenharmony_ci Revision 1.5, May 29, 2009: jleech 8295bd8deadSopenharmony_ci - Sync with pbrown's fixes to the EXT version of this extension: 8305bd8deadSopenharmony_ci Add interaction with non-power-of-two textures from OpenGL 2.0 8315bd8deadSopenharmony_ci / ARB_texture_non_power_of_two. Allow CompressedTexSubImage2D 8325bd8deadSopenharmony_ci to perform edits that include partial tiles at the edge of the 8335bd8deadSopenharmony_ci image as long as the specified width/height parameters line up 8345bd8deadSopenharmony_ci with the edge. Thanks to Emil Persson for finding this issue. 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci Revision 1.6, April 17, 2014: jleech 8375bd8deadSopenharmony_ci - Fix table 3.17 so base type for COMRPESSED*RG_RGTC2 formats 8385bd8deadSopenharmony_ci is RG instead of RGB, matching core GL spec (Bug 7812). 8395bd8deadSopenharmony_ci 8405bd8deadSopenharmony_ci Revision 1.7, January 27, 2015: jleech 8415bd8deadSopenharmony_ci - Fix table 3.17 so base type for COMRPESSED*RED_RGTC1 formats 8425bd8deadSopenharmony_ci is RED instead of RGB, matching core GL spec (Bug 13260). 843