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

I am rendering a scene to FBO as my render target whose size is 8 times the size of the orignal screen in OpenGL. Now i wan to downsample the texture generated by FBO to the size of the screen so as to achieve spatial anti aliasing. How do i achieve the down sampling ? Please provide implementation details.
Note : If there is a better way of doing anti aliasing in FBOs please mention that too. I am trying to remove the aliasing in the image attached below.

enter image description here

share|improve this question
I feel sorry for your GPU – dcousens Nov 16 '11 at 2:34
How are you drawing the grid? – Nicol Bolas Nov 16 '11 at 8:27
@NicolBolas a texture for 1X1 sqaure block and then I am mapping it all over the grid. – snape Nov 16 '11 at 8:34

Since your render target is exactly 8 times the size of the screen, I'd just use glGenerateMipmap, after setting glTexParameteri(..., GL_TEXTURE_MAX_LEVEL, 3);. Then, just blit or whatever from mipmap level 3, and you're done.

But really, you're wasting a lot of performance by not using multisampling+aniso. Supersampling won't give you much that you won't get with multisampling and anisotropic filtering, and your rendering will be that much faster for it.

share|improve this answer
You could also replace blitting with simply drawing a textured sprite that covers the screen area exactly, that also works for non power of 2 scaling. – aaaaaaaaaaaa Nov 16 '11 at 11:14

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.