• Advertisement
Sign in to follow this  

GL_GENERATE_MIPMAP vs gluBuild2DMipmaps

This topic is 3960 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which one to use? What's the difference? gluBuild2DMipmaps(...) vs glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

Share this post


Link to post
Share on other sites
Advertisement
GL_GENERATE_MIPMAP is useful when you have dynamic textures. But the new GenerateMipmapEXT() is better to use than GL_GENERATE_MIPMAP.

gluBuild2DMipmaps() is done with your CPU vs. GPU like above to setup your mipmap chain.

If you just want to have mipmapped textures gluBuild2DMipmaps() is just fine.

Share this post


Link to post
Share on other sites
I there any way to confirm that mipmapping is working when GL_GENERATE_MIPMAP is used? I get different (fail) behavior between this and gluBuild2Dmipmaps as follows:
With the gluBuild2DMipmaps function, in a program where one of the textures is with non-power-of-two dimensions (program has with alpha blending if it matters), with a Release build that texture doesn't display. With GL_GENERATE_MIPMAP it does.

Share this post


Link to post
Share on other sites
gluBuild2DMipmaps is very slow (+ buggy)

if a texture is not power of 2 sized then gluBuild2DMipmaps will first resize it so it is, i assume thats where the problem lies somehow.

to artifically see if mipmapping is working draw the texture with a high texture_lod_bias
perhaps draw the texture on a fullscreen sized polygon
+ then with a keypress cycle through the mipmap levels

Share this post


Link to post
Share on other sites
If you want to use the GL_GENERATE_MIPMAP you don't use gluBuild2DMipmaps() you use glTexImage2D() and call the correct glTexParameteri() with true in it.

The above method works, and will automatically generate mipmaps for your dynamic textures for all levels above base level.

With GenerateMipmapEXT() it will generate all mipmaps above base also but when you choose to not the driver.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement