Brain Dump

Texture Filtering

Tags
opengl

Texture coordinates are specified not on pixel resolution, but as a continuous floating point value. Texture filtering is how OpenGL resolves ambiguous pixel specifications while sampling. If you point to 0.5 and that's not right in the center of a pixel, which color do you use at that point?

KindMeaning
GL_NEARESTPick the nearest pixel at that point in the texture.
GL_LINEARInterpolates between the point and its surrounding pixels.

Filters can be declared independently for magnifying (zoom-in) and minifying (zoom-out) operations.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

Links to this note