   generating mip maps (without using glu)
  hi!so far i've been generating mipmaps using gluBuild2DMipMaps(). is's the only function from the glu lib that i'm still using, and i'd like to get rid of it. i'd like to create the mip maps myself, to understand exactly what is done. can you provide me with some example code on how it can be done?thank you!   
  If the extension GL_SGIS_generate_mipmap is supported, you can just set the texture parameter GL_GENERATE_MIPMAP_SGIS to true. If not, you have to break the image up yourself (halve dimensions, blend as needed, etc.), and use the texture level (the second argument of glTexImage2D(), not sure what it is for others) to set the current level for the mipmap (0 being the base (full detail) texture, 1 being the first mipmapping level, 2 being the second, etc., all the way down till you end up with a 1x1 texture (probably overkill by that point, but anyway...).   ;  There is an OpenGL extension that will build mipmaps automatically for you everytime you load a new texture, I forget what it's called, but it's named good enough that you would recognize it eadsy by looking at the official extension list.In mipmapping, every mipmap is half the dimensions of the previous one, until you get to 1x1. (They are all powers of 2);  wow thanks for the quick replies! if i'd go for the sgis extension, then i'd still need to provide the glu function, if the extension is not supported. i'd prefer doing it manually, so that i have full control of how the textures are processed. but i have no clue how to manipulate (resize, filter) raw texture data..?   ;  Another method, using another extension:From http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt"Manual Mipmap Generation    Mipmaps can be generated manually with the command void GenerateMipmapEXT(enum target);"How you do it, basically:Create a texture capable of containing mipmaps, like this:glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);Load/create level 0 of mipmapcall GenerateMipmapEXT, and you have mipmaps. However, mipmap generation is slow, no matter what method you choose. Try not to do it per frame.If you want to alter the texture at pixel level, maybe you should use glGetTexImage to some data, and recreate the texture with your mosified data.   ;Quote:Original post by Vampyre_DarkThere is an OpenGL extension that will build mipmaps automatically for you everytime you load a new texture, I forget what it's called, but it's named good enough that you would recognize it eadsy by looking at the official extension list.In mipmapping, every mipmap is half the dimensions of the previous one, until you get to 1x1. (They are all powers of 2)And that would be extension GL_SGIS_generate_mipmap. Set that to true and it will automatically update the mipmaps for you. Here is some info on the two methods for mipmaps Automatic mipmap generation via GENERATE_MIPMAP generates  from TEXTURE_BASE_LEVEL+1 through p, which is the 1x1 level.  However, applications frequently don't want to waste  computation generating past q, which is the min of  TEXTURE_MAX_LEVEL and p.  The only recourse is to accept the  performance hit or to not use GENERATE_MIPMAP.