1Name 2 3 SGIS_texture_border_clamp 4 5Name Strings 6 7 GL_SGIS_texture_border_clamp 8 9Version 10 11 $Date: 1997/02/26 03:36:33 $ $Revision: 1.6 $ 12 13Number 14 15 36 16 17Dependencies 18 19 EXT_texture3D affects the definition of this extension 20 SGIS_texture_filter4 affects the definition of this extension 21 22Overview 23 24 The base OpenGL provides clamping such that the texture coordinates are 25 limited to exactly the range [0,1]. When a texture coordinate is 26 clamped using this algorithm, the texture sampling filter straddles the 27 edge of the texture image, taking 1/2 its sample values from within the 28 texture image, and the other 1/2 from the texture border. It is 29 sometimes desirable for a texture to be clamped to the border color, 30 rather than to an average of the border and edge colors. 31 32 This extension defines an additional texture clamping algorithm. 33 CLAMP_TO_BORDER_SGIS clamps texture coordinates at all mipmap levels 34 such that NEAREST and LINEAR filters return the color of the border 35 texels. When used with FILTER4 filters, the filter operation of 36 CLAMP_TO_BORDER_SGIS is defined but doesn't result in a nice 37 clamp-to-border color. 38 39Issues 40 41 * Is the arithmetic for FILTER4 filters correct? Is this the right 42 thing to do? 43 44New Procedures and Functions 45 46 None 47 48New Tokens 49 50 Accepted by the <param> parameter of TexParameteri and TexParameterf, 51 and by the <params> parameter of TexParameteriv and TexParameterfv, when 52 their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or 53 TEXTURE_WRAP_R_EXT: 54 55 CLAMP_TO_BORDER_SGIS 0x812D 56 57Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 58 59 None 60 61Additions to Chapter 3 of the 1.0 Specification (Rasterization) 62 63 GL Specification Table 3.7 is updated as follows: 64 65 Name Type Legal Values 66 ---- ---- ------------ 67 TEXTURE_WRAP_S integer CLAMP, REPEAT, 68 CLAMP_TO_EDGE_SGIS, 69 CLAMP_TO_BORDER_SGIS 70 TEXTURE_WRAP_T integer CLAMP, REPEAT, 71 CLAMP_TO_EDGE_SGIS, 72 CLAMP_TO_BORDER_SGIS 73 TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT, 74 CLAMP_TO_EDGE_SGIS, 75 CLAMP_TO_BORDER_SGIS 76 TEXTURE_MIN_FILTER integer NEAREST, LINEAR, 77 NEAREST_MIPMAP_NEAREST, 78 NEAREST_MIPMAP_LINEAR, 79 LINEAR_MIPMAP_NEAREST, 80 LINEAR_MIPMAP_LINEAR, 81 FILTER4_SGIS, 82 LINEAR_CLIPMAP_LINEAR_SGIX 83 TEXTURE_MAG_FILTER integer NEAREST, LINEAR, 84 FILTER4_SGIS, 85 LINEAR_DETAIL_SGIS, 86 LINEAR_DETAIL_ALPHA_SGIS, 87 LINEAR_DETAIL_COLOR_SGIS, 88 LINEAR_SHARPEN_SGIS, 89 LINEAR_SHARPEN_ALPHA_SGIS, 90 LINEAR_SHARPEN_COLOR_SGIS, 91 LINEAR_LEQUAL_R_SGIS, 92 LINEAR_GEQUAL_R_SGIS 93 TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1] 94 DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer 95 DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE 96 TEXTURE_MIN_LOD_SGIS float any value 97 TEXTURE_MAX_LOD_SGIS float any value 98 TEXTURE_BASE_LEVEL_SGIS integer any non-negative integer 99 TEXTURE_MAX_LEVEL_SGIS integer any non-negative integer 100 GENERATE_MIPMAP_SGIS boolean TRUE or FALSE 101 TEXTURE_CLIPMAP_OFFSET_SGIX 2 floats any 2 values 102 103 Table 3.7: Texture parameters and their values. 104 105 CLAMP_TO_BORDER_SGIS texture clamping is specified by calling 106 TexParameteri with <target> set to TEXTURE_1D, TEXTURE_2D, or 107 TEXTURE_3D_EXT, <pname> set to TEXTURE_WRAP_S, TEXTURE_WRAP_T, 108 or TEXTURE_WRAP_R_EXT, and <param> set to CLAMP_TO_BORDER_SGIS. 109 110 Let [min,max] be the range of a clamped texture coordinate, and let N 111 be the size of the 1D, 2D, or 3D texture image in the direction of 112 clamping. Then in all cases 113 114 max = 1 - min 115 116 because the clamping is always symmetric about the [0,1] mapped range of 117 a texture coordinate. When used with NEAREST or LINEAR filters, 118 CLAMP_TO_BORDER_SGIS defines a minimum clamping value of 119 120 min = -1 / 2*N 121 122 When used with CUBIC filters, CLAMP_TO_BORDER_SGIS defines a minimum 123 clamping value of 124 125 min = -3 / 2*N 126 127Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 128and the Framebuffer) 129 130 None 131 132Additions to Chapter 5 of the 1.0 Specification (Special Functions) 133 134 None 135 136Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 137 138 None 139 140Additions to the GLX Specification 141 142 None 143 144Dependencies on EXT_texture3D 145 146 If EXT_texture3D is not implemented, then the references clamping of 3D 147 textures in this file are invalid, and references to TEXTURE_WRAP_R_EXT 148 should be ignored. 149 150Dependencies on SGIS_texture_filter4 151 152 If SGIS_texture_filter4 is not implemented, then discussions about the 153 interaction of filter4 texture filters and the clamping function 154 described in this file are invalid, and should be ignored. 155 156Errors 157 158 None 159 160New State 161 162 Only the type information changes for these parameters: 163 164 Get Value Get Command Type Initial Value Attrib 165 --------- ----------- ---- ------------- ------ 166 TEXTURE_WRAP_S GetTexParameteriv n x Z4 REPEAT texture 167 TEXTURE_WRAP_T GetTexParameteriv n x Z4 REPEAT texture 168 TEXTURE_WRAP_R_EXT GetTexParameteriv n x Z4 REPEAT texture 169 170New Implementation Dependent State 171 172 None 173