   Downsampling a Texture
  I want to downsample a texture, in my case textures from framebuffer objects, to 1/2 or 1/4 their size or even down to just 1x1. In theory, this should be easy by letting OpenGL trigger mip map generation for the texture, at least that's the info you find everywhere on the subject. However, I could not find specific information on how to implement it and I can't seem to get it to work :(.What I do is this:• bind the texture• call glGenerateMipmap()• bind an fbo with e.g. a 1x1 sized texture• resize the viewport to 1x1• create an ortho projection with a 1x1 size• render the texture on to a screen sized quadThe fbo texture should now contain the 1x1 version of the original texture, or not? However, I always only seem to get downsampled versions without interpolation. I.e. in case of the 1x1 texture, only the fragment in the center of the original image. Or in case of the 1/4 sized version, I see flickering.What am I doing wrong here? What did I misunderstand?   
  You have to downsample in steps. IE you will see any example that downsamples going 1/2 width/height each time.When you take a 512x512 texture and say draw it in a 1x1, its just calculating what pixel in the 512x512 map should go there. Keyword what "pixel". Your wanting it to take all 512x512 pixels and "blend" them into 1 pixel. So when you downsample by 1/2 size each time, openGL will already blend the nearest 2 pixels together. Make sure glTexParameter has GL_LINEAR inside of it.glGenerateMipmap should take the highest level and downsample already for you.   