Anti-aliasing
Anti-aliasing is a graphics technique extensively employed in Valve's video games, such as those in the Half-Life series, as well as in other software applications developed by Valve, including Steam and Source Filmmaker, etc. This technique is utilized to enhance the visual quality and reduce the jagged edges, or jaggies, that can appear in computer-generated imagery.
Computer monitors are essentially a large grid of squares that can be set to any color or brightness. As such, it is impossible to draw a perfectly straight line, because no matter how many squares there are, it will never be able to make a perfectly smooth diagonal. This creates a stair-step pattern that is very noticeable the lower the resolution is, which is often referred to in the Video game world as "Aliasing". Spatial anti-aliasing, often referred to simply as Anti-aliasing, is designed to combat the problems of aliasing. In simple terms, Anti aliasing is designed to smooth out that stair-step pattern in images and make them look less pixelated, while not changing the resolution of the final image.
Overview
MSAA
MultiSample Anti-Aliasing (MSAA) was the gaming industry standard of anti-aliasing (prior to the TAA gradually replacing MSAA in mid-late 2010s as games transitioned from forward rendering to deferred rendering), and as such is the only version available (alongside CSAA on NVIDIA cards prior to Maxwell) in all Source games before Counter-Strike: Global Offensive, and later available in GoldSrc in 2013, with only MSAA 4X being available, which is enabled by default. Essentially, if a polygon is crossing a multisample point, or subpixel, it detects how many of its neighboring points are also being intersected, then takes the color of that polygon and adds it over the existing image to create a slightly smother line. This creates a smoother line, but does not completely remove the stair-step pattern (especially on alpha textures) without combining FXAA/SMAA/other post-FX AA methods with MSAA, plus games that use deferred rendering and MSAA may not work properly and can cause various other issues. This is usually sufficient for most users, however.
All GoldSrc, Source and Source 2 games contain 3 or 4 different settings of MSAA, which include:
- 2x
- 4x - Default level in post-SteamPipe GoldSrc (can be enhanced in GPU control panels)
- 6x - (only in Source 2004) only works with certain GPUs or drivers from that era (removed in favor of 8x)
- 8x
What this does is add more subpixels to a specified location and increases the accuracy of the multisampling, at the cost of performance. Some alternative anti-aliasing methods such as the post-processing one will be less demanding compared to MSAA or other methods.
CSAA ( Nvidia only [ Deprecated])
Coverage Sampling Anti-Aliasing (CSAA) was a NVIDIA-exclusive method of anti-aliasing, introduced with GeForce 8000 Series. It aims to further reduce the additional stress that MSAA puts on the system, with NVIDIA claiming that a CSAA-rendered image will rival 8x-16x MSAA whilst only putting a load on the system comparable to 4x MSAA. It does this by reducing the number of settings each sample determines (by creating a new sample for coverage) whilst increasing the overall number of samples.
However, by the release of Maxwell based GPUs such as GTX 750 Ti, GTX 800M/900 series in 2014, and newer NVIDIA graphics card (or drivers released around Feb 2014 onwards) drops support for CSAA completely, and MFAA completely succeeded it, with lots of limitations however.
FXAA
Fast Approximate Anti-Aliasing (FXAA) is a post-processing effect with a low performance cost. The main advantage of this technique over regular anti-aliasing is that it does not require a lot of computing power. And also its capable of smoothing out alpha blended textures (aka Transparent textures). Its main drawback it's that it blurs the final image, so textures will look less sharp, and plus, they do not recover the missing pixel without using FXAA with MSAA simultaneously (or by downscaling). Regular Source (prior to CS:GO engine branch, or in third-party engine branch such as Xengine) doesn't have support for it but as FXAA is a postprocessing effect, it can easily be implemented like with the Source shader editor or with ReShade.
Additionally, using ReShade on Counter-Strike: Global Offensive and Counter-Strike 2 requires
-allow_third_party_software
and -insecure
command line options.
SMAA
Subpixel Morphological Anti-Aliasing (SMAA) works similarly to FXAA or MLAA (which is what SMAA was based off), but results in much better image quality than both FXAA and MLAA, while also taking little performance impact. There are currently no GoldSrc, Source or Source 2 games used this AA method, but users can add SMAA by using ReShade or Source Shader Editor.
TAA
Temporal Anti Aliasing (TAA) is a spatial anti-aliasing technique that combines information from past frames and the current frame to smooth the current frame. TAA, each pixel is sampled once per frame but in each frame the sample is at a different location within the pixel. Pixels sampled in past frames are blended with pixels sampled in the current frame to produce an anti-aliased image. While being cheaper to calculate then MSAA, its main drawback is that it can cause ghosting and blurriness to the image (Example here).
As of mid 2010s, it is the current gaming industry standard of anti-aliasing (alongside FXAA for weaker hardware) with many modern games started to use TAA as most modern games transitioned from forward rendering to deferred rendering (except Valve games, which continued to use forward rendering, therefore, MSAA is still available as an option for anti-aliasing in Source 2), allowing many lights to be rendered without significant performance hit.
The only Source engine game that supports TAA is Apex Legends, along with all Titanfall engine branch games.
CMAA
Conservative Morphological Anti Aliasing (CMAA) is an image based, post processing technique. CMAA uses 4 main steps to reduce aliasing:
- Color break detection
- Locally dominant edge detection
- Simple shape handling
- Symmetrical long edge shape handling.
CMAA is only supported in some Source 2 games.
Media
GoldSrc
Source
Support
GoldSrc
Source
Source 2
Console commands
Source 2013 games and older source engine games have two console commands dedicated to Anti-aliasing:
mat_antialias (0-8)
- Goes from 0x to 8x MSAA.
mat_aaquality (0-4)
- It was used to set CSAA antialiasing settings.