Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
1  
I feel sorry for your GPU –  Daniel 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

1 Answer 1

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. –  eBusiness Nov 16 '11 at 11:14

Your Answer

 
discard

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.