PDA

View Full Version : Texture filtering - MipMapping without gluBuild2DMipmaps



Stragen
11-18-2002, 04:08 AM
Im my OpenGL application I am attempting to create Mipmaps using glTexImage2D. I am not using gluBuild2DMipmaps for two reasons:
-I do not want to use glu in my program
-I prefer to learn how to do something without an external library as my crutch

Therefore in an attempt to reduce image degredation during the resizing proccess, for every level of reduction I am following this procedure:
Target texel = Average(Source Texel + Surrounding Texels)
Thus a texels properties are defined by an average between the visible source texel and the culled surrounding (3 to 8) texels.

However, despite this effort there are still visible artifacts in the mipmaps.

What image filtering procedures exist that will eliminate artifacts and produce a smooth reduction, and where can documentation of the methods/algorithms be found? Or, is there any other useful advice to be offered by the OpenGL veterans of the opengl.org forums?

Bob
11-18-2002, 06:35 AM
However, despite this effort there are still visible artifacts in the mipmaps.

When downsampling an image, you have to remove the higher frequencies in the image. It's the higher frequencies that creates the artifacts after a downsampling. To remove them, you have to apply a proper low pass filter on the image. The usual way is to create a 2x2 or 3x3 filter (3x3 would be center pixel and it's neighbours), but that is far from an ideal low pass. A good low pass filter may require a very large filter. So basically your filter is to small to reduce the higher frequencies.

Now, creating a larger filter is not that easy. All filter coefficients have to be carefully calculated, and that is not very easy unless you have a good understanding in filter design and (multidimensional) signal processing.

[This message has been edited by Bob (edited 11-18-2002).]