Learning openGL. GL_LINEAR

Hi, I am wondering about GL_LINEAR. The reference pages says “Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured.” I am wondering where the four comes from. what four texture elements?

After denormalising texture coordinates (multiplying by the texture size) and truncating (rounding downward) to the nearest integer you have integer texel indices (i,j). Linear filtering uses the four texels with indices (i,j), (i,j+1), (i+1,j) and (i+1,j+1).

This assumes a 2D texture. For a 1D texture it uses 2 texels, for a 3D texture it uses 8 texels (2×2×2).

So it uses those four texels to determine what colour that pixel would be?

Those four texels determine the texture colour for a given pixel. The actual pixel colour may involve other factors besides the texture colour, e.g. glTexEnv settings, vertex colours and/or lighting.

ok, so think I understand now. So when the texture coord needs to be mapped to the pixel, it would use the surrounding texels of that coord, (i,j), (i,j+1), (i+1,j) and (i+1,j+1), to determine the pixel tex colour. excluding the other factors you stated.