FBO: glGenerateMipmapEXT -ATI

hello!

first of all to openGL driver team at ATI: great work with the FBO!

but…

I don’t know how to generate mipmaps. Can someone tell me why the SGIS extension doesn’t work anymore?
Moreover glGenerateMipmapEXT doesn’t work or I just don’t know how to use it. I was trying to write sth like this:

glGenFramebuffersEXT(1, &framebuffer);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);

for(unsigned int i=1;i<numberOfTextures;i++)
{
        glGenTextures(1, &textures[i]);
	
	// initialize color texture
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, textures[i]);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texWrapS);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texWrapT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texMagFilter);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texMinFilter);

//	glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texWidth, texHeight, 0,	GL_RGB, GL_INT, NULL);

//ok here it is	        
        glGenerateMipma pEXT(GL_TEXTURE_2D);
        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
			GL_COLOR_ATTACHMENT0_EXT,
			GL_TEXTURE_2D, textures[i], 0);

        checkFramebufferStatus();

        glBindTexture(GL_TEXTURE_2D,mainTexture);
        //draw here
	glDisable(GL_TEXTURE_2D);
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glDeleteFramebuffersEXT(1, &framebuffer);

please help!

My understanding is (but I’ve never tried it), that glGenerateMipmapEXT() is an actual function that will generate mipmaps for the current texture, i.e. you have to call it after you’ve rendered the image.

Hope it helps

unfortunetely it does not help. I was trying to write exactly like in spec attached example, and it does not work on ATI (I didn’t checked it on NV yet).

This functionality may not be included in the build in the 5.7 drivers (haven’t tested myself), but it should appear in a future driver. And yes, you call it when you want to create the mipmap chain after rendering to the texture, not as a part of the init code like in GL_SGIS_generate_mipmap.

nice :slight_smile: - no problem I’ll wait then. Fortunetely I’m using FBO only for preprocessing now, so I can generate mipmaps “by hand”.

Had the same problem with 5.7, but it’s completely fixed in the developer betas :slight_smile:

I was able to work around it by using the old generate mipmap extension and then (which is according to the new spec in the fbo doc) use a 00 (or was it 11 don’t have src here) pixel area update to the texture using CopySubTexImage to trigger the generation after each rendering. This method also works on nvidia btw. (and used in flight666 :slight_smile: