PDA

View Full Version : glGenerateMipmapEXT() fails?



halo
10-21-2006, 08:21 AM
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_2DI 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.

yooyo
10-21-2006, 12:06 PM
You want to build mipmaps from depth texture? Im not sure, but I think this in not supported.

halo
10-21-2006, 02:11 PM
It's an RGBA color texture, not a depth texture.

GuybrushThreepwood
10-21-2006, 04:46 PM
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.

halo
10-22-2006, 08:12 AM
Thank you, that worked.

arekkusu
10-22-2006, 08:35 AM
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.