Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

  1. #1
    Member Regular Contributor
    Join Date
    May 2002
    Posts
    273

    why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    Well, nothing constructive in this post, I just would like to express my disappointment in fact that there is so low HW support for GL_MIRRORED_CLAMP modes. Actually, only ATI HW supports them (except mirrored clamp to border).

    This is mistery to me, since very similar (but less useful, IMO) mode, the GL_MIRRORED_REPEAT, had been promoted to ARB, and later to core GL (1.4).

    I sometimes use MIRRORED_REPEAT in situations where MIRRORED_CLAMP is needed (mostly in dependant reads techniques). This forces me to do tricks to hide the repetition of images. They are not always succesful.

    Obviously, I could emulate mirrored_clamp by using standard CLAMP mode + mirroring teximage manually + applying x*0.5+0.5 texcoord transformation. However:
    - this prevents me from using maximum texture resolution available for 1D lookup (when you have 8-bits precision only, every single bit is precious)
    - it may happen to be impossible to apply the scale & bias to the texcoords, because of limitations of the NV_texture_shaders.

    Just a bit frustrated

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    Yeah, MIRRORED_CLAMP ... and what about MIRRORED_REPEAT_TO_BORDER_CLAMP_TO_EDGE ?

    Basically the idea of CLAMP is computing texture coordinates always in the range [0,1] and the idea of MIRRORED_REPEAT is to define a new way of repeating outside the range [0,1].
    I can hardly imagine what MIRRORED_CLAMP corresponds to. Clamp to [0,2] or [-1,+1] with mirror ?

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    Do you mean, by Mirrored clamp, that the bilinear filtering at edges of a texture gets texels from the mirror edges? Since when does ATi hardware support this (and how do I use it)?

  4. #4
    Member Regular Contributor
    Join Date
    May 2002
    Posts
    273

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    GL_ATI_texture_mirror_once (Last Modified Date: 11/14/2000)
    New Tokens:
    - GL_MIRROR_CLAMP_ATI
    - GL_MIRROR_CLAMP_TO_EDGE_ATI

    IIRC, it was advertised as texture memory saviour, in case you used 3D light distance attenuation texture.

    Mirroring and clamping(bare, _to_edge, _to_border) are orthodonal.

    MIRROR_CLAMP is equivalent to MIRRORED_REPEAT without REPEATing beyond [-1,+1], and clamping instead.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    ROFL I guess I talked too fast.

    If it is an ATI-specific extension, why do you expect other vendors to support it ? If it is really useful, needless to say it will be promoted to ARB sooner or later.

  6. #6
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    The extension can be quite useful, unlike the mirrored_repeat, which I have yet to find a good use of.
    In my experience however, while mirror_once is sometimes useful it's never really neccesary either. And since noone except ATi seams to support it I have yet to use it in any of my demos since I can always just use a larger texture and do 0.5 * (texCoord + 1) and use normal clamp_to_edge. The mirror_once functionality if available in DX too, but I think only ATi supports it there too. To me this is a mystery, since if you already support clamp_to_edge and mirror_repeat I can't see how hard it can possibly be to support mirror_once too.

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

    Originally posted by Humus:
    The extension can be quite useful, unlike the mirrored_repeat, which I have yet to find a good use of.
    afair the "good use" is written in the spec
    Has anyone else been stuck on repeating textures because seams looked awful ?
    If you don't find a good use of MIRRORED_REPEAT I guess you have even less good use for REPEAT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •