201k views
1 vote
Which of these OpenGL texture wrapping options clamps the coordinates between 0 and 1, resulting in the higher coordinates becoming clamped to the edge and resulting in a stretched edge pattern?

a. GL_CLAMP_TO_BORDER
b. GL_MIRRORED_REPEAT
c. GL_REPEAT
d. GL_CLAMP TO_EDGE

1 Answer

4 votes

Final answer:

The OpenGL texture wrapping option that causes a stretched edge pattern by clamping coordinates between 0 and 1 is GL_CLAMP_TO_EDGE.

Step-by-step explanation:

The OpenGL texture wrapping option that clamps the coordinates between 0 and 1, which causes higher coordinates to become clamped to the edge, creating a stretched edge pattern, is GL_CLAMP_TO_EDGE. Unlike GL_REPEAT, which tiles the texture, or GL_MIRRORED_REPEAT, which mirrors the texture, GL_CLAMP_TO_EDGE will stretch the last pixel of the texture's edge over the rest of the surface if the texture coordinates fall outside the 0 to 1 range.

This is useful when you want the texture to fill a space without repeating or showing a border, giving the edges a stretched appearance.

User Rahul Garg
by
8.1k points