1Name 2 3 SGIX_texture_lod_bias 4 5Name Strings 6 7 GL_SGIX_texture_lod_bias 8 9Version 10 11 $Date: 1996/07/09 05:27:21 $ $Revision: 1.3 $ 12 13Number 14 15 84 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 23Overview 24 25 This extension modifies the calculation of texture level of detail 26 parameter LOD, which is represented by the Greek character lambda 27 in the GL Specification. The LOD equation assumes that a 2^n x 2^m x 2^l 28 texture is band limited at 2^(n-1), 2^(m-1), 2^(l-1). Often a texture is 29 oversampled or filtered such that the texture is band limited at lower 30 frequencies in one or more dimensions. The result is that texture-mapped 31 primitives appear excessively blurry. This extension provides biases 32 for n, m, and l in the LOD calculation to to compensate for under or over 33 sampled texture images. Mipmapped textures can be made to appear sharper or 34 blurrier by supplying a negative or positive bias respectively. 35 36 Examples of textures which can benefit from this LOD control include 37 video-capture images which are filtered differently horizontally and 38 vertically; a texture which appears blurry because it is mapped with 39 a nonuniform scale, such as a road texture which is repeated hundreds of 40 times in one dimension and only once in the other; and textures which 41 had to be magnified to a power-of-two for mipmapping. 42 43Issues 44 45 * Should "bias" be changed to "offset"? 46 47New Procedures and Functions 48 49 None 50 51New Tokens 52 53 Accepted by the <pname> parameter of TexParameteri, TexParameterf, 54 TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv: 55 56 TEXTURE_LOD_BIAS_S_SGIX 57 TEXTURE_LOD_BIAS_T_SGIX 58 TEXTURE_LOD_BIAS_R_SGIX 59 60Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 61 62 None 63 64Additions to Chapter 3 of the 1.0 Specification (Rasterization) 65 66 GL Specification Table 3.7 is updated as follows: 67 68 Name Type Legal Values 69 ---- ---- ------------ 70 TEXTURE_WRAP_S integer CLAMP, REPEAT 71 TEXTURE_WRAP_T integer CLAMP, REPEAT 72 TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT 73 TEXTURE_MIN_FILTER integer NEAREST, LINEAR, 74 NEAREST_MIPMAP_NEAREST, 75 NEAREST_MIPMAP_LINEAR, 76 LINEAR_MIPMAP_NEAREST, 77 LINEAR_MIPMAP_LINEAR, 78 FILTER4_SGIS 79 TEXTURE_MAG_FILTER integer NEAREST, LINEAR, 80 FILTER4_SGIS, 81 LINEAR_DETAIL_SGIS, 82 LINEAR_DETAIL_ALPHA_SGIS, 83 LINEAR_DETAIL_COLOR_SGIS, 84 LINEAR_SHARPEN_SGIS, 85 LINEAR_SHARPEN_ALPHA_SGIS, 86 LINEAR_SHARPEN_COLOR_SGIS 87 TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1] 88 DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer 89 DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE 90 TEXTURE_MIN_LOD_SGIS float any value 91 TEXTURE_MAX_LOD_SGIS float any value 92 TEXTURE_BASE_LEVEL_SGIS integer any non-negative integer 93 TEXTURE_MAX_LEVEL_SGIS integer any non-negative integer 94 TEXTURE_LOD_BIAS_S_SGIX float any value 95 TEXTURE_LOD_BIAS_T_SGIX float any value 96 TEXTURE_LOD_BIAS_R_SGIX float any value 97 98 Table 3.7: Texture parameters and their values. 99 100 Level of Detail Bias 101 ------------------------ 102 103 This extensions redefines the equations 3.8 and 3.9 for P in Section 3.8.1 104 (Texture Minification) of the GL Specification as follows: 105 106 P = max { sqrt((dlodu/dx)^2 + (dlodv/dx)^2 + (dlodw/dx)^2), 107 sqrt((dlodu/dy)^2 + (dlodv/dy)^2 + (dlodw/dy)^2) } (3.8) 108 109 where 110 dlodu/dx = 2^TEXTURE_LOD_BIAS_S_SGIX * du/dx 111 dlodv/dx = 2^TEXTURE_LOD_BIAS_T_SGIX * dv/dx 112 dlodw/dx = 2^TEXTURE_LOD_BIAS_R_SGIX * dw/dx 113 dlodu/dy = 2^TEXTURE_LOD_BIAS_S_SGIX * du/dy 114 dlodv/dy = 2^TEXTURE_LOD_BIAS_T_SGIX * dv/dy 115 dlodw/dy = 2^TEXTURE_LOD_BIAS_R_SGIX * dw/dy 116 117 For a line the equation is redefined as: 118 119 P = sqrt((dlodu/dx * deltaX + dlodu/dy * deltaY)^2 + 120 (dlodv/dx * deltaX + dlodv/dy * deltaY)^2 + 121 (dlodw/dx * deltaX + dlodw/dy * deltaY)^2) / l (3.9) 122 123 The conditions for f(x,y) in section 3.8.1 are similarly changed: 124 125 1. f(x,y) is continuous and monotonically increasing in each of |dlodu/dx|, 126 |dlodu/dy|, |dlodv/dx|, |dlodv/dy|, |dlodw/dx|, and |dlodw/dy|, 127 128 2. Let 129 Mu = max {|dlodu/dx|, |dlodu/dy|}, Mv = max {|dlodv/dx|, |dlodv/dy|}, 130 and Mw = max {|dlodw/dx|, |dlodw/dy|}. 131 132 Then max{Mu,Mv,Mw} <= f(x,y) < Mu + Mv + Mw. 133 134 By default TEXTURE_LOD_BIAS_S_SGIX, TEXTURE_LOD_BIAS_T_SGIX, and 135 TEXTURE_LOD_BIAS_R_SGIX are 0, so they do not interfere with the normal 136 operation of texture mapping. These values are respecified for a specific 137 texture by calling TexParameteri, TexParemeterf, TexParameteriv, or 138 TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or 139 TEXTURE_3D_EXT, <pname> set to one of the LOD Bias names, 140 and <param> set to (or <params> pointing to) the new value. 141 142Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 143and the Frame Buffer) 144 145 None 146 147Additions to Chapter 5 of the 1.0 Specification (Special Functions) 148 149 None 150 151Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 152 153 None 154 155Additions to the GLX Specification 156 157 None 158 159Dependencies on EXT_texture 160 161 EXT_texture is required. 162 163Dependencies on EXT_texture3D 164 165 If EXT_texture3D is not supported, references to 3D texture mapping and 166 to TEXTURE_3D_EXT in this document are invalid and should be ignored. 167 168Dependencies on EXT_texture_object 169 170 If EXT_texture_object is implemented, the state values named 171 172 TEXTURE_LOD_BIAS_S_SGIX float any value 173 TEXTURE_LOD_BIAS_T_SGIX float any value 174 TEXTURE_LOD_BIAS_R_SGIX float any value 175 176 are added to the state vector of each texture object. When an attribute 177 set that includes texture information is popped, the bindings and 178 enables are first restored to their pushed values, then the bound 179 textures have their LOD_BIAS parameters restored to their pushed 180 values. 181 182Errors 183 184 None 185 186New State 187 188 Initial 189 Get Value Get Command Type Value Attrib 190 --------- ----------- ---- ------- ------ 191 TEXTURE_LOD_BIAS_S_SGIX GetTexParameterfv n x R 0 texture 192 TEXTURE_LOD_BIAS_T_SGIX GetTexParameterfv n x R 0 texture 193 TEXTURE_LOD_BIAS_R_SGIX GetTexParameterfv n x R 0 texture 194 195New Implementation Dependent State 196 197 None 198