1Name 2 3 APPLE_texture_2D_limited_npot 4 5Name Strings 6 7 GL_APPLE_texture_2D_limited_npot 8 9Contributors 10 11 Richard Schreyer 12 The many contributors to ARB_texture_non_power_of_two 13 14Contact 15 16 Benj Lipchak, Apple (lipchak 'at' apple.com) 17 18Status 19 20 Complete 21 22Version 23 24 Date: February 24, 2011 25 Revision: 1.3 26 27Number 28 29 OpenGL ES Extension #59 30 31Dependencies 32 33 OpenGL ES 1.0 is required. 34 35 Written based on the wording of the OpenGL ES 1.1 specification. 36 37 OES_texture_cube_map affects the definition of this extension. 38 39 OES_texture_3D affects the definition of this extension. 40 41 OES_texture_npot affects the definition of this extension. 42 43 OES_framebuffer_object affects the definition of this extension. 44 45Overview 46 47 Conventional OpenGL ES 1.X texturing is limited to images with 48 power-of-two (POT) dimensions. APPLE_texture_2D_limited_npot extension 49 relaxes these size restrictions for 2D textures. The restrictions remain 50 in place for cube map and 3D textures, if supported. 51 52 There is no additional procedural or enumerant API introduced by this 53 extension except that an implementation which exports the extension string 54 will allow an application to pass in 2D texture dimensions that may or may 55 not be a power of two. 56 57 In the absence of OES_texture_npot, which lifts these restrictions, neither 58 mipmapping nor wrap modes other than CLAMP_TO_EDGE are supported in 59 conjunction with NPOT 2D textures. A NPOT 2D texture with a wrap mode that 60 is not CLAMP_TO_EDGE or a minfilter that is not NEAREST or LINEAR is 61 considered incomplete. If such a texture is bound to a texture unit, it is 62 as if texture mapping were disabled for that texture unit. 63 64New Procedures and Functions 65 66 None 67 68New Tokens 69 70 None 71 72Additions to Chapter 2 of the GL Specification (OpenGL Operation) 73 74 None 75 76Additions to Chapter 3 of the GL Specification (Rasterization) 77 78 -- Section 3.7.1 "Texture Image Specification" 79 80 Replace the discussion of valid dimensions with: 81 82 "If w_s and h_s are the specified image width and height, and if w_s or h_s 83 is less than zero, then the error INVALID_VALUE is generated." 84 85 Replace the discussion of image decoding with: 86 87 "We shall refer to the decoded image as the texture array. A texture array 88 has width and height w_s and h_s as defined above." 89 90 Update Figure 3.8's caption: 91 92 "... This is a texture with w_t = 8 and h_t = 4. ..." 93 94 -- Section 3.7.7 "Texture Minification" 95 96 In the subsection "Scale Factor and Level of Detail"... 97 98 Replace the sentence defining the u and v functions with: 99 100 "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 101 equal to the width and height of the image array whose level is zero." 102 103 Replace 2^n and 2^m with w_s and h_s in Equations 3.16 and 3.17. 104 105 { floor(u), s < 1 106 i = { (3.16) 107 { w_s - 1, s = 1 108 109 { floor(v), t < 1 110 j = { (3.17) 111 { h_s - 1, t = 1 112 113 Replace 2^n and 2^m with w_s and h_s in the equations for computing i_0, 114 j_0, i_1, and j_1 used for LINEAR filtering. 115 116 { floor(u - 1/2) mod w_s, TEXTURE_WRAP_S is REPEAT 117 i_0 = { 118 { floor(u - 1/2), otherwise 119 120 { floor(v - 1/2) mod h_s, TEXTURE_WRAP_T is REPEAT 121 j_0 = { 122 { floor(v - 1/2), otherwise 123 124 { (i_0 + 1) mod w_s, TEXTURE_WRAP_S is REPEAT 125 i_1 = { 126 { i_0 + 1, otherwise 127 128 { (j_0 + 1) mod h_s, TEXTURE_WRAP_T is REPEAT 129 j_1 = { 130 { j_0 + 1, otherwise 131 132 In the subsection "Mipmapping"... 133 134 Insert paragraph after the second paragraph: 135 136 "If any dimension of any array in a mipmap is not a power of two (e.g. if 137 rounding down as described above is performed), then the mipmap is 138 described as a non-power-of-two texture. Non-power-of-two textures have 139 restrictions on the allowed texture wrap modes and filters, as described in 140 section 3.7.9." 141 142 -- Section 3.7.9 "Texture Completeness" 143 144 Rename to "Texture Completeness and Non-Power-Of-Two Textures" 145 146 Add a bullet item to the list of conditions for completeness: 147 148 "Each dimension of the zero level array is a power of two or both the 149 texture wrap mode is CLAMP_TO_EDGE and the minification filter is NEAREST 150 or LINEAR." 151 152Additions to Chapter 4 of the GL Specification (Per-Fragment Operations 153and the Framebuffer) 154 155 None 156 157Additions to Chapter 5 of the GL Specification (Special Functions) 158 159 None 160 161Additions to the GLX Specification 162 163 None 164 165Interactions with OES_texture_cube_map 166 167 If OES_texture_cube_map is supported, TexImage2D called with target 168 TEXTURE_CUBE_MAP will *not* accept non-power-of-two texture dimensions, and 169 will generate and INVALID_VALUE error. Otherwise omit all references to 170 cube map textures. 171 172Interactions with OES_texture_3D 173 174 If OES_texture_3D is supported, TexImage3D will *not* accept non-power-of- 175 two texture dimensions, and will generate and INVALID_VALUE error. 176 177Interactions with OES_texture_npot 178 179 If OES_texture_npot is supported, omit the restrictions on mipmapping and 180 REPEAT wrap modes which lead to texture incompleteness for 2D textures. 181 182GLX Protocol 183 184 None 185 186Errors 187 188 The following error is altered to allow NPOT dimensions for 2D textures: 189 190 INVALID_VALUE is generated by TexImage2D or glCopyTexImage2D if target is 191 TEXTURE_CUBE_MAP_OES and width or height is not zero or cannot be 192 represented as 2^n for some integer value of n. 193 194New State 195 196 None 197 198New Implementation Dependent State 199 200 None 201 202Revision History 203 204 Date 02/24/2011 205 Revision: 1.3 (Benj) 206 - remove interaction with OES_framebuffer_object relaxing GenerateMipmap 207 POT base level requirements, since it doesn't make sense to generate 208 mipmaps when mipmapping is disallowed for NPOT textures 209 210 Date 06/23/2009 211 Revision: 1.2 (Jon Leech) 212 - Assign extension number 213 214 Date 04/20/2009 215 Revision: 1.2 216 - add interaction with OES_framebuffer_object relaxing GenerateMipmap 217 POT base level requirements 218 219 Date 04/16/2009 220 Revision: 1.1 221 - change wording to clarify that mirrored repeat wrap modes are also 222 not allowed in the absence of OES_texture_npot 223 224 Date 01/20/2009 225 Revision: 1.0 226 - draft proposal 227