天天看點

關于Mipmap

1。為什麼用MIPMAP

-保留細節:當紋理縮小大于2倍時,使用雙線性過濾器會丢失很多細節,紋理高頻部分會放大。因為超過4個像素映射到一個像素。可以通過采樣更多的像素來解決,但是耗性能。

-性能:使用小的紋理texcache命中率會更高,對于小的幾何體完全可以用更小的貼圖。

-閃爍:大的紋理貼到小的幾何體導緻閃爍

使用MIPMAP可以解決以上問題,代價是多占用約1/3的記憶體。

2。各向異性過濾

When a texture is viewed at a steep angle, the filtering should not be uniform in each direction (it should be anisotropic rather than isotropic), and a compromise resolution is required. If a higher resolution is used, the cache coherence goes down, and the aliasing is increased in one direction, but the image tends to be clearer. If a lower resolution is used, the cache coherence is improved, but the image is overly blurry. This would be a tradeoff of MIP level of detail (LOD) for aliasing vs blurriness.

繼續閱讀