15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci APPLE_texture_2D_limited_npot 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_APPLE_texture_2D_limited_npot 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Richard Schreyer 125bd8deadSopenharmony_ci The many contributors to ARB_texture_non_power_of_two 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContact 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Benj Lipchak, Apple (lipchak 'at' apple.com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Date: February 24, 2011 255bd8deadSopenharmony_ci Revision: 1.3 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL ES Extension #59 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci OpenGL ES 1.0 is required. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Written based on the wording of the OpenGL ES 1.1 specification. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci OES_texture_cube_map affects the definition of this extension. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci OES_texture_3D affects the definition of this extension. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci OES_texture_npot affects the definition of this extension. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci OES_framebuffer_object affects the definition of this extension. 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciOverview 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci Conventional OpenGL ES 1.X texturing is limited to images with 485bd8deadSopenharmony_ci power-of-two (POT) dimensions. APPLE_texture_2D_limited_npot extension 495bd8deadSopenharmony_ci relaxes these size restrictions for 2D textures. The restrictions remain 505bd8deadSopenharmony_ci in place for cube map and 3D textures, if supported. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci There is no additional procedural or enumerant API introduced by this 535bd8deadSopenharmony_ci extension except that an implementation which exports the extension string 545bd8deadSopenharmony_ci will allow an application to pass in 2D texture dimensions that may or may 555bd8deadSopenharmony_ci not be a power of two. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci In the absence of OES_texture_npot, which lifts these restrictions, neither 585bd8deadSopenharmony_ci mipmapping nor wrap modes other than CLAMP_TO_EDGE are supported in 595bd8deadSopenharmony_ci conjunction with NPOT 2D textures. A NPOT 2D texture with a wrap mode that 605bd8deadSopenharmony_ci is not CLAMP_TO_EDGE or a minfilter that is not NEAREST or LINEAR is 615bd8deadSopenharmony_ci considered incomplete. If such a texture is bound to a texture unit, it is 625bd8deadSopenharmony_ci as if texture mapping were disabled for that texture unit. 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ciNew Procedures and Functions 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci None 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ciNew Tokens 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci None 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation) 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci None 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization) 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci -- Section 3.7.1 "Texture Image Specification" 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci Replace the discussion of valid dimensions with: 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci "If w_s and h_s are the specified image width and height, and if w_s or h_s 835bd8deadSopenharmony_ci is less than zero, then the error INVALID_VALUE is generated." 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci Replace the discussion of image decoding with: 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci "We shall refer to the decoded image as the texture array. A texture array 885bd8deadSopenharmony_ci has width and height w_s and h_s as defined above." 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci Update Figure 3.8's caption: 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci "... This is a texture with w_t = 8 and h_t = 4. ..." 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci -- Section 3.7.7 "Texture Minification" 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci In the subsection "Scale Factor and Level of Detail"... 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Replace the sentence defining the u and v functions with: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci "Let u(x,y) = w_s * s(x,y) and v(x,y) = h_s * t(x,y), where w_s and h_s are 1015bd8deadSopenharmony_ci equal to the width and height of the image array whose level is zero." 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Replace 2^n and 2^m with w_s and h_s in Equations 3.16 and 3.17. 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci { floor(u), s < 1 1065bd8deadSopenharmony_ci i = { (3.16) 1075bd8deadSopenharmony_ci { w_s - 1, s = 1 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci { floor(v), t < 1 1105bd8deadSopenharmony_ci j = { (3.17) 1115bd8deadSopenharmony_ci { h_s - 1, t = 1 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Replace 2^n and 2^m with w_s and h_s in the equations for computing i_0, 1145bd8deadSopenharmony_ci j_0, i_1, and j_1 used for LINEAR filtering. 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci { floor(u - 1/2) mod w_s, TEXTURE_WRAP_S is REPEAT 1175bd8deadSopenharmony_ci i_0 = { 1185bd8deadSopenharmony_ci { floor(u - 1/2), otherwise 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci { floor(v - 1/2) mod h_s, TEXTURE_WRAP_T is REPEAT 1215bd8deadSopenharmony_ci j_0 = { 1225bd8deadSopenharmony_ci { floor(v - 1/2), otherwise 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci { (i_0 + 1) mod w_s, TEXTURE_WRAP_S is REPEAT 1255bd8deadSopenharmony_ci i_1 = { 1265bd8deadSopenharmony_ci { i_0 + 1, otherwise 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci { (j_0 + 1) mod h_s, TEXTURE_WRAP_T is REPEAT 1295bd8deadSopenharmony_ci j_1 = { 1305bd8deadSopenharmony_ci { j_0 + 1, otherwise 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci In the subsection "Mipmapping"... 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci Insert paragraph after the second paragraph: 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci "If any dimension of any array in a mipmap is not a power of two (e.g. if 1375bd8deadSopenharmony_ci rounding down as described above is performed), then the mipmap is 1385bd8deadSopenharmony_ci described as a non-power-of-two texture. Non-power-of-two textures have 1395bd8deadSopenharmony_ci restrictions on the allowed texture wrap modes and filters, as described in 1405bd8deadSopenharmony_ci section 3.7.9." 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci -- Section 3.7.9 "Texture Completeness" 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci Rename to "Texture Completeness and Non-Power-Of-Two Textures" 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci Add a bullet item to the list of conditions for completeness: 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci "Each dimension of the zero level array is a power of two or both the 1495bd8deadSopenharmony_ci texture wrap mode is CLAMP_TO_EDGE and the minification filter is NEAREST 1505bd8deadSopenharmony_ci or LINEAR." 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment Operations 1535bd8deadSopenharmony_ciand the Framebuffer) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci None 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions) 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci None 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ciAdditions to the GLX Specification 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci None 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ciInteractions with OES_texture_cube_map 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci If OES_texture_cube_map is supported, TexImage2D called with target 1685bd8deadSopenharmony_ci TEXTURE_CUBE_MAP will *not* accept non-power-of-two texture dimensions, and 1695bd8deadSopenharmony_ci will generate and INVALID_VALUE error. Otherwise omit all references to 1705bd8deadSopenharmony_ci cube map textures. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ciInteractions with OES_texture_3D 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci If OES_texture_3D is supported, TexImage3D will *not* accept non-power-of- 1755bd8deadSopenharmony_ci two texture dimensions, and will generate and INVALID_VALUE error. 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ciInteractions with OES_texture_npot 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci If OES_texture_npot is supported, omit the restrictions on mipmapping and 1805bd8deadSopenharmony_ci REPEAT wrap modes which lead to texture incompleteness for 2D textures. 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ciGLX Protocol 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci None 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ciErrors 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci The following error is altered to allow NPOT dimensions for 2D textures: 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci INVALID_VALUE is generated by TexImage2D or glCopyTexImage2D if target is 1915bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_OES and width or height is not zero or cannot be 1925bd8deadSopenharmony_ci represented as 2^n for some integer value of n. 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ciNew State 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci None 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ciNew Implementation Dependent State 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci None 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ciRevision History 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci Date 02/24/2011 2055bd8deadSopenharmony_ci Revision: 1.3 (Benj) 2065bd8deadSopenharmony_ci - remove interaction with OES_framebuffer_object relaxing GenerateMipmap 2075bd8deadSopenharmony_ci POT base level requirements, since it doesn't make sense to generate 2085bd8deadSopenharmony_ci mipmaps when mipmapping is disallowed for NPOT textures 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci Date 06/23/2009 2115bd8deadSopenharmony_ci Revision: 1.2 (Jon Leech) 2125bd8deadSopenharmony_ci - Assign extension number 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci Date 04/20/2009 2155bd8deadSopenharmony_ci Revision: 1.2 2165bd8deadSopenharmony_ci - add interaction with OES_framebuffer_object relaxing GenerateMipmap 2175bd8deadSopenharmony_ci POT base level requirements 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci Date 04/16/2009 2205bd8deadSopenharmony_ci Revision: 1.1 2215bd8deadSopenharmony_ci - change wording to clarify that mirrored repeat wrap modes are also 2225bd8deadSopenharmony_ci not allowed in the absence of OES_texture_npot 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci Date 01/20/2009 2255bd8deadSopenharmony_ci Revision: 1.0 2265bd8deadSopenharmony_ci - draft proposal 227