glGenerateMipmapEXT() fails?

When I use glGenerateMipmapEXT() after rendering to a texture, the texture simply becomes invisible. If I use a filter mode that doesn’t use mipmaps, it appears just fine. It’s not like it’s a complicated routine, and I implemented it just like all the FBO examples I have seen. I even tried adding a glEnable GL_TEXTURE_2D command right before glGenerateMipmapEXT(), but to no avail:

glBindFramebufferEXT GL_FRAMEBUFFER_EXT,shadow.framebuffer

<draw stuff here>

glBindFramebufferEXT GL_FRAMEBUFFER_EXT,0

glBindTexture GL_TEXTURE_2D,shadow.texture
glGenerateMipmapEXT GL_TEXTURE_2D

I kind of think maybe it isn’t supported on my GEForce 7800, or the latest drivers, because it is so simple, and makes no sense that it wouldn’t be working.

You want to build mipmaps from depth texture? Im not sure, but I think this in not supported.

It’s an RGBA color texture, not a depth texture.

Check your code against usage example 4 in the FBO spec, you call glGenerateMipmapEXT after you create the NULL glTexImage, then you call it when you bind the FBO as a normal colour texture.

Thank you, that worked.

Originally posted by yooyo:
You want to build mipmaps from depth texture? Im not sure, but I think this in not supported.
This is supported, but it is probably not very useful to use averaged depth values. It is more useful for some algorithms to manually generate depth mipmaps with MAX instead of average.

On the other hand, generating mipmaps from a packed depth_stencil texture is completely undefined.