Mipmap questions

Hi,
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?

Thanx.

  1. No. Its built on CPU and uploaded to GPU.
  2. glGetTexImage()

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).

glGenerateMipmaps()
or
glTexParameter(GL_MIPMAPS_GENERATE, GL_TRUE)

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!)

GL_GENERATE_MIPMAP is deprecated in OpenGL 3.0 in favour of glGenerateMipmaps().

i think building mipmaps yourself is even better. :wink: 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.

glGenerateMipmaps() is really great for me because my texture is a framebuffer.

Anyone has sample code about it?

http://www.codesampler.com

Your search - glGenerateMipmap - did not match any documents.

Suggestions:

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

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

i thought you need framebuffer sample. glGenerateMipmap() is self explanatory. what kindof samples you expect on that? here is mine: glGenerateMipmap(GL_TEXTURE_2D);

http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml

I resolved with a framebuffer samples and glGenerateMipmap(GL_TEXTURE_2D).

Thanx!

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)