NICE filtering

From Valve Developer Community
Jump to navigation Jump to search

Stub

This article or section is a stub. You can help by expanding it.

NICE is the default mipmap resize kernel used by Vtex. It is a 7x7 matrix similar to the Sine Cardinal kernel available in VTFLib. It is a good general purpose kernel that gives sharp results.

While there is no "best" kernel (which is one of the reasons VTFLib offers so many kernels) NICE filtering is better than simple box-filtering because it preserves high-frequency information: Textures mipmapped with it look less blurry than those mipmapped with box filtering.

An implementation of the NICE filter can be found inside the imageloader.cpp file in the Source SDK.

Aliasing

Due to the matrix NICE filtering uses it is recommended to disable it on textures with high contrast alpha masks that require accurate precision (e.g. $blendTintByBaseAlpha) and Normal maps which require smoothness. Usage may create undesired aliasing on the mipmaps. Vtex will automatically disable NICE filtering on textures created with the '_normal' suffix.

Further reading

  • Blinn, James F.: Jim Blinn's Corner: Dirty Pixels, Morgan Kaufmann Publishers, Inc., ISBN 1-55860-455-3