PDA

View Full Version : Generating MipMaps after glCopyTexImage2D( )



asafc
11-18-2009, 03:02 AM
I want to blur my scene by copying the color buffer to texture, bluring the texture and drawing it on quad.
I'm thinking to use one of the mipmap level (i.e. 2), in order to force the GPU to do linear magnification (on smaller copy of the texture) - and blur it.

(I know there are other ways to it (maybe even better), but I need to do it in this way)

My question is how I can generate mipmaps on texture that is in the GPU memory (after glCopyTexImage2D( )).

Dark Photon
11-18-2009, 05:11 AM
My question is how I can generate mipmaps on texture that is in the GPU memory
glGenerateMipmap().

There's also a GL_GENERATE_MIPMAP texture parameter you can set, but I'll let those that have actually researched this tell you which one is the right way.

Also, if ATI support is a concern, search the archives. Seems like there was some strangeness getting MIPmap gen to work on ATI within the last year.

DmitryM
11-18-2009, 06:40 AM
glGenerateMipmap() works for me on ATI without problems.
Though, I'm aware of numerous problems discussed on this forum.
It can be that latest drivers fix most of the issues happened before.

GL_GENERATE_MIPMAP is now deprecated (GL 3.1+), so you don't have much of a choice.

asafc
11-22-2009, 05:23 AM
It works!!!

thank's a lot