View Full Version : glGenerateMipmapEXT vs. gluBuild2DMipmaps

02-10-2008, 07:10 AM

Reading documentation about fbo, I have seen that we have to use the glGenerateMipmapEXT function in order to generate texture mipmap when it is rendered to with fbo.

My question is:
Is it possible to use glGenerateMipmapEXT instead of gluBuild2DMipmaps without fbo. I mean, for example can I do this with a texture created from a picture that I load from the hard drive and then, always use the glTexImage2D function (followed by glGenerateMipmapEXT when I need mipmap) ?

Thank you.

02-10-2008, 07:40 AM
Yes you can :)


Seth Hoffert
02-10-2008, 07:41 AM
It is possible to use glGenerateMipmapEXT on non-FBO textures, and in many cases it is even hardware accelerated.

02-10-2008, 08:05 AM
Cool! Thank you both for these fast answers.

02-11-2008, 12:02 AM
Just remember that gluBuild2DMipmaps always gives you 2^n sized textures independent of what size the source image has. Might be important of you try to load different sized textures on older cards.

02-11-2008, 04:54 AM
For my new engine I don't even use something else that glGenerateMipmapEXT to generate mipmaps. glTexParameter(GL_MIPMAPS_GENERATE) doesn't make lot of sens to me and make the code weird with custom mipmaps.

Enjoy glGenerateMipmapEXT! ^_^

02-12-2008, 08:10 AM
Ok thanks a lot!