Mip-maps have two purposes:
- you can pre-filter the image when it’s smaller to make it look better than a large image filtered by the graphics h/w at run-time, and
- to improve performance when texture memory is limited
A given texture is a point sample of some image. The graphcis hardware needs to resample the texture if the projected polygon is smaller than the texture. There are a number of ways of doing this. One way is a very poxy “discard data that we can’t fit”, like so:
ie. throw out textels 2 and 4 so our 5 textel image can map to the three pixel poly. But… what if our texture is of a chequer pattern… so that odd pixels are white and even pixels are black. This resampling method will throw aweay all the black pixels and we’ll end up with a sold white polygon. This looks decidedely dodgey… especially when the polygon gets bigger and suddenly we change mimaps and use the texture with black in it.
What is more desireable when resampling images is to reasmple the function the image represents. Now, i’m not going to get into the lengthy “a pixel isn’t a square” debate, because no one would believe me and everyone would think I’m just f?@#ked in the head. For the record: a pixel is NOT A LITTLE SQUARE> it’s a point sample of an analogue intensity function. Graphics programs with a tad more intelligence than the simple discard reconstruction filter mentioned above fit curves through the pixels and resample the function to map to fewer points. Or, a simple way of saying this is to use a bilinear texture filter and muneg the black and white together to make a grey polygon. OKay, the grey isn’t a chequer pattern, either, but it’s a better representation than just a white poly.
Yes, some graphics h/w can do bi-linear filtering on chip, but the didn’t all use to do that. But, that leads onto the second point:
large textures are not always used. It’s a waste of bandwidth to transfer a 1024x1024 texture to a group of polygons which only take up 8x8 pixels on screen. It is much better, in this case, to use a smaller mipmap which takes less time to transfer from host to video memory.
anyway, enough of my meandering mumble.