5

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?

Aberrant
  • 3,423
  • 1
  • 27
  • 38

1 Answers1

8

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).

Hexagon
  • 6,845
  • 2
  • 24
  • 16
  • 4
    Modern desktop OpenGL versions also don't support texture borders: they generate `GL_INVALID_VALUE` if `border!=0`. – Ruslan Mar 08 '19 at 18:45