1Name 2 3 ARB_texture_mirror_clamp_to_edge 4 5Name Strings 6 7 GL_ARB_texture_mirror_clamp_to_edge 8 9Contact 10 11 Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com) 12 13Contributors 14 15 Contributors to ATI_texture_mirror_once 16 Contributors to EXT_texture_mirror_clamp 17 Ian Romanick, Intel 18 Members of the ARB working group 19 20Notice 21 22 Copyright (c) 2013 The Khronos Group Inc. Copyright terms at 23 http://www.khronos.org/registry/speccopyright.html 24 25Specification Update Policy 26 27 Khronos-approved extension specifications are updated in response to 28 issues and bugs prioritized by the Khronos OpenGL Working Group. For 29 extensions which have been promoted to a core Specification, fixes will 30 first appear in the latest version of that core Specification, and will 31 eventually be backported to the extension document. This policy is 32 described in more detail at 33 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 34 35Status 36 37 Complete. Approved by the ARB on June 3, 2013. 38 Ratified by the Khronos Board of Promoters on July 19, 2013. 39 40Version 41 42 Last Modified Date: April 22, 2013 43 Revision 4 44 45Number 46 47 ARB Extension #149 48 49Dependencies 50 51 OpenGL 1.4 is required. 52 53 This extension is written against the OpenGL 4.3 (Core Profile) 54 Specification (October 18, 2012). 55 56 This extension interacts with EXT_texture3D. 57 58 This extension interacts with ARB_texture_rectangle. 59 60 This extension interacts with ARB_sampler_objects. 61 62Overview 63 64 ARB_texture_mirror_clamp_to_edge extends the set of texture wrap modes to 65 include an additional mode (GL_MIRROR_CLAMP_TO_EDGE) that effectively uses 66 a texture map twice as large as the original image in which the additional 67 half of the new image is a mirror image of the original image. 68 69 This new mode relaxes the need to generate images whose opposite edges 70 match by using the original image to generate a matching "mirror image". 71 This mode allows the texture to be mirrored only once in the negative 72 s, t, and r directions. 73 74New Procedure and Functions 75 76 None 77 78New Tokens 79 80 Accepted by the <param> parameter of TexParameter{if}, SamplerParameter{if} 81 and SamplerParameter{if}v, and by the <params> parameter of 82 TexParameter{if}v, TexParameterI{i ui}v and SamplerParameterI{i ui}v when 83 their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or 84 TEXTURE_WRAP_R: 85 86 MIRROR_CLAMP_TO_EDGE 0x8743 (same value as MIRROR_CLAMP_TO_EDGE_ATI/EXT) 87 88Additions to Chapter 8 if the OpenGL 4.3 (Core Profile) Specification 89(Textures and Samplers) 90 91 In section 8.2 (Sampler Objects) modify the second sentence of the 92 sixth paragraph (reading "For example, if..") to read as follows: 93 94 "For example, if TEXTURE_WRAP_S or TEXTURE_WRAP_T is set to REPEAT, 95 MIRRORED_REPEAT, or MIRROR_CLAMP_TO_EDGE on the sampler object bound 96 to a texture unit and the texture bond to that unit is a rectangle 97 texture, the texture will be considered incomplete." 98 99 In section 8.10 (Texture Parameters) modify the table entries for Table 8.16 100 (Texture parameters and their values) for TEXTURE_WRAP_S, TEXTURE_WRAP_T, 101 and TEXTURE_WRAP_R and add the following to the "Legal Values" column: 102 103 Name Type Legal Values 104 --------------- ---- ------------ 105 TEXTURE_WRAP_S enum (.. as before) 106 MIRROR_CLAMP_TO_EDGE 107 TEXTURE_WRAP_T enum (.. as before) 108 MIRROR_CLAMP_TO_EDGE 109 TEXTURE_WRAP_R enum (.. as before) 110 MIRROR_CLAMP_TO_EDGE 111 112 In section 8.14.2 (Coordinate Wrapping and Texel Selection) add the 113 following row to Table 8.19 (Texel location wrap mode application): 114 115 Wrap mode Result of wrap(coord) 116 --------- --------------------- 117 (previous entries..) 118 MIRROR_CLAMP_TO_EDGE min(1-1/(2*size), max(1/(2*size), abs(coord))) 119 120Additions to the GLX Specification 121 122 None 123 124GLX Protocol 125 126 None 127 128Errors 129 130 The error INVALID_ENUM is generated when TexParameter* is called 131 with a target of TEXTURE_RECTANGLE and the TEXTURE_WRAP_S, 132 TEXTURE_WRAP_T, or TEXTURE_WRAP_R parameter is set to REPEAT, 133 MIRRORED_REPEAT, or MIRROR_CLAMP_TO_EDGE. 134 135Dependencies on EXT_texture3D or equivalent 136 137 If EXT_texture3D or equivalent functionality is not implemented, 138 then the references to clamping of 3D textures in this file are 139 invalid, and references to TEXTURE_WRAP_R should be ignored. 140 141Dependencies on ARB_texture_rectangle or equivalent 142 143 If ARB_texture_rectangle or equivalent functionality is not 144 implemented, then ignore all references to rectangle textures. 145 146Dependencies on ARB_sampler_objects or equivalent 147 148 If ARB_sampler_objects or equivalent functionality is not supported, 149 then ignore all references to sampler objects and SamplerParameter* 150 functions. 151 152New State 153 154 Only the type information changes for these parameters: 155 156 Update Table 23.14 (Textures - state per texture object) 157 Get Value Get Command Type Initial Value (...) 158 --------- ----------- ---- ------------- 159 TEXTURE_WRAP_S GetTexParameter n x Z5 see sec 8.21 (...) 160 TEXTURE_WRAP_T GetTexParameter n x Z5 see sec 8.21 (...) 161 TEXTURE_WRAP_R GetTexParameter n x Z5 see sec 8.21 (...) 162 163 Update Table 23.18 (Textures - state per sampler object) 164 Get Value Get Command Type Initial Value (...) 165 --------- ----------- ---- ------------- 166 TEXTURE_WRAP_S GetSamplerParameteriv n x Z5 see sec 8.21 (...) 167 TEXTURE_WRAP_T GetSamplerParameteriv n x Z5 see sec 8.21 (...) 168 TEXTURE_WRAP_R GetSamplerParameteriv n x Z5 see sec 8.21 (...) 169 170New Implementation Dependent State 171 172 None 173 174Issues 175 176 1. Should we include MIRROR_CLAMP for compatibility profiles? 177 What about MIRROR_CLAMP_TO_BORDER? (And more importantly can all 178 vendors support it?) 179 180 RESOLVED. No. Some vendors stated that they can't support 181 MIRROR_CLAMP_TO_BORDER and MIRROR_CLAMP (although it's not clear if 182 they'd ever ship a compatibility profile with this extension), but 183 regardless we'll leave them out of this extension. 184 185Revision History 186 187 Revision 4, April 22, 2013 (Daniel Koch) 188 - fix interactions and remove ARB suffixes 189 Revision 3, April 21, 2013 (Daniel Koch) 190 - formatting, updates to Table 23.14 191 Revision 2, March 19, 2013 (Daniel Koch) 192 - remove MIRROR_CLAMP functionality and rename extension 193 Revision 1, January 20, 2013 (Daniel Koch) 194 - Initial ARB version based on ATI_texture_mirror_once and 195 EXT_texture_mirror_clamp. 196 Revision 0.9, January 3, 2013 (Ian Romanick) 197 - Add interactions with OpenGL contexts that have removed GL_CLAMP 198 and friends. 199