Texture coordinates outside 0 to 1

Wrap mode playground

Texture coordinates are not required to stay inside the unit square — nothing stops you asking for s = 2.4. The wrap mode decides what the sampler hands back when you do. Drag the yellow rectangle past the edge of the texture and watch REPEAT tile, CLAMP smear the edge texel, and MIRRORED_REPEAT fold back on itself.

Texture coordinate space drag the rectangle
Drag to move · drag the corner to scale
the unit square, s and t from 0 to 1 coordinates your quad actually asks for
The quad as rendered

This is only the yellow rectangle above, stretched over the surface. Everything outside the unit square was invented by the wrap mode — none of it exists in the texture image.

The texture itself 64 × 64

Deliberately asymmetric, so a mirrored tile is obvious. (0,0) is at the lower left, as OpenGL expects.

s range requested
t range requested
Tiles covered
Probe: s,t → wrapped
hover the left panel
Coordinates also draggable above
0.00
0.00
1.00
1.00
The state you just set live

      

A note on the constant's name. The notes use GL_CLAMP, which is the original OpenGL 1.0 spelling and clamps to the texture's border colour. What almost everyone actually wants — and what this demo shows — is GL_CLAMP_TO_EDGE, which clamps to the nearest edge texel. In OpenGL ES and WebGL, GL_CLAMP was dropped altogether and GL_CLAMP_TO_EDGE is the only clamping mode. If your clamped texture comes out with an unexpected black or white fringe, this is why.