TexturesGL 1.0

glTexParameterfv

Sets a texture parameter that takes floats — mainly the border color.

Signature

void glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);

How it works

Same as glTexParameteri, for parameters whose value is one or more floats. The classic use is GL_TEXTURE_BORDER_COLOR together with GL_CLAMP_TO_BORDER: in shadow mapping a white border (depth 1.0) makes everything outside the shadow map count as lit.

Parameters

targetGLenum

Target of the bound texture.

pnameGLenum

Which parameter.

Common values

GL_TEXTURE_BORDER_COLOR
RGBA color returned outside the texture with GL_CLAMP_TO_BORDER (4 floats).
GL_TEXTURE_MAX_ANISOTROPY
Anisotropic filtering level, e.g. 16 (GL 4.6).
GL_TEXTURE_LOD_BIAS
Shifts mip selection sharper (negative) or blurrier.
paramsconst GLfloat *

Pointer to the value(s).

Example

example.cpp
1float border[] = { 1.0f, 1.0f, 1.0f, 1.0f };
2glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
3glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
4glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, border);
Official Khronos documentation