PDA

View Full Version : glGenerateMipmapEXT vs. gluBuild2DMipmaps



dletozeun
02-10-2008, 08:10 AM
Hello,

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.

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

N.

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

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

Mazy
02-11-2008, 01: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.

Groovounet
02-11-2008, 05: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! ^_^

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