PDA

View Full Version : non power of two texture mipmaps



dukey
08-18-2012, 11:31 AM
testing my program on some older ATI cards (x1950 and some mobiles ones) i have major problems with non power of two textures and mipmaps.

I am creating mipmaps like this

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
then
glTexImage2D(etc)

This works fine with nvidia .. but on ATI no mipmaps are generated and I get weird corruption with some of the textures. The ATI cards I've tested claim opengl 2.1 and specifically they list the extension

GL_ARB_texture_non_power_of_two

Which according to the spec



When this extension is supported, mipmapping, automatic mipmap generation, and all the conventional wrap modes are supported for non-power-of-two textures

So what gives ? Is this a known fuck up on ATI cards ? How can I handle this. I don't really want to revert back to using gluBuild2DMipmaps. I've tried using the FBO extension to generate mipmaps but that doesn't seem to work either.

skynet
08-18-2012, 12:53 PM
some older ATI cards (x1950 and some mobiles ones)
Those cards are probably only supported on very old drivers with many bugs in them :-)

Instead of using GL_GENERATE_MIPMAP you might also use
glGenerateMipmapEXT() (if EXT_framebuffer_object is supported) or
glGenerateMipmap() (if ARB_framebuffer_object is supported or GL3.0+)
to explicitly generate the mipmaps.

dukey
08-18-2012, 03:21 PM
EXT_framebuffer_object is supported,
but no glGenerateMipmapEXT() doesn't work either