View Full Version : Mipmap questions

11-10-2008, 03:46 AM
i would use gluBuild2DMipmaps to create my mipmap texture levels. I have some questions about it:

1) Is this function GPU accelerated? If no, can be the CPU a more efficient alternative?
2) If the mipmap is done by GPU how can transfer each level from the GPU to the CPU?


11-10-2008, 04:24 AM
1) No. Its built on CPU and uploaded to GPU.
2) glGetTexImage()

11-10-2008, 04:50 AM
1,2) Yes, it's right.
Now, suppose the texture is already into the graphics memory and i want to build the mipmap. Which is the best strategy? A fragment program or transfer it on the CPU and use the gluBuld2DMimaps? (the texture is small).

11-10-2008, 05:55 AM

I prefer the first way in any case but the first way have been added for frame buffer object because sometime you generate your texture and you need to generate the mipmaps for it. Which seams to be your senario.

The second way generates the mipmaps on the GPU too.

For my point of view gluBuild2Dmipmaps is deprecated. I could be really useful when you want your software to support old or crappy hardware, like GeForce 5 and Radeon X*** (X**** is fine!)

11-10-2008, 06:02 AM
GL_GENERATE_MIPMAP is deprecated in OpenGL 3.0 in favour of glGenerateMipmaps().

11-10-2008, 06:16 AM
i think building mipmaps yourself is even better. ;) you could do it in many ways from box to sync filter or some other fancy stuff. but glGenerateMipmaps() is totally sufficient today and is of course faster the doing it yourself.

11-10-2008, 06:18 AM
glGenerateMipmaps() is really great for me because my texture is a framebuffer.

Anyone has sample code about it?

11-10-2008, 06:26 AM

11-10-2008, 07:10 AM
Your search - glGenerateMipmap - did not match any documents.


* Make sure all words are spelled correctly.
* Try different keywords.
* Try more general keywords.
* Try fewer keywords.

* Ask http://www.opengl.org forum :-)

11-10-2008, 08:22 AM
i thought you need framebuffer sample. glGenerateMipmap() is self explanatory. what kindof samples you expect on that? here is mine: glGenerateMipmap(GL_TEXTURE_2D);


11-10-2008, 02:30 PM
I resolved with a framebuffer samples and glGenerateMipmap(GL_TEXTURE_2D).


11-18-2008, 05:59 AM
To everyone struggling with glGenerateMipmapEXT on ATI:

Remember to do glEnable(GL_TEXTURE_2D) (or whatever target you are using) before calling glGenerateMipmapEXT(GL_TEXTURE_2D). Or else it doesn't work (at least not here)