Original Post
I am trying to implement a simple example of using glGenerateMipmapEXT and am failing miserably and am not sure why. Graphics card: Nvidia Geforce8800 GTX, latest drivers In order to test glGenerateMipmapEXT, I'm simply following the example listed in the framebuffer_object spec by creating a texture, rendering to it, and then generating mipmaps. Here's the texture and fbo creation: Now that the fbo and texture are setup, I render to it by drawing a full screen quad with a fixed color. (glColor3f(.3, .4, .5);) After rendering, I do: followed by a series of calls to glGetTexImage() to inspect the mipmaps. What I get is garbage output in all levels except level=0 and the final level. I somehow doubt this is a driver bug because it is such a simple example. Any suggestions? Thanks. [Edited by - execute42 on May 27, 2008 1:38:44 PM]
[Source]
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16, 16, 16, 0, GL_RGB, GL_FLOAT, NULL);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 20);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0);
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
cout << "fbo status = " << status << endl; // always OK
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
[/Source][Source]
glBindTexture(GL_TEXTURE_2D, tex);
glGenerateMipmapEXT(GL_TEXTURE_2D);
[/Source]