View Full Version : why no GL_MIRRORED_CLAMP[_TO_(EDGE|BORDER)] ?

04-03-2003, 04:58 AM
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 http://www.opengl.org/discussion_boards/ubb/wink.gif

04-03-2003, 07:01 AM

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 ?

04-03-2003, 07:20 AM
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)?

04-03-2003, 07:57 AM
GL_ATI_texture_mirror_once (Last Modified Date: 11/14/2000)
New Tokens:

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.

04-03-2003, 09:31 AM
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.

04-03-2003, 12:48 PM
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.

04-03-2003, 12:57 PM
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 http://www.opengl.org/discussion_boards/ubb/wink.gif
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 http://www.opengl.org/discussion_boards/ubb/smile.gif