1Name 2 3 SGIS_texture_lod 4 5Name Strings 6 7 GL_SGIS_texture_lod 8 9Version 10 11 $Date: 1997/05/30 01:34:44 $ $Revision: 1.8 $ 12 13Number 14 15 24 16 17Dependencies 18 19 EXT_texture is required 20 EXT_texture3D affects the definition of this extension 21 EXT_texture_object affects the definition of this extension 22 SGI_detail_texture affects the definition of this extension 23 SGI_sharpen_texture affects the definition of this extension 24 25Overview 26 27 This extension imposes two constraints related to the texture level of 28 detail parameter LOD, which is represented by the Greek character lambda 29 in the GL Specification. One constraint clamps LOD to a specified 30 floating point range. The other limits the selection of mipmap image 31 arrays to a subset of the arrays that would otherwise be considered. 32 33 Together these constraints allow a large texture to be loaded and 34 used initially at low resolution, and to have its resolution raised 35 gradually as more resolution is desired or available. Image array 36 specification is necessarily integral, rather than continuous. By 37 providing separate, continuous clamping of the LOD parameter, it is 38 possible to avoid "popping" artifacts when higher resolution images 39 are provided. 40 41 Note: because the shape of the mipmap array is always determined by 42 the dimensions of the level 0 array, this array must be loaded for 43 mipmapping to be active. If the level 0 array is specified with a 44 null image pointer, however, no actual data transfer will take 45 place. And a sufficiently tuned implementation might not even 46 allocate space for a level 0 array so specified until true image 47 data were presented. 48 49Issues 50 51 * Should detail and sharpen texture operate when the level 0 image 52 is not being used? 53 54 A: Sharpen yes, detail no. 55 56 * Should the shape of the mipmap array be determined by the 57 dimensions of the level 0 array, regardless of the base level? 58 59 A: Yes, this is the better solution. Driving everything from 60 the base level breaks the proxy query process, and allows 61 mipmap arrays to be placed arbitrarily. The issues of 62 requiring a level 0 array are partially overcome by the use 63 of null-point loads, which avoid data transfer and, 64 potentially, data storage allocation. 65 66 * With the arithmetic as it is, a linear filter might access an 67 array past the limit specified by MAX_LEVEL or p. But the 68 results of this access are not significant, because the blend 69 will weight them as zero. 70 71New Procedures and Functions 72 73 None 74 75New Tokens 76 77 Accepted by the <pname> parameter of TexParameteri, TexParameterf, 78 TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv: 79 80 TEXTURE_MIN_LOD_SGIS 0x813A 81 TEXTURE_MAX_LOD_SGIS 0x813B 82 TEXTURE_BASE_LEVEL_SGIS 0x813C 83 TEXTURE_MAX_LEVEL_SGIS 0x813D 84 85Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 86 87 None 88 89Additions to Chapter 3 of the 1.0 Specification (Rasterization) 90 91 GL Specification Table 3.7 is updated as follows: 92 93 Name Type Legal Values 94 ---- ---- ------------ 95 TEXTURE_WRAP_S integer CLAMP, REPEAT 96 TEXTURE_WRAP_T integer CLAMP, REPEAT 97 TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT 98 TEXTURE_MIN_FILTER integer NEAREST, LINEAR, 99 NEAREST_MIPMAP_NEAREST, 100 NEAREST_MIPMAP_LINEAR, 101 LINEAR_MIPMAP_NEAREST, 102 LINEAR_MIPMAP_LINEAR, 103 FILTER4_SGIS 104 TEXTURE_MAG_FILTER integer NEAREST, LINEAR, 105 FILTER4_SGIS, 106 LINEAR_DETAIL_SGIS, 107 LINEAR_DETAIL_ALPHA_SGIS, 108 LINEAR_DETAIL_COLOR_SGIS, 109 LINEAR_SHARPEN_SGIS, 110 LINEAR_SHARPEN_ALPHA_SGIS, 111 LINEAR_SHARPEN_COLOR_SGIS 112 TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1] 113 DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer 114 DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE 115 TEXTURE_MIN_LOD_SGIS float any value 116 TEXTURE_MAX_LOD_SGIS float any value 117 TEXTURE_BASE_LEVEL_SGIS integer any non-negative integer 118 TEXTURE_MAX_LEVEL_SGIS integer any non-negative integer 119 120 Table 3.7: Texture parameters and their values. 121 122 Base Array 123 ---------- 124 125 Although it is not explicitly stated, it is the clear intention 126 of the OpenGL specification that texture minification filters 127 NEAREST and LINEAR, and all texture magnification filters, be 128 applied to image array zero. This extension introduces a 129 parameter, BASE_LEVEL, that explicitly specifies which array 130 level is used for these filter operations. Base level is specified 131 for a specific texture by calling TexParameteri, TexParameterf, 132 TexParameteriv, or TexParameterfv with <target> set to TEXTURE_1D, 133 TEXTURE_2D, or TEXTURE_3D_EXT, <pname> set to TEXTURE_BASE_LEVEL_SGIS, 134 and <param> set to (or <params> pointing to) the desired value. The 135 error INVALID_VALUE is generated if the specified BASE_LEVEL is 136 negative. 137 138 Level of Detail Clamping 139 ------------------------ 140 141 The level of detail parameter LOD is defined in the first paragraph 142 of Section 3.8.1 (Texture Minification) of the GL Specification, where 143 it is represented by the Greek character lambda. This extension 144 redefines the definition of LOD as follows: 145 146 LOD'(x,y) = log_base_2 (Q(x,y)) 147 148 149 / MAX_LOD LOD' > MAX_LOD 150 LOD = ( LOD' LOD' >= MIN_LOD and LOD' <= MAX_LOD 151 \ MIN_LOD LOD' < MIN_LOD 152 \ undefined MIN_LOD > MAX_LOD 153 154 The variable Q in this definition represents the Greek character rho, 155 as it is used in the OpenGL Specification. (Recall that Q is computed 156 based on the dimensions of the BASE_LEVEL image array.) MIN_LOD is the 157 value of the per-texture variable TEXTURE_MIN_LOD_SGIS, and MAX_LOD is 158 the value of the per-texture variable TEXTURE_MAX_LOD_SGIS. 159 160 Initially TEXTURE_MIN_LOD_SGIS and TEXTURE_MAX_LOD_SGIS are -1000 and 161 1000 respectively, so they do not interfere with the normal operation of 162 texture mapping. These values are respecified for a specific texture 163 by calling TexParameteri, TexParemeterf, TexParameteriv, or 164 TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or 165 TEXTURE_3D_EXT, <pname> set to TEXTURE_MIN_LOD_SGIS or 166 TEXTURE_MAX_LOD_SGIS, and <param> set to (or <params> pointing to) the 167 new value. It is not an error to specify a maximum LOD value that is 168 less than the minimum LOD value, but the resulting LOD values are 169 not defined. 170 171 LOD is clamped to the specified range prior to any use. Specifically, 172 the mipmap image array selection described in the Mipmapping Subsection 173 of the GL Specification is based on the clamped LOD value. Also, the 174 determination of whether the minification or magnification filter is 175 used is based on the clamped LOD. 176 177 Mipmap Completeness 178 ------------------- 179 180 The GL Specification describes a "complete" set of mipmap image arrays 181 as array levels 0 through p, where p is a well defined function of the 182 dimensions of the level 0 image. This extension modifies the notion 183 of completeness: instead of requiring that all arrays 0 through p 184 meet the requirements, only arrays 0 and arrays BASE_LEVEL through 185 MAX_LEVEL (or p, whichever is smaller) must meet these requirements. 186 The specification of BASE_LEVEL was described above. MAX_LEVEL is 187 specified by calling TexParameteri, TexParemeterf, TexParameteriv, or 188 TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or 189 TEXTURE_3D_EXT, <pname> set to TEXTURE_MAX_LEVEL_SGIS, and <param> set 190 to (or <params> pointing to) the desired value. The error 191 INVALID_VALUE is generated if the specified MAX_LEVEL is negative. 192 If MAX_LEVEL is smaller than BASE_LEVEL, or if BASE_LEVEL is greater 193 than p, the set of arrays is incomplete. 194 195 Array Selection 196 --------------- 197 198 Magnification and non-mipmapped minification are always performed 199 using only the BASE_LEVEL image array. If the minification filter 200 is one that requires mipmapping, one or two array levels are 201 selected using the equations in the table below, and the LOD value 202 is clamped to a maximum value that insures that no array beyond 203 the limits specified by MAX_LEVEL and p is accessed. 204 205 Minification Filter Maximum LOD Array level(s) 206 ------------------- ----------- -------------- 207 NEAREST_MIPMAP_NEAREST M + 0.4999 floor(B + 0.5) 208 LINEAR_MIPMAP_NEAREST M + 0.4999 floor(B + 0.5) 209 NEAREST_MIPMAP_LINEAR M floor(B), floor(B)+1 210 LINEAR_MIPMAP_LINEAR M floor(B), floor(B)+1 211 212 where: 213 214 M = min(MAX_LEVEL,p) - BASE_LEVEL 215 B = BASE_LEVEL + LOD 216 217 For NEAREST_MIPMAP_NEAREST and LINEAR_MIPMAP_NEAREST the specified 218 image array is filtered according to the rules for NEAREST or 219 LINEAR respectively. For NEAREST_MIPMAP_LINEAR and 220 LINEAR_MIPMAP_LINEAR both selected arrays are filtered according to 221 the rules for NEAREST or LINEAR, respectively. The resulting values 222 are then blended as described in the Mipmapping section of the 223 OpenGL specification. 224 225 Additional Filters 226 ------------------ 227 228 Sharpen filters (described in SGIS_sharpen_texture) operate on array 229 levels BASE_LEVEL and BASE_LEVEL+1. If the minimum of MAX_LEVEL and p 230 is not greater than BASE_LEVEL, then sharpen texture reverts to a 231 LINEAR magnification filter. Detail filters (described in 232 SGIS_detail_texture) operate only when BASE_LEVEL is zero. 233 234 Texture Capacity 235 ---------------- 236 237 In Section 3.8 the OpenGL specification states: 238 239 "In order to allow the client to meaningfully query the maximum 240 image array sizes that are supported, an implementation must not 241 allow an image array of level one or greater to be created if a 242 `complete' set of image arrays consistent with the requested 243 array could not be supported." 244 245 Given this extension's redefinition of completeness, the above 246 paragraph should be rewritten to indicate that all levels of the 247 `complete' set of arrays must be supportable. E.g. 248 249 "In order to allow the client to meaningfully query the maximum 250 image array sizes that are supported, an implementation must not 251 allow an image array of level one or greater to be created if a 252 `complete' set of image arrays (all levels 0 through p) consistent 253 with the requested array could not be supported." 254 255Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 256and the Frame Buffer) 257 258 None 259 260Additions to Chapter 5 of the 1.0 Specification (Special Functions) 261 262 None 263 264Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 265 266 None 267 268Additions to the GLX Specification 269 270 None 271 272Dependencies on EXT_texture 273 274 EXT_texture is required. 275 276Dependencies on EXT_texture3D 277 278 If EXT_texture3D is not supported, references to 3D texture mapping and 279 to TEXTURE_3D_EXT in this document are invalid and should be ignored. 280 281Dependencies on EXT_texture_object 282 283 If EXT_texture_object is implemented, the state values named 284 285 TEXTURE_MIN_LOD_SGIS 286 TEXTURE_MAX_LOD_SGIS 287 TEXTURE_BASE_LEVEL_SGIS 288 TEXTURE_MAX_LEVEL_SGIS 289 290 are added to the state vector of each texture object. When an attribute 291 set that includes texture information is popped, the bindings and 292 enables are first restored to their pushed values, then the bound 293 textures have their LOD and LEVEL parameters restored to their pushed 294 values. 295 296Dependencies on SGIS_detail_texture 297 298 If SGIS_detail_texture is not supported, references to detail texture 299 mapping in this document are invalid and should be ignored. 300 301Dependencies on SGIS_sharpen_texture 302 303 If SGIS_sharpen_texture is not supported, references to sharpen texture 304 mapping in this document are invalid and should be ignored. 305 306Errors 307 308 INVALID_VALUE is generated if an attempt is made to set 309 TEXTURE_BASE_LEVEL_SGIS or TEXTURE_MAX_LEVEL_SGIS to a negative value. 310 311New State 312 313 Initial 314 Get Value Get Command Type Value Attrib 315 --------- ----------- ---- ------- ------ 316 TEXTURE_MIN_LOD_SGIS GetTexParameterfv n x R -1000 texture 317 TEXTURE_MAX_LOD_SGIS GetTexParameterfv n x R 1000 texture 318 TEXTURE_BASE_LEVEL_SGIS GetTexParameteriv n x R 0 texture 319 TEXTURE_MAX_LEVEL_SGIS GetTexParameteriv n x R 1000 texture 320 321New Implementation Dependent State 322 323 None 324