source:
Suppose a picture of size 3 pixels x 3 pixels, which a zoom result to this :
Zoom on the 3x3 pictureTexture 'pixels' are called texels. A texel is associated with a color and correspond to a region on the UV system (texture coordinate system). Texels are represented in the following pictures.
The texture associated of this picture can be represented by the picture shown below. Texture texelsIn most cases, the uv coordinate read on the texture does not correspond to a texel center. It is generaly between two texels.
To determine the uv color, there are different ways :-
Pick up the the closest texel, and use its color (GL_NEAREST). This is equivalent to zooming on the picture.
-
Linear interpolation of the color between the two closest texels (GL_LINEAR)
GL_NEAREST & GL_LINEAR
Here is the result of these two methods :
Zoom on the original picture (4x4 pixels)GL_NEAREST vs GL_LINEAR