Search code examples
opengltextures

What's glGetTexParameterIiv and glGetTexParameterIuiv for?


As titled (mind the capital i, it's not glGetTextureParameteriv), I think they were useful in the old days to retrieve the border color as an integer, but I couldn't find any confirmation googling around.

Can anyone enlighten me?


Solution

  • You seem to be confusing the border color with the texture's border texels. Those aren't the same thing. Border texels are part of the texture's storage and represent texels that are considered outside of the texture's normal boundaries (and are used for filtering). The border color is a single color value which is part of the sampling data for a texture or sampler object, which can be used when attempting to fetch texels outside of the texture's normal boundaries.

    Border texels were deprecated in GL 3.0 and removed from GL 3.1+ (and were never part of OpenGL ES). The border color however remains a part of OpenGL.

    To answer your question, yes, the ParameterI functions exist solely for getting/setting border colors for textures with integer formats rather than float/normalized formats. The I here is not a type suffix; it, like glVertexAttribIPointer, refers to the fact that it is dealing with integer data rather than float/normalized data. That is, it's not about describing what the type of the function's parameters are; it describes what those values mean.