Texture Filtering

Tutorial

·

intermediate

·

+0XP

·

15 mins

·

(110)

Unity Technologies

Texture Filtering

In this tutorial, we compare different filtering settings for your textures and the use cases for which each are appropriate.

Languages available:

1. Types of Texture Filtering

Texture filtering often improves Texture quality in a Scene. Without Texture filtering, artifacts such as aliasing can cause Textures to appear blocky. Texture filtering is often used to sharpen Textures and eliminate aliasing.

However, Texture filtering can also degrade performance because achieving better Texture quality often requires more processing. Texture filtering can sometimes account for up to half of GPU energy consumption. Choosing simpler and more appropriate Texture filters can help reduce the energy demands of an application.

  • Nearest/Point filtering: This is the simplest and least computationally intense form of Texture filtering, though when seen up close, nearest/point filtering can make Textures appear blocky.
  • Bilinear filtering: Bilinear filtering samples and averages neighboring texels to color pixels in a Texture. Unlike nearest filtering, bilinear filtering results in less-blocky pixels, as the pixels have a smooth gradient. A side effect of bilinear filtering is that Textures will look blurry when viewed up close.

  • Trilinear filtering: Trilinear filtering is like bilinear filtering but with added blend between mipmap levels. Trilinear filtering removes noticeable changes between mipmaps by smoothing the transition.

(Note: Bilinear and trilinear filtering requires sampling more pixels and, therefore, more computation.)

  • Anisotropic filtering: Anisotropic filtering makes Textures look better when viewed at an angle, which is ideal for ground-level Textures.

2. Texture Filtering Best Practices

We recommend that you try the following Texture-filtering tips:

  • Use bilinear filtering for a balance between performance and visual quality.
  • Use trilinear filtering selectively because it requires more memory bandwidth than bilinear filtering.
  • Use bilinear and 2x anisotropic filtering instead of trilinear and 1x anisotropic, as it can both look and perform better.
  • Keep the anisotropic level low. Only use a level higher than two for critical game Assets.

3. Conclusion

Keeping in mind the best practices for Texture filtering will ensure that you’re using computational resources in an effective way without degrading the visual quality of your Textures. In the next tutorial, we’ll discuss the performance benefits of using mipmaps for Textures.

Complete this tutorial