Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

following my another question I have studied in the documentations that I should use this procedure :

Define the texture filter parameters. This will control what happens when a texture is scaled up or down.

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,filter);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,filter);  

where filter is:

  • GL_NEAREST specifies that point sampling is to be used when the texture map needs to be magnified or minified.
  • GL_LINEAR specifies that bilinear interpolation among the four nearest neighbors is to be used when the texture map needs to be magnified or minified.

but since my program is all about image processing and applying different filters on an image, I don't want to apply extra filters to the image. Is there any way to apply the textures without filtering?

share|improve this question
up vote 3 down vote accepted

GL_NEAREST is nearest neighbor, this is effectively no filtering.

share|improve this answer
thanks @MickLH but as you might know about image-processing in GL_NEAREST method the value of a pixel is replaced by the value of the nearest pixel to it. I mean is there anyway not to have these kinds of transformations on the image and show exactly what is extracted from the filtering algorithms used in my program – sepideh Aug 13 '13 at 5:39
Consider that the image has exactly one pixel per counting number (0,1,2,3), but texture coordinates can be rational numbers (1.1, 2.552). Nearest neighbor is simply rounding these texture coordinates (1,3), this is exactly no filtering. – MickLH Aug 13 '13 at 5:41
as per the spec "GL_NEAREST Returns the value of the texture element that is nearest (in Manhattan distance) to the specified texture coordinates." > "the value of the texture element" it doesn't do anything with the value, just returns it, see? – MickLH Aug 13 '13 at 5:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.