15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_texture_border_clamp 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_texture_border_clamp 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Jussi Rasanen, NVIDIA 125bd8deadSopenharmony_ci Greg Roth, NVIDIA 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContact 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Greg Roth, NVIDIA (groth 'at' nvidia 'dot' com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Date: Aug 24, 2012 255bd8deadSopenharmony_ci Revision: 2 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL ES Extension #149 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci OpenGL ES 2.0 is required. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci This extension is written against the OpenGL ES 2.0.25 365bd8deadSopenharmony_ci specification. 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci OES_texture_3D affects the definition of this extension. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciOverview 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci OpenGL ES provides only a single clamping wrap mode: CLAMP_TO_EDGE. 435bd8deadSopenharmony_ci However, the ability to clamp to a constant border color can be 445bd8deadSopenharmony_ci useful to quickly detect texture coordinates that exceed their 455bd8deadSopenharmony_ci expected limits or to dummy out any such accesses with transparency 465bd8deadSopenharmony_ci or a neutral color in tiling or light maps. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension defines an additional texture clamping algorithm. 495bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV clamps texture coordinates at all mipmap levels 505bd8deadSopenharmony_ci such that NEAREST and LINEAR filters of clamped coordinates return 515bd8deadSopenharmony_ci only the constant border color. This does not add the ability for 525bd8deadSopenharmony_ci textures to specify borders using glTexImage2D, but only to clamp 535bd8deadSopenharmony_ci to a constant border value set using glTexParameter. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciNew Procedures and Functions 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci None. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ciNew Tokens 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci Accepted by the <pname> parameter of TexParameteri, TexParameterf, 625bd8deadSopenharmony_ci TexParameteriv, and TexParameterfv: 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci TEXTURE_BORDER_COLOR_NV 0x1004 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci Accepted by the <param> parameter of TexParameteri and 675bd8deadSopenharmony_ci TexParameterf, and by the <params> parameter of TexParameteriv and 685bd8deadSopenharmony_ci TexParameterfv, and returned by the <params> parameter of 695bd8deadSopenharmony_ci GetTexParameteriv and GetTexParameterfv when their <pname> parameter 705bd8deadSopenharmony_ci is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R_OES: 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV 0x812D 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0.25 Specification 755bd8deadSopenharmony_ci(Rasterization) 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci Modify Section 3.7.4 "Texture Parameters" 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci Append to the end of the first paragraph: 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci If the values for TEXTURE_BORDER_COLOR_NV are specified as integers, 825bd8deadSopenharmony_ci they are converted to floating-point as described in section 2.1.2. 835bd8deadSopenharmony_ci Each of the four values set by TEXTURE_BORDER_COLOR_NV is clamped to 845bd8deadSopenharmony_ci lie in [0, 1]. 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci Modify Table 3.10, edit the following lines: 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci Name Type Legal Values 895bd8deadSopenharmony_ci ============== ======= ==================== 905bd8deadSopenharmony_ci TEXTURE_WRAP_S integer CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT, 915bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV 925bd8deadSopenharmony_ci TEXTURE_WRAP_T integer CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT, 935bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV 945bd8deadSopenharmony_ci TEXTURE_WRAP_R_OES integer CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT, 955bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci and add: 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci Name Type Legal Values 1005bd8deadSopenharmony_ci ============== ======= ==================== 1015bd8deadSopenharmony_ci TEXTURE_BORDER_COLOR_NV 4 floats any 4 values in {0,1} 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Modify Section 3.7.6 "Texture Wrap Modes" 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci Add after wrap mode CLAMP_TO_EDGE: 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Wrap Mode CLAMP_TO_BORDER_NV 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci CLAMP_TO_BORDER_NV clamps texture coordinates at all mipmaps such 1105bd8deadSopenharmony_ci that the texture filter always samples the constant border color for 1115bd8deadSopenharmony_ci fragments whose corresponding texture coordinate is sufficiently far 1125bd8deadSopenharmony_ci outside the range [0, 1]. The color returned when clamping is 1135bd8deadSopenharmony_ci derived only from the constant border color. 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci Texture coordinates are clamped to the range [min, max]. The minimum 1165bd8deadSopenharmony_ci value is defined as 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci min = -1 / 2N 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci where N is the size of the one-, two-, or three-dimensional texture 1215bd8deadSopenharmony_ci image in the direction of clamping. The maximum value is defined as 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci max = 1 - min 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci so that clamping is always symmetric about the [0,1] mapped range of 1265bd8deadSopenharmony_ci a texture coordinate. 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci Modify Section 3.7.7 "Texture Minification" 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci Add to the end of Subsection "Scale Factor and Level of Detail" 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci If any of the selected Tijk or Tij in the above equations refer to a 1335bd8deadSopenharmony_ci border texel with i < 0, j < 0, k < 0, i >= ws, j >= hs, or k >= ds, 1345bd8deadSopenharmony_ci then the border values defined by TEXTURE_BORDER_COLOR_NV are used 1355bd8deadSopenharmony_ci instead of the unspecified value or values. If the texture contains 1365bd8deadSopenharmony_ci color components, the values of TEXTURE_BORDER_COLOR_NV are 1375bd8deadSopenharmony_ci interpreted as an RGBA color to match the texture's internal format 1385bd8deadSopenharmony_ci in a manner consistent with table 3.8. If the texture contains depth 1395bd8deadSopenharmony_ci components, the first component of TEXTURE_BORDER_COLOR_NV is 1405bd8deadSopenharmony_ci interpreted as a depth value. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci Modify Section 3.7.12 "Texture state" 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci Modify the last two sentences of the section: 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci Next, there are the two sets of texture properties; each consists 1475bd8deadSopenharmony_ci of the selected minification and magnification filters, the wrap 1485bd8deadSopenharmony_ci modes for s, t, and r, and the TEXTURE_BORDER_COLOR_NV. In the 1495bd8deadSopenharmony_ci initial state, the value assigned to TEXTURE_MIN_FILTER is NEAREST_- 1505bd8deadSopenharmony_ci MIPMAP_LINEAR, and the value for TEXTURE_MAG_FILTER is LINEAR. s, t, 1515bd8deadSopenharmony_ci and r wrap modes are all set to REPEAT, and TEXTURE_BORDER_COLOR_NV 1525bd8deadSopenharmony_ci is (0,0,0,0). 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ciErrors 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci None. 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ciNew State 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Modify table 6.8: 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci Change the type information changes for these parameters. 1635bd8deadSopenharmony_ci Initial 1645bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 1655bd8deadSopenharmony_ci --------- ------ ----------- ------- ----------- ---- 1665bd8deadSopenharmony_ci TEXTURE_WRAP_S n x Z4 GetTexParameter REPEAT Texture wrap 3.7 1675bd8deadSopenharmony_ci TEXTURE_WRAP_T n x Z4 GetTexParameter REPEAT Texture wrap 3.7 1685bd8deadSopenharmony_ci TEXTURE_WRAP_R_OES n x Z4 GetTexParameter REPEAT Texture wrap 3.7 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Add the following parameter: 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 1735bd8deadSopenharmony_ci --------- ------ ----------- ------- ----------- ---- 1745bd8deadSopenharmony_ci TEXTURE_BORDER_COLOR_NV 2+ x C GetTexParameter 0,0,0,0 Texture border 3.7 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ciDependencies on OES_texture_3D 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci If OES_texture_3D is not supported, ignore all references to 1795bd8deadSopenharmony_ci three-dimensional textures and token TEXTURE_WRAP_R_OES as well 1805bd8deadSopenharmony_ci as any reference to r wrap modes. References to Tijk, k, and ds in 1815bd8deadSopenharmony_ci section 3.7.6 should also be removed. 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ciIssues 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci None 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ciRevision History 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci Rev. Date Author Changes 1905bd8deadSopenharmony_ci ---- -------- --------- ------------------------------------- 1915bd8deadSopenharmony_ci 4 04 Sep 2012 groth Restored langauge in 3.7.7 about texture borders 1925bd8deadSopenharmony_ci 3 29 Aug 2012 groth Minor copy edits. 1935bd8deadSopenharmony_ci 2 24 Aug 2012 groth Clarified constant color language and tex_3d dependency 1945bd8deadSopenharmony_ci 1 14 Aug 2012 groth Initial draft based off ARB_texture_border_clamp 1955bd8deadSopenharmony_ci 196