You want to use mipmapping when you have a very large texture that may be shown at a small size on the screen. Like a repeating wall texture shown on a faraway wall. If you are never scaling a texture down by more than 2x, I don't think it does you any good.

Mipmapping does two things when you are zoomed way out. First, it reduces those "swimming" artifacts that you see when the GPU is trying to reduce a large texture to a very small screen area. The GPU only does a 2x2 average, so if you are zoomed out by more than 2x, pixels in the texture are being completely missed. Secondly, it reduces the memory bandwidth. VRAM uses caching too, so if the GPU has to read only a few bytes out of the entire texture, it's not very cache friendly. By having a mipmap available that is closer to the size it will be drawn on screen, you won't be wasting as much bandwidth.

The only real downside of mipmapping is that it uses a little more memory, but never more than 1/3 extra. You can also see the edges of the different mipmaps if you don't enable the more expensive trilinear filtering.

The swimming/sparkling effect was happening quite a bit - I modified my TextureLoader so that all textures were mipmapped.

Interestingly it also did improve framerate - must be the bandwidth improvement like you said.

I was worried that it consumed too much memory but that does not seem to be the case - does it build all mipmap levels at texture load time, or does it gen them as needed?

Thanks again for your help

(Jul 13, 2010 06:59 AM)Skorche Wrote: You want to use mipmapping when you have a very large texture that may be shown at a small size on the screen. Like a repeating wall texture shown on a faraway wall. If you are never scaling a texture down by more than 2x, I don't think it does you any good.

Mipmapping does two things when you are zoomed way out. First, it reduces those "swimming" artifacts that you see when the GPU is trying to reduce a large texture to a very small screen area. The GPU only does a 2x2 average, so if you are zoomed out by more than 2x, pixels in the texture are being completely missed. Secondly, it reduces the memory bandwidth. VRAM uses caching too, so if the GPU has to read only a few bytes out of the entire texture, it's not very cache friendly. By having a mipmap available that is closer to the size it will be drawn on screen, you won't be wasting as much bandwidth.

The only real downside of mipmapping is that it uses a little more memory, but never more than 1/3 extra. You can also see the edges of the different mipmaps if you don't enable the more expensive trilinear filtering.

glGenerateMipmap() generates all mipmaps immediately I think. I can't really see any great benefits of generating them as needed. Actually, most modern games do quite the opposite. They load up low resolution versions of every texture the game needs and as geometry with the low resolution textures appears onscreen, it loads the high resolution textures to replace them.

(Jul 12, 2010 08:45 PM)OptimisticMonkey Wrote: Should I mipmap every texture, or only the big tileable ones...?

What are the pros and cons of using it...how much texture space does it take up....

Thanks for any advice...

Use mip mapping on all textures. It adds only 33% to the space requirements of the texture, increases speed dramatically by increasing cache effectiveness, and reduces high frequency noise artifacts. The only case not to use mip maps is when the texel / pixel ratio is always very close to 1.0 -- usually only true for user interface elements.