1Name 2 3 SGIS_sharpen_texture 4 5Name Strings 6 7 GL_SGIS_sharpen_texture 8 9Version 10 11 $Date: 1995/07/09 06:48:51 $ $Revision: 1.16 $ 12 13Number 14 15 22 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 introduces texture magnification filters that sharpen 26 the resulting image by extrapolating from the level 1 image to the 27 level 0 image. Sharpening can be enabled for all color channels, for 28 the alpha channel only, or for the red, green, and blue channels only. 29 30New Procedures and Functions 31 32 void SharpenTexFuncSGIS(enum target, 33 sizei n, 34 const float* points); 35 36 void GetSharpenTexFuncSGIS(enum target, 37 float* points); 38 39New Tokens 40 41 Accepted by the <param> parameter of TexParameteri and TexParameterf, 42 and by the <params> parameter of TexParameteriv and TexParameterfv, when 43 their <pname> parameter is TEXTURE_MAG_FILTER: 44 45 LINEAR_SHARPEN_SGIS 46 LINEAR_SHARPEN_ALPHA_SGIS 47 LINEAR_SHARPEN_COLOR_SGIS 48 49 Accepted by the <pname> parameter of GetTexParameteriv and 50 GetTexParameterfv: 51 52 SHARPEN_TEXTURE_FUNC_POINTS_SGIS 53 54Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 55 56 None 57 58Additions to Chapter 3 of the 1.0 Specification (Rasterization) 59 60 GL Specification Table 3.7 is updated as follows: 61 62 Name Type Legal Values 63 ---- ---- ------------ 64 TEXTURE_WRAP_S integer CLAMP, REPEAT 65 TEXTURE_WRAP_T integer CLAMP, REPEAT 66 TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT 67 TEXTURE_MIN_FILTER integer NEAREST, LINEAR, 68 NEAREST_MIPMAP_NEAREST, 69 NEAREST_MIPMAP_LINEAR, 70 LINEAR_MIPMAP_NEAREST, 71 LINEAR_MIPMAP_LINEAR, 72 FILTER4_SGIS 73 TEXTURE_MAG_FILTER integer NEAREST, LINEAR, 74 FILTER4_SGIS, 75 LINEAR_DETAIL_SGIS, 76 LINEAR_DETAIL_ALPHA_SGIS, 77 LINEAR_DETAIL_COLOR_SGIS, 78 LINEAR_SHARPEN_SGIS, 79 LINEAR_SHARPEN_ALPHA_SGIS, 80 LINEAR_SHARPEN_COLOR_SGIS 81 TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1] 82 DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer 83 DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE 84 85 Table 3.7: Texture parameters and their values. 86 87 3.8.2.2 Texture magnification with sharpening 88 89 Three additional texture magnification filters are defined for texture 90 magnification. These values, which are assigned to TEXTURE_MAG_FILTER, 91 are LINEAR_SHARPEN_SGIS, LINEAR_SHARPEN_ALPHA_SGIS, and 92 LINEAR_SHARPEN_COLOR_SGIS. All three filters sample the level 0 93 texture array exactly as it would be sampled with filter mode LINEAR. 94 If texture levels 0 and 1 are "complete", as described in the Mipmapping 95 portion of Section 3.8.1 (Texture Minification) of the GL Specification, 96 the level 1 array of the texture is also linearly sampled, just as though 97 mipmap minification was being performed with LOD (the level of detail 98 parameter) valued near 1.0. If levels 0 and 1 are not complete, it is 99 as though the magnification texture filter was LINEAR. (Although 100 querying the magnification filter value will return the value as 101 specified.) 102 103 The texture value computed from the level 0 array (T0) and the 104 value computed from the level one array (T1) are combined to compute 105 the final texture value (T): 106 107 T' = ((1 + F(LOD)) * T0) - (F(LOD) * T1) 108 109 / 0 T' < 0 110 T = < T' 0 <= T' <= 1 111 \ 1 T' > 1 112 113 F is a function of the level-of-detail parameter LOD, which is 114 represented by the Greek character lambda in the GL Specification. 115 116 The function F of level-of-detail parameter LOD is specified by 117 calling SharpenTexFuncSGIS with <target> set to TEXTURE_1D, TEXTURE_2D, 118 or TEXTURE_3D_EXT, <points> pointing at an array of pairs of floating 119 point values, and <n> set to the number of value pairs in <points>. The 120 first value of each value pair in <points> specifies a value of LOD, and 121 the second value of each value pair specifies the corresponding function 122 value. The order in which the points are specified is not significant. 123 The <n> value pairs in <points> completely specify the function, 124 replacing any previous specification that may have existed. Since 125 negative values of LOD correspond to magnification and positive values 126 correspond to minification, the points should have negative values for 127 LOD (though it is not an error to specify positive values). 128 129 Function F is evaluated by sorting the value pairs specified by 130 SharpenTexFuncSGIS by LOD value, then fitting a curve through these 131 points. This curve may be linear between adjacent points, or it may be 132 smoothed, but it will pass exactly through the points, limited only by 133 the resolution of the implementation. The value pair with the lowest 134 LOD value specifies the function value F for all values of LOD less than 135 or equal to that pair's LOD. Likewise, the value pair with the greatest 136 LOD value specifies the function value F for all values of LOD greater 137 than or equal to that pair's LOD. F is undefined if two or more value 138 pairs have the same LOD value. 139 140 If the texture magnification filter is LINEAR_SHARPEN_SGIS, then both 141 the color and the alpha components of T are computed as described 142 in the equations above. If the filter is LINEAR_SHARPEN_COLOR_SGIS, 143 then all components of T other than alpha are computed as described 144 above, and the alpha component of T is computed as if the texture 145 magnification filter were LINEAR. Finally, if the filter is 146 LINEAR_SHARPEN_ALPHA_SGIS, the alpha component of T is computed as 147 described in the equations above, and all other components of T 148 are computed as if the texture magnification filter were LINEAR. 149 150 Minification vs. Magnification 151 ------------------------------ 152 153 If the magnification filter is given by LINEAR_SHARPEN_SGIS, 154 LINEAR_SHARPEN_ALPHA_SGIS, or LINEAR_SHARPEN_COLOR_SGIS, and the 155 minification filter is given by NEAREST_MIPMAP_NEAREST or 156 LINEAR_MIPMAP_NEAREST, then c = 0.5. The parameter c is used to 157 determine whether minification or magnification filtering is done, 158 as described in Section 3.8.2 of the GL Specification (Texture 159 Magnification). 160 161Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 162and the Framebuffer) 163 164 None 165 166Additions to Chapter 5 of the 1.0 Specification (Special Functions) 167 168 GetSharpenTexFuncSGIS is not included in display lists. 169 170Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 171 172 The number of points in the sharpen texture function specification of 173 a texture is queried by calling GetTexParameteriv or GetTexParameterfv 174 with <target> set to the target of the desired texture and <pname> set 175 to SHARPEN_TEXTURE_FUNC_POINTS_SGIS. The function 176 GetSharpenTexFuncSGIS returns in <points> all of the points in the 177 sharpen texture function of texture <target>. 178 179Additions to the GLX Specification 180 181 None 182 183GLX Protocol 184 185 Two new GLX protocol commands are added. 186 187 SharpenTexFuncSGIS 188 2 12+4*2*n rendering command length 189 2 2052 rendering command opcode 190 4 ENUM target 191 4 INT32 n 192 4*2*n LISTofFLOAT points 193 194 GetSharpenTexFuncSGIS 195 1 CARD8 opcode (X assigned) 196 1 17 GLX opcode (glXVendorPrivateWithReply) 197 2 4 request length 198 4 4097 vendor specific opcode 199 4 GLX_CONTEXT_TAG context tag 200 4 ENUM target 201 => 202 1 1 reply 203 1 unused 204 2 CARD16 sequence number 205 4 n reply length, m = n 206 4 unused 207 4 CARD32 n 208 16 unused 209 n*4 LISTofFLOAT32 points 210 211 Note that n may be zero, indicating that a GL error occurred. 212 Other n must be even and n >= 2. 213 214Dependencies on EXT_texture 215 216 EXT_texture is required. 217 218Dependencies on EXT_texture3D 219 220 If EXT_texture3D is not implemented, references in this specification 221 to TEXTURE_3D_EXT are invalid, and should be ignored. 222 223Dependencies on EXT_texture_object 224 225 If EXT_texture_object is implemented, the state values named 226 227 SHARPEN_TEXTURE_FUNC_POINTS_SGIS 228 <SHARPEN_TEXTURE_FUNC> 229 230 are added to the state vector of each texture object. When an attribute 231 set that includes texture information is popped, the bindings and 232 enables are first restored to their pushed values, then the bound 233 textures have their sharpen parameters restored to their pushed values. 234 235Errors 236 237 INVALID_ENUM is generated if SharpenTexFuncSGIS or 238 GetSharpenTexFuncSGIS parameter <target> is not TEXTURE_1D, TEXTURE_2D, 239 or TEXTURE_3D_EXT. 240 241 INVALID_VALUE is generated if SharpenTexFuncSGIS parameter <n> is 242 negative. 243 244 INVALID_OPERATION is generated if SharpenTexFuncSGIS or 245 GetSharpenTexFuncSGIS is executed between execution of Begin and the 246 corresponding execution to End. 247 248New State 249 250 Get Value Get Command Type Initial Value Attribute 251 --------- ----------- ---- ------------- --------- 252 SHARPEN_TEXTURE_FUNC_POINTS_SGIS GetTexParameteriv n x Z+ 2 texture 253 <SHARPEN_TEXTURE_FUNC> GetSharpenTexFuncSGIS n x m x R {0, 0}, {-4, 1} texture 254 255New Implementation Dependent State 256 257 None 258