How to downsample a texture?

How can I downsample a texture using FBOs?

  • 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.

  • Answer:

    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.

snape at Game Development Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.