Difference between revisions of "NICE filtering"

From Valve Developer Community
Jump to: navigation, search
(Issues)
(Issues)
Line 7: Line 7:
 
An implementation of the NICE filter can be found inside the imageloader.cpp file in the Source SDK.
 
An implementation of the NICE filter can be found inside the imageloader.cpp file in the Source SDK.
  
== Issues ==
+
== 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 unwanted aliasing on the mipmaps. [[Vtex]] will automatically disable NICE filtering on textures compile with the '_normal' suffix.
 
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 unwanted aliasing on the mipmaps. [[Vtex]] will automatically disable NICE filtering on textures compile with the '_normal' suffix.

Revision as of 16:59, 11 October 2012

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 unwanted aliasing on the mipmaps. Vtex will automatically disable NICE filtering on textures compile with the '_normal' suffix.

Further reading

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