1Name 2 3 ARB_texture_border_clamp 4 5Name Strings 6 7 GL_ARB_texture_border_clamp 8 9Contact 10 11 Patrick R. Brown, Intel Corporation (patrick.r.brown 'at' intel.com) 12 13Notice 14 15 Copyright (c) 2000-2013 The Khronos Group Inc. Copyright terms at 16 http://www.khronos.org/registry/speccopyright.html 17 18Specification Update Policy 19 20 Khronos-approved extension specifications are updated in response to 21 issues and bugs prioritized by the Khronos OpenGL Working Group. For 22 extensions which have been promoted to a core Specification, fixes will 23 first appear in the latest version of that core Specification, and will 24 eventually be backported to the extension document. This policy is 25 described in more detail at 26 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 27 28Status 29 30 Complete. Approved by the ARB, 20 June 2000 31 32Version 33 34 1.0, 22 June 2000 35 36Number 37 38 ARB Extension #13 39 40Dependencies 41 42 OpenGL 1.0 is required. 43 44 This extension is written against the OpenGL 1.2.1 Specification. 45 46 This extension is based on and intended to replace 47 GL_SGIS_texture_border_clamp. 48 49Overview 50 51 The base OpenGL provides clamping such that the texture coordinates are 52 limited to exactly the range [0,1]. When a texture coordinate is clamped 53 using this algorithm, the texture sampling filter straddles the edge of 54 the texture image, taking 1/2 its sample values from within the texture 55 image, and the other 1/2 from the texture border. It is sometimes 56 desirable for a texture to be clamped to the border color, rather than to 57 an average of the border and edge colors. 58 59 This extension defines an additional texture clamping algorithm. 60 CLAMP_TO_BORDER_ARB clamps texture coordinates at all mipmap levels such 61 that NEAREST and LINEAR filters return only the color of the border 62 texels. 63 64IP Status 65 66 No known IP issues. 67 68Issues 69 70 (1) Is this formulation correct for higher-order texture filters 71 (e.g., cubic or anisotropic filters)? 72 73 RESOLVED: No. A more appropriate formulation would clamp the texture 74 coordinates in texel space. 75 76New Procedures and Functions 77 78 None. 79 80New Tokens 81 82 Accepted by the <param> parameter of TexParameteri and TexParameterf, and 83 by the <params> parameter of TexParameteriv and TexParameterfv, when their 84 <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R: 85 86 CLAMP_TO_BORDER_ARB 0x812D 87 88Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 89 90 None. 91 92Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 93 94 Modify Table 3.17, p. 124, editing only the following lines: 95 96 Name Type Legal Values 97 ============== ======= ==================== 98 TEXTURE_WRAP_S integer CLAMP, CLAMP_TO_EDGE, REPEAT, 99 CLAMP_TO_BORDER_ARB 100 TEXTURE_WRAP_T integer CLAMP, CLAMP_TO_EDGE, REPEAT, 101 CLAMP_TO_BORDER_ARB 102 TEXTURE_WRAP_R integer CLAMP, CLAMP_TO_EDGE, REPEAT, 103 CLAMP_TO_BORDER_ARB 104 105 106 Modify Section 3.8.4, Texture Wrap Modes, p.124 107 108 (add at the end of the section, p. 125) 109 110 CLAMP_TO_BORDER_ARB clamps texture coordinates at all mipmaps such that 111 the texture filter always samples border texels for fragments whose 112 corresponding texture coordinate is sufficiently far outside the range 113 [0,1]. The color returned when clamping is derived only from the border 114 texels of the texture image, or from the constant border color if the 115 texture image does not have a border. 116 117 Texture coordinates are clamped to the range [min, max]. The minimum 118 value is defined as 119 120 min = -1 / 2N 121 122 where N is the size (not including borders) of the one-, two-, or 123 three-dimensional texture image in the direction of clamping. The maximum 124 value is defined as 125 126 max = 1 - min 127 128 so that clamping is always symmetric about the [0,1] mapped range of a 129 texture coordinate. 130 131Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 132Operations and the Frame Buffer) 133 134 None. 135 136Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 137 138 None. 139 140Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 141State Requests) 142 143 None. 144 145Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance) 146 147 None. 148 149Additions to the AGL/GLX/WGL Specifications 150 151 None. 152 153GLX Protocol 154 155 None. 156 157Errors 158 159 None. 160 161New State 162 163 Only the type information changes for these parameters. 164 165 (table 6.13, p. 203) 166 Initial 167 Get Value Type Get Command Value Description Sec. Attribute 168 --------- ---- ----------- ------- ----------- ---- --------- 169 TEXTURE_WRAP_S 3+ x Z4 GetTexParameter REPEAT Texture wrap 3.8 texture 170 TEXTURE_WRAP_T 3+ x Z4 GetTexParameter REPEAT Texture wrap 3.8 texture 171 TEXTURE_WRAP_R 3+ x Z4 GetTexParameter REPEAT Texture wrap 3.8 texture 172 173Revision History 174 175 1.0, 06/22/2000 prbrown1: Added issue w.r.t. higher order filters. 176 177 0.2, 05/23/2000 prbrown1: Removed dependency on SGIS_texture_filter4 178 per ARB guidelines. 179 180 0.1, 05/02/2000 prbrown1: Initial revision -- mostly stolen from 181 GL_SGIS_texture_border_clamp. 182 183