title: Efficient downsampling for post-processing effects in opengl 3.3
body: <p>I understand the idea behind the bloom/glow effect: we downsample the texture to keep our convolution kernels small.  Now that I am trying to implement it, I am not quite sure which road I should take.</p>
  
  <p>My first idea was to <strong>use <code>glGenerateMipMap</code></strong> to do the downsampling.  However, I cannot tell it to stop after, say, 4 steps.  It's a bit of a black box for me, and for all I know, it may generate 10 images to sample my screen from 1024*768 down to 1*1.  Maybe these last steps are cheap because everything is so small already, but maybe they are not.</p>
  
  <p>I googled around and found that many people were relying on FBOs rather than <code>glGenerateMipMap</code>.  I am familiar with FBOs since I use deferred lighting.  My second idea is to simply <strong>render a 'quad' with a linear sampler into a smaller texture</strong>.  I would do that four times in a row, halving width and height each time.  However, I found that <a href="https://stackoverflow.com/questions/15534815/glsl-330-down-sample-texture">some people preferred</a> using their <strong>own fragment shader for downsampling rather than relying on <code>GL_LINEAR</code></strong> and I wonder why; maybe it is faster?</p>
  
  <p>What would be a way to quickly downsample my full-screen texture 4 times in a row, keeping each version?  I have no need for fancy edge-preserving sampling algorithms as I am going to blur everything anyway.</p>