2

I have 2 questions on opengl Texture borders:

  1. I know how texture borders are present in 2D textures, ( a strip of 1 texel wide along X an Y dimension). May be in 3D textures it is a strip of 1 texel along X, Y , and Z dimension? But what about 1D texture? Is it a texel in the beginning, and another texel at the end of the 1D texture?

  2. Is current 'border' option deprecated in OpenGL? Because this link says it must be zero in glTexImage2D, while this link says it can be zero or 1. I remember using 1 on ogl 4.0 and I did not get invalid op error. I am confused.

viktorzeid
  • 1,521
  • 1
  • 22
  • 35

1 Answers1

4
  1. A 1D texture is only 1D, so there are only two border texels located at both ends of the strip.

  2. The MSDN page you are referring to documents the version of OpenGL that ships with Windows operating systems. This version is much older than the OpenGL 4.x version that the other link you provided is documenting. Explicit texture border texels and the corresponding GL_CLAMP wrapping mode have indeed been deprecated since OpenGL 3.0. You can however use the GL_TEXTURE_BORDER_COLOR texture parameter and the GL_CLAMP_TO_BORDER wrapping mode to have a constant color for the texture border.

user3146587
  • 4,250
  • 1
  • 16
  • 25
  • 3
    The ability to define a true border (for the purpose of the original `GL_CLAMP` texture wrap mode) around the texture is deprecated. You can, however, continue to set a constant border color using `GL_TEXTURE_BORDER_COLOR`. Neither that, nor `GL_CLAMP_TO_BORDER` are deprecated. – Andon M. Coleman Jan 25 '14 at 20:19