美文网首页
The rational of mipmapping

The rational of mipmapping

作者: 阿隆的小窝 | 来源:发表于2020-08-27 10:39 被阅读0次

    (lecture by TomK)

    1. quality

    anti-aliasing: think of Nyquist principle,

    downsample effectively reduces high-frequency (think about the artifact w/o mipmap when sampling)

    My figurative thought:

    think about the filter kernel, say bilinear, a middle texel is interpolated by 4 nearby integer texels.

    however, when texture is too large (LOD0), the integer texels corresponding to two neighouring integer pixels are too far apart, say 3x far. 

    Say pixelA and pixelB are neighbours, but due to texture minification, clusterTexelA around float texcoord for pixelA is too far away from clusterTexelB around float texcoord for pixelB, i.e. they are less correlated to each other, in contrast to normal image filtering scenario in which filter kernel window overlaps between neighbouring pixels. So they will not be drawn that close/smoothed much by filtering, i.e. less correlative, which disobeys our assumption of bilinear interpolation, so naturally the artifact can occur..

    (in case of non-filtering from nearby texels, i.e. nearest sample, that makes the same sense, the texels for neighbouring pixels are less correlated in terms of texel value.)

    On the other side, on LOD1 the 4 integer texels are not that far apart, and also they did fair job of keeping essential original information by low-pass filtering, i.e.保留了基本盘。Though the result turns out a little blurry, but anyway annoying artifacts become less (the latter noise originates from insufficient sampling to high frequency).

    2.  speed

    if object's far away, we can load less memory, say LOD2, instead of loading the whole LOD0 and wasting major part of it. This naturally optimizes bandwidth, lowering down the demand.

    My thought:

    IMGn article also mentioned cache coherency improved. This should be right, think of the filtering, and #1, if use LOD0, though the 4 texels, i.e. clusterTexelA around float texcoord for pixelA can fit into cacheline themselves, clusterTexelB around float texcoord for pixelB may not fit into the same cacheline. 

    i.e. in LOD0 case, the texels for neighbouring pixels have less spatial locality.

    But if using LOD1, clusterTexelB may be also on the same cacheline, which improves hit rate.

    相关文章

      网友评论

          本文标题:The rational of mipmapping

          本文链接:https://www.haomeiwen.com/subject/jtccsktx.html