1 2Name 3 4 EXT_texture_lod_bias 5 6Name Strings 7 8 GL_EXT_texture_lod_bias 9 10Notice 11 12 Copyright NVIDIA Corporation, 1999, 2000. 13 14Contact 15 16 Mark Kilgard, NVIDIA (mjk 'at' nvidia.com) 17 18Status 19 20 Shipping since late 1999. 21 22 The texture LOD bias functionality in OpenGL 1.4 is based on this 23 extension though the OpenGL 1.4 functionality added the ability to 24 specify a second per-texture object bias term. The OpenGL 1.4 enum 25 values match the EXT enum values. 26 27Version 28 29 Last Modified Date: June 23, 2009 30 31Number 32 33 OpenGL Extension #186 34 OpenGL ES Extension #60 35 36Dependencies 37 38 Written based on the wording of the OpenGL 1.2 specification. 39 40 Affects ARB_multitexture. 41 42 Interacts with OpenGL ES 1.1. 43 44Overview 45 46 OpenGL computes a texture level-of-detail parameter, called lambda 47 in the GL specification, that determines which mipmap levels and 48 their relative mipmap weights for use in mipmapped texture filtering. 49 50 This extension provides a means to bias the lambda computation 51 by a constant (signed) value. This bias can provide a way to blur 52 or pseudo-sharpen OpenGL's standard texture filtering. 53 54 This blurring or pseudo-sharpening may be useful for special effects 55 (such as depth-of-field effects) or image processing techniques 56 (where the mipmap levels act as pre-downsampled image versions). 57 On some implementations, increasing the texture lod bias may improve 58 texture filtering performance (at the cost of texture bluriness). 59 60 The extension mimics functionality found in Direct3D. 61 62Issues 63 64 Should the texture LOD bias be settable per-texture object or 65 per-texture stage? 66 67 RESOLUTION: Per-texture stage. This matches the Direct3D 68 semantics for texture lod bias. Note that this differs from 69 the semantics of SGI's SGIX_texture_lod_bias extension that 70 has the biases per-texture object. 71 72 This also allows the same texture object to be used by two different 73 texture units for different blurring. This is useful for 74 extrapolating detail between various levels of detail in a 75 mipmapped texture. 76 77 For example, you can extrapolate texture detail with 78 ARB_multitexture and EXT_texture_env_combine by computing 79 80 (B0 - B2) * 2 + B2 81 82 where B0 is a non-biased texture (normal sharpness) and B2 is 83 the same texture but bias by 2 levels-of-detail (fairly blurry). 84 This has the effect of increasing the high-frequency information 85 in the texture. There are immediate Earth Sciences and medical 86 imaging applications for this technique. 87 88 Per-texture stage control of the LOD bias is also useful for 89 allowing an application to control overall texture bluriness. 90 This can be used in games to simulate disorientation (note that 91 only textures will blur, not edges). It can also be used to 92 globally control texturing performance. An application may be 93 able to sustain a constant frame rate by avoiding texture fetch 94 stalls by using slightly blurrier textures. 95 96 How does EXT_texture_lod_bias differ from SGIX_texture_lod bias? 97 98 EXT_texture_lod_bias adds a bias to lambda. The 99 SGIX_texture_lod_bias extension changes the computation of rho (the 100 log2 of which is lambda). The SGIX extension provides separate 101 biases in each texture dimension. The EXT extension does not 102 provide an "directionality" in the LOD control. 103 104 Does the texture lod bias occur before or after the TEXTURE_MAX_LOD 105 and TEXTURE_MIN_LOD clamping? 106 107 RESOLUTION: BEFORE. This allows the texture lod bias to still 108 be clamped within the max/min lod range. 109 110 Does anything special have to be said to keep the biased lambda value 111 from being less than zero or greater than the maximum number of 112 mipmap levels? 113 114 RESOLUTION: NO. The existing clamping in the specification 115 handles these situations. 116 117 The texture lod bias is specified to be a float. In practice, what 118 sort of range is assumed for the texture lod bias? 119 120 RESOLUTION: The MAX_TEXTURE_LOD_BIAS_EXT implementation constant 121 advertises the maximum absolute value of the supported texture 122 lod bias. The value is recommended to be at least the maximum 123 mipmap level supported by the implementation. 124 125 The texture lod bias is specified to be a float. In practice, what 126 sort of precision is assumed for the texture lod bias? 127 128 RESOLUTION; This is implementation dependent. Presumably, 129 hardware would implement the texture lod bias as a fractional bias 130 but the exact fractional precision supported is implementation 131 dependent. At least 4 fractional bits is recommended. 132 133New Procedures and Functions 134 135 None 136 137New Tokens 138 139 Accepted by the <target> parameters of GetTexEnvfv, GetTexEnviv, 140 TexEnvi, TexEnvf, Texenviv, and TexEnvfv: 141 142 TEXTURE_FILTER_CONTROL_EXT 0x8500 143 144 When the <target> parameter of GetTexEnvfv, GetTexEnviv, TexEnvi, 145 TexEnvf, TexEnviv, and TexEnvfv is TEXTURE_FILTER_CONTROL_EXT, then 146 the value of <pname> may be: 147 148 TEXTURE_LOD_BIAS_EXT 0x8501 149 150 Accepted by the <pname> parameters of GetBooleanv, GetIntegerv, 151 GetFloatv, and GetDoublev: 152 153 MAX_TEXTURE_LOD_BIAS_EXT 0x84FD 154 155Additions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 156 157 None 158 159Additions to Chapter 3 of the 1.2 Specification (Rasterization) 160 161 -- Section 3.8.5 "Texture Minification" 162 163 Change the first formula under "Scale Factor and Level of Detail" to read: 164 165 "The choice is governed by a scale factor p(x,y), the level of detail 166 parameter lambda(x,y), defined as 167 168 lambda'(x,y) = log2[p(x,y)] + lodBias 169 170 where lodBias is the texture unit's (signed) texture lod bias parameter 171 (as described in Section 3.8.9) clamped between the positive and negative 172 values of the implementation defined constant MAX_TEXTURE_LOD_BIAS_EXT." 173 174 -- Section 3.8.9 "Texture Environments and Texture Functions" 175 176 Change the first paragraph to read: 177 178 "The command 179 180 void TexEnv{if}(enum target, enum pname, T param); 181 void TexEnv{if}v(enum target, enum pname, T params); 182 183 sets parameters of the texture environment that specifies how texture 184 values are interepreted when texturing a fragment or sets per-texture 185 unit texture filtering parameters. The possible target parameters 186 are TEXTURE_ENV or TEXTURE_FILTER_CONTROL_EXT. ... When target is 187 TEXTURE_ENV, the possible environment parameters are TEXTURE_ENV_MODE 188 and TEXTURE_ENV_COLOR. ... When target is TEXTURE_FILTER_CONTROL_EXT, 189 the only possible texture filter parameter is TEXTURE_LOD_BIAS_EXT. 190 TEXTURE_LOD_BIAS_EXT is set to a signed floating point value that 191 is used to bias the level of detail parameter, lambda, as described 192 in Section 3.8.5." 193 194 Add a final paragraph at the end of the section: 195 196 "The state required for the per-texture unit filtering parameters 197 consists of one floating-point value." 198 199Additions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 200and the Frame Buffer) 201 202 None 203 204Additions to Chapter 5 of the 1.2 Specification (Special Functions) 205 206 None 207 208Additions to Chapter 6 of the 1.2 Specification (State and State Requests) 209 210 -- Section 6.1.3 "Texture Environments and Texture Functions" 211 212 Change the third sentence of the third paragraph to read: 213 214 "The env argument to GetTexEnv must be either TEXTURE_ENV or 215 TEXTURE_FILTER_CONTROL_EXT." 216 217Additions to the GLX Specification 218 219 None 220 221Dependencies on OpenGL ES 1.1 222 223 If the GL is OpenGL ES 1.1, omit reference to GetDoublev. 224 225Errors 226 227 INVALID_ENUM is generated when TexEnv is called with a <pname> of 228 TEXTURE_FILTER_CONTROL_EXT and the value of <param> or what is pointed to 229 by <params> is not TEXTURE_LOD_BIAS_EXT. 230 231New State 232 233(table 6.14, p204) add the entry: 234 235Get Value Type Get Command Initial Value Description Sec Attribute 236----------------------- ---- ----------- -------------- --------------- ----- --------- 237TEXTURE_LOD_BIAS_EXT R GetTexEnvfv 0.0 Biases texture 3.8.9 texture 238 level of detail 239 240(When ARB_multitexture is supported, the TEXTURE_LOD_BIAS_EXT state is per-texture unit.) 241 242New Implementation State 243 244(table 6.24, p214) add the following entries: 245 246Get Value Type Get Command Minimum Value Description Sec Attribute 247-------------------------- ---- ----------- ------------- ----------------- ------ -------------- 248MAX_TEXTURE_LOD_BIAS_EXT R+ GetFloatv 4.0 Maximum 3.8.9 - 249 absolute texture 250 lod bias 251 252Revision History 253 254 6/23/09 (Jon Leech) - assign OpenGL ES extension number. 255 256 4/29/09 (Benj Lipchak) - add interaction with OpenGL ES 1.1. 257 258 8/27/03 - updated status to mention OpenGL 1.4 functionality. 259 260 8/26/03 - fixed incorrect enum name (TEXTURE_FILTER_CONTROL_EXT is 261 correct) in the Errors section. 262 263 6/2/00 - add spec language to allow GetTexEnv to accept 264 TEXTURE_FILTER_CONTROL_EXT. 265 266