15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci OES_texture_npot 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_OES_texture_npot 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Bruce Merry (bruce.merry at arm.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Khronos OpenGL ES working group 165bd8deadSopenharmony_ci Contributors to ARB_texture_non_power_of_two 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciNotice 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at 215bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciSpecification Update Policy 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 265bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 275bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 285bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 295bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 305bd8deadSopenharmony_ci described in more detail at 315bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciIP Status 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci None. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciStatus 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci Ratified by the Khronos BOP, July 22, 2005. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciVersion 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci Last Modifed Date: 2011-03-07 445bd8deadSopenharmony_ci Author Revision: 3 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNumber 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci OpenGL ES Extension #37 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciDependencies 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci OpenGL ES 1.0 or OpenGL ES 2.0 is required. This extension is 535bd8deadSopenharmony_ci written against OpenGL ES 1.1.12 and OpenGL ES 2.0.25. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci This extension interacts with OES_framebuffer_object, OES_texture_3D 565bd8deadSopenharmony_ci and APPLE_texture_2D_limited_npot. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciOverview 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci This extension adds support for the REPEAT and MIRRORED_REPEAT 615bd8deadSopenharmony_ci texture wrap modes and the minification filters supported for 625bd8deadSopenharmony_ci non-power of two 2D textures, cubemaps and for 3D textures, if 635bd8deadSopenharmony_ci the OES_texture_3D extension is supported. 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci Section 3.8.2 of the OpenGL ES 2.0 specification describes 665bd8deadSopenharmony_ci rules for sampling from an incomplete texture. There were specific 675bd8deadSopenharmony_ci rules added for non-power of two textures i.e. if the texture wrap 685bd8deadSopenharmony_ci mode is not CLAMP_TO_EDGE or minification filter is not NEAREST or 695bd8deadSopenharmony_ci LINEAR and the texture is a non-power-of-two texture, then sampling 705bd8deadSopenharmony_ci the texture will return (0, 0, 0, 1). 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci These rules are no longer applied by an implementation that supports 735bd8deadSopenharmony_ci this extension. 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0 Full Specification 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci In section 3.7.1 (Texture Image Specification), remove the sentence 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci "If <level> is greater than zero, and either <width> or <height> 805bd8deadSopenharmony_ci is not a power of two, the error INVALID_VALUE is generated." 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci In section 3.7.7 (Texture Minification), remove the paragraph 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci "If any dimension of any array in a mipmap is not a power of two 855bd8deadSopenharmony_ci (e.g. if rounding down as described above is performed), then 865bd8deadSopenharmony_ci the mipmap is described as a non-power-of-two texture. 875bd8deadSopenharmony_ci Non-power-of-two textures have restrictions on the allowed 885bd8deadSopenharmony_ci texture wrap modes and filters, as described in section 3.8.2." 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci Change the title of 3.7.10 (Texture Completeness and 915bd8deadSopenharmony_ci Non-Power-Of-Two Textures) to "Texture Completeness". 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci In section 3.7.11 (Mipmap Generation), remove the sentence 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci "If either the width or height of the level zero array are not a 965bd8deadSopenharmony_ci power or two, the error INVALID_OPERATION is generated." 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci In section 3.8.2 (Shader Execution), remove the bullet points 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci " 1015bd8deadSopenharmony_ci - A two-dimensional sampler is called, the corresponding texture 1025bd8deadSopenharmony_ci image is a non-power-of-two image (as described in the 1035bd8deadSopenharmony_ci Mipmapping discussion of section 3.7.7), and either the 1045bd8deadSopenharmony_ci texture wrap mode is not CLAMP_TO_EDGE, or the minification 1055bd8deadSopenharmony_ci filter is neither NEAREST nor LINEAR. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci - A cube map sampler is called, any of the corresponding texture 1085bd8deadSopenharmony_ci images are non-power-of-two images, and either the texture 1095bd8deadSopenharmony_ci wrap mode is not CLAMP_TO_EDGE, or the minification filter 1105bd8deadSopenharmony_ci is neither NEAREST nor LINEAR. 1115bd8deadSopenharmony_ci " 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 1.1.12 Full Specification 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci In section 3.7.1 (Texture Image Specification): 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci Replace the discussion of valid dimensions with 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci "If w_s and h_s are the specified image width and height, and if w_s 1205bd8deadSopenharmony_ci or h_s is less than zero, then the error INVALID_VALUE is 1215bd8deadSopenharmony_ci generated." 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci Replace the discussion of image decoding with: 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci "We shall refer to the decoded image as the texture array. A 1265bd8deadSopenharmony_ci texture array has width and height w_s and h_s as defined above." 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci Update Figure 3.8's caption: 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci "... This is a texture with w_t = 8 and h_t = 4. ..." 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci In section 3.7.7 (Texture Minification): 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci In the subsection "Scale Factor and Level of Detail"... 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci Replace the sentence defining the u and v functions with: 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci "Let u(x,y) = w_s * s(x,y) and v(x,y) = h_s * t(x,y), where w_s and 1405bd8deadSopenharmony_ci h_s are equal to the width and height of the image array whose level 1415bd8deadSopenharmony_ci is zero." 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci Replace 2^n and 2^m with w_s and h_s in Equations 3.16 and 3.17. 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci { floor(u), s < 1 1465bd8deadSopenharmony_ci i = { (3.16) 1475bd8deadSopenharmony_ci { w_s - 1, s = 1 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci { floor(v), t < 1 1505bd8deadSopenharmony_ci j = { (3.17) 1515bd8deadSopenharmony_ci { h_s - 1, t = 1 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci Replace 2^n and 2^m with w_s and h_s in the equations for computing i_0, 1545bd8deadSopenharmony_ci j_0, i_1, and j_1 used for LINEAR filtering. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci { floor(u - 1/2) mod w_s, TEXTURE_WRAP_S is REPEAT 1575bd8deadSopenharmony_ci i_0 = { 1585bd8deadSopenharmony_ci { floor(u - 1/2), otherwise 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci { floor(v - 1/2) mod h_s, TEXTURE_WRAP_T is REPEAT 1615bd8deadSopenharmony_ci j_0 = { 1625bd8deadSopenharmony_ci { floor(v - 1/2), otherwise 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci { (i_0 + 1) mod w_s, TEXTURE_WRAP_S is REPEAT 1655bd8deadSopenharmony_ci i_1 = { 1665bd8deadSopenharmony_ci { i_0 + 1, otherwise 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci { (j_0 + 1) mod h_s, TEXTURE_WRAP_T is REPEAT 1695bd8deadSopenharmony_ci j_1 = { 1705bd8deadSopenharmony_ci { j_0 + 1, otherwise 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci In the subsection "Mipmapping", replace the description of the 1735bd8deadSopenharmony_ci number of sizes of image arrays with 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci "If the image array of level zero has dimensions w_t x h_t, then 1765bd8deadSopenharmony_ci there are floor(log2(max(w_t, h_t))) + 1 image arrays in the mipmap. 1775bd8deadSopenharmony_ci Each array subsequent to the level zero array has dimensions 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci max(1, floor(w_t/2^i)) x max(1, floor(h_t/2^i)) 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci until the last array is reached with dimension 1 x 1. 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ciInteractions with OES_framebuffer_object 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci If OES_framebuffer_object is supported, then GenerateMipmapOES does 1865bd8deadSopenharmony_ci not generate an error if the base level is a non-power-of-two image. 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ciInteractions with OES_texture_3D 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci If OES_texture_3D is supported, references to width and height 1915bd8deadSopenharmony_ci should be extended to refer to depth as appropriate, and mipmap 1925bd8deadSopenharmony_ci generation is permitted for non-power-of-two 3D textures. 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ciInteractions with APPLE_texture_2D_limited_npot 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci This extension is a superset of the function in 1975bd8deadSopenharmony_ci APPLE_texture_2D_limited_npot. Implementations may choose to 1985bd8deadSopenharmony_ci advertise both extensions, but APPLE_texture_2D_limited_npot is not 1995bd8deadSopenharmony_ci required to implement this extension on OpenGL ES 1.x. 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ciIssues 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci 1) How does this extension interact with manual mipmap generation 2045bd8deadSopenharmony_ci (GenerateMipmap and GenerateMipmapOES)? 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci RESOLVED: These are supported for NPOT textures. 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci The initial version of this extension did not remove the error when 2095bd8deadSopenharmony_ci issuing these commands on an non-power-of-two texture, but multiple 2105bd8deadSopenharmony_ci vendors implemented support for it anyway. 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci 2) How does this extension interact with automatic mipmap generation 2135bd8deadSopenharmony_ci in GL ES 1.1 (GENERATE_MIPMAP)? 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci RESOLVED: These are supported for NPOT textures. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci 3) How should this extension interact with 2185bd8deadSopenharmony_ci APPLE_texture_2D_limited_npot? 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci RESOLVED: it will be a superset, but will not require it. 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci 4) How should this extension interact with OES_texture_3D? 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci RESOLVED: mipmap generation of NPOT 3D textures is supported. 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci OES_texture_3D already specifies that OES_texture_npot enables 2275bd8deadSopenharmony_ci support for mipmapped 3D textures, but it is unclear whether this 2285bd8deadSopenharmony_ci should also allow mipmap generation for NPOT 3D textures. 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci 5) How should this extension interact with 2315bd8deadSopenharmony_ci OES_compressed_paletted_texture? 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci UNRESOLVED 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci Specifically, it's now possible for a row of texels to not be a 2365bd8deadSopenharmony_ci multiple of the unit size (bytes for PALETTE4_xxx, 32-bit words for 2375bd8deadSopenharmony_ci PALETTE8_xxx). Options seem to be 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci A) Pad each row to a multiple of the unit size. 2405bd8deadSopenharmony_ci B) Pad each image to a multiple of the unit size. 2415bd8deadSopenharmony_ci C) No padding - images can start in the middle of a unit. 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ciNew Tokens 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci None. 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ciNew Procedures and Functions 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci None. 2505bd8deadSopenharmony_ci 2515bd8deadSopenharmony_ciErrors 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci None. 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ciNew State 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci None. 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ciRevision History 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci 3 2011-03-07 Bruce Merry Added issue 5 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci 2 2011-03-01 Bruce Merry Filled in body and issues 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci 1 2005-07-06 Aaftab Munshi Created the extension 266