orokatu
orokatu

Reputation:

What does border mean in the glTexImage2D function?

What is the border value of glTexImage2D? It's either 0 or 1. Does it decide whether this texture will have a border or not?

Where is the border values set?

Upvotes: 5

Views: 4530

Answers (1)

Hexagon
Hexagon

Reputation: 6971

Yes, the border value indicates whether the texture would have a border or not.

The border's color is defined by a call to glTexParameter(), with the GL_TEXTURE_BORDER_COLOR parameter. By default, it is black.

Note that the border color is only used when the texture is mapped using clamping (GL_CLAMP and similar) - a border doesn't make sense for a repeating pattern, and when linear interpolation is used for the texture data (GL_LINEAR and similar).

Also note that a texture border is not supported in the OpenGL ES variants of OpenGL (for embedded systems).

Upvotes: 8

Related Questions