Search code examples
graphics3dtexturestexture-mappingtexture2d

Texture Filtering Mode in 3D graphics


Is there any specific relations between the workload/ overhead of different types of Texture filtering modes? i.e. comparing for "no filtering mode", bilinear filtering and trilinear filtering? and are they specific to 3D, or we have them also in 2D?

Thanks :) --Mohammad H.


Solution

  • There is a definite correlation between filter mode and workload. The work performed by each mode is as follows:

    • Nearest(aka unfiltered): Find the closest mip level, then select the texel whose coordinates are closest to the requested coordinate.

    • Bilinear: Find the nearest mip level, then linearly interpolate the requested texel value from the four texels that surround it (assuming a 2D texture).

    • Trilinear: Find the two mip levels which sandwich the depth value, then perform bilinear interpolation on each level. Finally, interpolate between those two values.

    As you can see, the amount of work (and just as importantly, the number of memory accesses) goes up considerably as the filter complexity goes up.

    Finally, to answer your other question, this applies to any texture dimension, but you pay for it more at higher dimensions.