15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_texture_mirror_clamp
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_texture_mirror_clamp
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Walt Donovan
125bd8deadSopenharmony_ci    Dan Ginsburg
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContact
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciStatus
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Shipping as of May 2004 for GeForce6.
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciVersion
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Last Modified Date:  2004/05/17
255bd8deadSopenharmony_ci    Version:             4
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciNumber
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    298
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciIssues
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    How does EXT_texture_mirror_clamp extend ATI_texture_mirror_once?
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci        This EXT extension provides the two wrap modes that
365bd8deadSopenharmony_ci        ATI_texture_mirror_once adds but also adds a third new wrap mode
375bd8deadSopenharmony_ci        (GL_MIRROR_CLAMP_TO_BORDER_EXT).  This extension uses the same
385bd8deadSopenharmony_ci        enumerant values for the ATI_texture_mirror_once modes.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Why is the GL_MIRROR_CLAMP_TO_BORDER_EXT mode more interesting than
415bd8deadSopenharmony_ci    the two other modes?
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci        Rather than clamp to 100% of the edge of the texture
445bd8deadSopenharmony_ci        (GL_MIRROR_CLAMP_TO_EDGE_EXT) or to 50% of the edge and border
455bd8deadSopenharmony_ci        color (GL_MIRROR_CLAMP), it is preferable to clamp to 100%
465bd8deadSopenharmony_ci        of the border color (GL_MIRROR_CLAMP_TO_BORDER_EXT).  This
475bd8deadSopenharmony_ci        avoids "bleeding" at smaller mipmap levels.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci        Consider a texture that encodes a circular fall-off pattern such
505bd8deadSopenharmony_ci        as for a projected spotlight.  A circular pattern is bi-symmetric
515bd8deadSopenharmony_ci        so a "mirror clamp" wrap modes can reduce the memory footprint
525bd8deadSopenharmony_ci        of the texture by a fourth.  Far outside the spotlight pattern,
535bd8deadSopenharmony_ci        you'd like to sample 100% of the border color (typically black
545bd8deadSopenharmony_ci        for a spotlight texture).  The way to achieve this without any
555bd8deadSopenharmony_ci        bleeding of edge texels is with GL_MIRROR_CLAMP_TO_BORDER_EXT.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    Does this extension complete the orthogonality of the current five
585bd8deadSopenharmony_ci    OpenGL 1.5 wrap modes?
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci         Yes.  There are two ways for repetition to operate (repeated
615bd8deadSopenharmony_ci         & mirrored) and four ways for texture coordinate clamping to
625bd8deadSopenharmony_ci         operate (unclamped, clamp, clamp to edge, & clamp to border).
635bd8deadSopenharmony_ci         The complete table of all 8 modes looks like this:
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci                          Repeat            Mirror
665bd8deadSopenharmony_ci                         +----------------  ----------------------
675bd8deadSopenharmony_ci         Unclamped       | REPEAT           MIRRORED_REPEAT
685bd8deadSopenharmony_ci         Clamp           | CLAMP            MIRROR_CLAMP
695bd8deadSopenharmony_ci         Clamp to edge   | CLAMP_TO_EDGE    MIRROR_CLAMP_TO_EDGE
705bd8deadSopenharmony_ci         Clamp to border | CLAMP_TO_BORDER  MIRROR_CLAMP_TO_BORDER
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci         OpenGL 1.0 introduced REPEAT & CLAMP.
735bd8deadSopenharmony_ci         OpenGL 1.2 introduced CLAMP_TO_EDGE
745bd8deadSopenharmony_ci         OpenGL 1.3 introduced CLAMP_TO_BORDER
755bd8deadSopenharmony_ci         OpenGL 1.4 introduced MIRRORED_REPEAT
765bd8deadSopenharmony_ci         ATI_texture_mirror_once introduced MIRROR_CLAMP & MIRROR_CLAMP_TO_EDGE
775bd8deadSopenharmony_ci         EXT_texture_mirror_clamp introduces MIRROR_CLAMP_TO_BORDER
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    Do these three new wrap modes work with 1D, 2D, 3D, and cube map
805bd8deadSopenharmony_ci    texture targets?
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci         RESOLUTION: Yes.
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    Do these three new wrap modes work with ARB_texture_non_power_of_two
855bd8deadSopenharmony_ci    functionality?
865bd8deadSopenharmony_ci    
875bd8deadSopenharmony_ci         RESOLUTION: Yes.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Do these three new wrap modes interact with NV_texture_rectangle?
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci         RESOLUTION:  Mirroring wrap modes are not supported by
925bd8deadSopenharmony_ci         GL_TEXTURE_RECTANGLE_NV textures.  Conventional mirroring is
935bd8deadSopenharmony_ci         already not supported for texture rectangles so supporting
945bd8deadSopenharmony_ci         clamped mirroring modes should not be supported either.
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    Does the specification of MIRROR_CLAMP_EXT & MIRROR_CLAMP_TO_EDGE_EXT
975bd8deadSopenharmony_ci    match the ATI_texture_mirror_once specification?
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci         I believe yes.  The ATI_texture_mirror_once specification is
1005bd8deadSopenharmony_ci         somewhat vague what happens to texture coordinates at or very
1015bd8deadSopenharmony_ci         near (within half a texel of) zero.  The presumption is that a
1025bd8deadSopenharmony_ci         CLAMP_TO_EDGE behavior is used.  This specification is quite
1035bd8deadSopenharmony_ci         explicit that values near zero are clamped to plus or minus
1045bd8deadSopenharmony_ci         1/(2*N) respectively so that the CLAMP_TO_EDGE behavior is
1055bd8deadSopenharmony_ci         explicit.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    What should this extension be called?
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci         Calling the extension EXT_texture_mirror_once might cause
1105bd8deadSopenharmony_ci         confusion since this extension has additional functionality.
1115bd8deadSopenharmony_ci         Also, "once" never appears in the specification.
1125bd8deadSopenharmony_ci         EXT_texture_mirror_clamp is a good name because it implies
1135bd8deadSopenharmony_ci         support for all the clamped versions of mirroring.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    There is GL_MIRRORED_REPEAT and then GL_MIRROR_CLAMP_EXT,
1165bd8deadSopenharmony_ci    GL_MIRROR_CLAMP_TO_EDGE_EXT, and GL_MIRROR_CLAMP_TO_BORDER_EXT.
1175bd8deadSopenharmony_ci    Why does the first enumerant name say "MIRRORED" while the other
1185bd8deadSopenharmony_ci    three say "MIRROR"?
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci         This extension follows the naming precedent set by the
1215bd8deadSopenharmony_ci         ATI_texture_mirror_once specification.
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci         Moreover, MIRRORED_REPEAT uses "mirrored" to help that the
1245bd8deadSopenharmony_ci         mirroring repeats infinitely.  For the other three modes,
1255bd8deadSopenharmony_ci         there is just one mirror that occurs and then a clamp.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ciDependencies
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 1.4.
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    Extends ATI_texture_mirror_once by adding
1325bd8deadSopenharmony_ci    GL_MIRROR_CLAMP_TO_BORDER_EXT.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    NV_texture_rectangle trivially affects the definition of this
1355bd8deadSopenharmony_ci    extension.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ciOverview
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    EXT_texture_mirror_clamp extends the set of texture wrap modes to
1405bd8deadSopenharmony_ci    include three modes (GL_MIRROR_CLAMP_EXT, GL_MIRROR_CLAMP_TO_EDGE_EXT,
1415bd8deadSopenharmony_ci    GL_MIRROR_CLAMP_TO_BORDER_EXT) that effectively use a texture map
1425bd8deadSopenharmony_ci    twice as large as the original image in which the additional half
1435bd8deadSopenharmony_ci    of the new image is a mirror image of the original image.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    This new mode relaxes the need to generate images whose opposite
1465bd8deadSopenharmony_ci    edges match by using the original image to generate a matching
1475bd8deadSopenharmony_ci    "mirror image".  This mode allows the texture to be mirrored only
1485bd8deadSopenharmony_ci    once in the negative s, t, and r directions.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciNew Procedure and Functions
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    None
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ciNew Tokens
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    Accepted by the <param> parameter of TexParameteri and TexParameterf,
1575bd8deadSopenharmony_ci    and by the <params> parameter of TexParameteriv and TexParameterfv,
1585bd8deadSopenharmony_ci    when their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T,
1595bd8deadSopenharmony_ci    or TEXTURE_WRAP_R:
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci      MIRROR_CLAMP_EXT                     0x8742 (same value as MIRROR_CLAMP_ATI)
1625bd8deadSopenharmony_ci      MIRROR_CLAMP_TO_EDGE_EXT             0x8743 (same value as MIRROR_CLAMP_TO_EDGE_ATI)
1635bd8deadSopenharmony_ci      MIRROR_CLAMP_TO_BORDER_EXT           0x8912
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (Operation)
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci    None
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ciAdditions to Chapter 3 if the OpenGL 1.2.1 Specification (Rasterization):
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci  - (3.8.4, page 136, as amended by the NV_texture_rectangle extension)
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    Add the 3 new wrap modes to the list of wrap modes unsupported for
1745bd8deadSopenharmony_ci    the TEXTURE_RECTANGLE_NV texture target.
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    "Certain texture parameter values may not be specified for textures
1775bd8deadSopenharmony_ci    with a target of TEXTURE_RECTANGLE_NV.  The error INVALID_ENUM
1785bd8deadSopenharmony_ci    is generated if the target is TEXTURE_RECTANGLE_NV and the
1795bd8deadSopenharmony_ci    TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R parameter is set to
1805bd8deadSopenharmony_ci    REPEAT, MIRRORED_REPEAT_IBM, MIRROR_CLAMP_EXT, MIRROR_CLAMP_TO_EDGE_EXT, and
1815bd8deadSopenharmony_ci    MIRROR_CLAMP_TO_BORDER_EXT.  The error INVALID_ENUM is generated
1825bd8deadSopenharmony_ci    if the target is TEXTURE_RECTANGLE_NV and the TEXTURE_MIN_FILTER is
1835bd8deadSopenharmony_ci    set to a value other than NEAREST or LINEAR (no mipmap filtering
1845bd8deadSopenharmony_ci    is permitted).  The error INVALID_ENUM is generated if the target
1855bd8deadSopenharmony_ci    is TEXTURE_RECTANGLE_NV and TEXTURE_BASE_LEVEL is set to any value
1865bd8deadSopenharmony_ci    other than zero."
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci  - Table 3.19, page 137: Change first three entries in table:
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    "TEXTURE_WRAP_S    integer     CLAMP, CLAMP_TO_BORDER, CLAMP_TO_EDGE,
1915bd8deadSopenharmony_ci                                   MIRRORED_REPEAT, MIRROR_CLAMP_EXT,
1925bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_BORDER_EXT,
1935bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_EDGE_EXT, REPEAT
1945bd8deadSopenharmony_ci    TEXTURE_WRAP_T     integer     CLAMP, CLAMP_TO_BORDER, CLAMP_TO_EDGE,
1955bd8deadSopenharmony_ci                                   MIRRORED_REPEAT, MIRROR_CLAMP_EXT,
1965bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_BORDER_EXT,
1975bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_EDGE_EXT, REPEAT
1985bd8deadSopenharmony_ci    TEXTURE_WRAP_R     integer     CLAMP, CLAMP_TO_BORDER, CLAMP_TO_EDGE,
1995bd8deadSopenharmony_ci                                   MIRRORED_REPEAT, MIRROR_CLAMP_EXT,
2005bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_BORDER_EXT,
2015bd8deadSopenharmony_ci                                   MIRROR_CLAMP_TO_EDGE_EXT, REPEAT"
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci  - (3.8.7, page 140) After the last paragraph of the section add:
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    "Wrap Mode MIRROR_CLAMP_EXT
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    Wrap mode MIRROR_CLAMP_EXT mirrors and clamps the texture coordinate,
2085bd8deadSopenharmony_ci    where mirroring and clamping a value f computes
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci      mirrorClamp(f) = min(1, max(1/(2*N), abs(f)))
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci    where N is the size of the one-, two-, or three-dimensional texture
2135bd8deadSopenharmony_ci    image in the direction of wrapping.
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    Wrap Mode MIRROR_CLAMP_TO_EDGE_EXT
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    Wrap mode MIRROR_CLAMP_TO_EDGE_EXT mirrors and clamps to edge the
2185bd8deadSopenharmony_ci    texture coordinate, where mirroring and clamping to edge a value f
2195bd8deadSopenharmony_ci    computes
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci      mirrorClampToEdge(f) = min(1-1/(2*N), max(1/(2*N), abs(f)))
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    where N is the size of the one-, two-, or three-dimensional texture
2245bd8deadSopenharmony_ci    image in the direction of wrapping.
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    Wrap Mode MIRROR_CLAMP_TO_BORDER_EXT
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    Wrap mode MIRROR_CLAMP_TO_BORDER_EXT mirrors and clamps to border the
2295bd8deadSopenharmony_ci    texture coordinate, where mirroring and clamping to border a value
2305bd8deadSopenharmony_ci    f computes
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci      mirrorClampToBorder(f) = min(1+1/(2*N), max(1/(2*N), abs(f)))
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    where N is the size of the one-, two-, or three-dimensional texture
2355bd8deadSopenharmony_ci    image in the direction of wrapping."
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci  - (3.8.8, page 142) Delete this phrase because it is out of date and
2385bd8deadSopenharmony_ci    unnecessary given the current way section 3.8.7 is written:
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci    "(if the wrap mode for a coordinate is CLAMP or CLAMP_TO_EDGE)"
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ciAdditions to Chapter 4:
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    None
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ciAdditions to Chapter 5:
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    None
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ciAdditions to Chapter 6:
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    None
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ciAdditions to the GLX Specification
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    None
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ciDependencies on NV_texture_rectangle
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    If NV_texture_rectangle is not supported, ignore the statement that
2615bd8deadSopenharmony_ci    the initial value for the S, T, and R wrap modes is CLAMP_TO_EDGE
2625bd8deadSopenharmony_ci    for rectangular textures.
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci    Ignore the error for a texture target of TEXTURE_RECTANGLE_NV.
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ciGLX Protocol
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci    None
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ciErrors
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    INVALID_ENUM is generated when TexParameter is called with
2735bd8deadSopenharmony_ci    a target of TEXTURE_RECTANGLE_NV and the TEXTURE_WRAP_S,
2745bd8deadSopenharmony_ci    TEXTURE_WRAP_T, or TEXTURE_WRAP_R parameter is set to REPEAT,
2755bd8deadSopenharmony_ci    MIRRORED_REPEAT_IBM, MIRROR_CLAMP_EXT, MIRROR_CLAMP_TO_EDGE_EXT,
2765bd8deadSopenharmony_ci    or MIRROR_CLAMP_TO_BORDER_EXT.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ciNew State
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    (table 6.15, p230) amend the following entries [Z5 changed to Z8]:
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci    Get Value       Type  Get Command      Initial Value    Description          Sec    Attribute
2835bd8deadSopenharmony_ci    --------------  ----  ---------------  ---------------  -------------------  -----  ---------
2845bd8deadSopenharmony_ci    TEXTURE_WRAP_S  n*Z8  GetTexParameter  REPEAT except    Texture wrap mode S  3.8.7  texture
2855bd8deadSopenharmony_ci                                           for rectangular
2865bd8deadSopenharmony_ci                                           which is
2875bd8deadSopenharmony_ci                                           CLAMP_TO_EDGE
2885bd8deadSopenharmony_ci    TEXTURE_WRAP_T  n*Z8  GetTexParameter  REPEAT except    Texture wrap mode T  3.8.7  texture
2895bd8deadSopenharmony_ci                                           for rectangular
2905bd8deadSopenharmony_ci                                           which is
2915bd8deadSopenharmony_ci                                           CLAMP_TO_EDGE
2925bd8deadSopenharmony_ci    TEXTURE_WRAP_R  n*Z8  GetTexParameter  REPEAT except    Texture wrap mode R  3.8.7  texture
2935bd8deadSopenharmony_ci                                           for rectangular
2945bd8deadSopenharmony_ci                                           which is
2955bd8deadSopenharmony_ci                                           CLAMP_TO_EDGE
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ciNew Implementation Dependent State
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci    None
300