Anti-aliasing

From Valve Developer Community
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
Comparison of no anti-aliasing and 8x MSAA. Click to enlarge

Anti-aliasing is a graphics technique extensively employed in Valve Valve's video games, such as those in the Half-Life Half-Life series, as well as in other software applications developed by Valve, including Steam Steam and Source Filmmaker 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". Wikipedia icon 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

Wikipedia icon MultiSample Anti-Aliasing (MSAA) was the gaming industry standard of Anti-aliasing, and as such is the only version available in all Source Source games before Counter-Strike: Global Offensive Counter-Strike: Global Offensive. 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. This is usually sufficient for most users, however. All Source games contain 4 different settings of MSAA, which include:

What this does is add more subpixels to a specified location and increases the accuracy of the multisampling, at the cost of performance

FXAA

Wikipedia icon 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 alot 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. Regular Source Source 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.

Note.pngNote:ReShade versions after v5 are not compatible with DX9 based Source games. Use 4.9.1 instead (download mirror here).

TAA

Wikipedia icon 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 blurrines to the image(Example here).

The only source engine game that supports TAA is Apex Legends Apex Legends.

CMAA

Wikipedia icon 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 Source 2 games.

Note.pngNote:When Counter-Strike: Global Offensive Counter-Strike: Global Offensive got ported to Source 2 Source 2 (FXAA) support was removed and (CMAA) was implemented in its place.

Media

NO ANTIALIASING
2x MSAA
4x MSAA
8x MSAA
FXAA
Todo: Add a TAA screenshot, also a MSAA 6x

Support

GoldSrc GoldSrc

Game FXAA MSAA TAA
Half-Life Half-Life
Half-Life: Opposing Force Half-Life: Opposing Force
Half-Life: Blue Shift Half-Life: Blue Shift
Counter-Strike Counter-Strike
Day of Defeat Day of Defeat
Ricochet Ricochet
Team Fortress Classic Team Fortress Classic
Deathmatch Classic Deathmatch Classic
Counter-Strike: Condition Zero Counter-Strike: Condition Zero
Condition Zero Deleted Scenes Condition Zero Deleted Scenes
NO YES NO

Source Source

Game FXAA MSAA TAA
Source 2004 Source 2004
Source 2006 Source 2006
Source 2007 Source 2007
Source 2009 Source 2009/Source Multiplayer Source Multiplayer
Source 2013 Source 2013
Half-Life: Source Half-Life: Source
Day of Defeat: Source Day of Defeat: Source
Half-Life 2 Half-Life 2
Half-Life 2: Episode One Half-Life 2: Episode One
Half-Life 2: Episode Two Half-Life 2: Episode Two
Alien Swarm Alien Swarm
Alien Swarm: Reactive Drop Alien Swarm: Reactive Drop
Alien Swarm Deferred Alien Swarm Deferred
Source Filmmaker Source Filmmaker
Half-Life Deathmatch: Source Half-Life Deathmatch: Source
Half-Life 2: Deathmatch Half-Life 2: Deathmatch
Half-Life 2: Lost Coast Half-Life 2: Lost Coast
Counter-Strike: Source Counter-Strike: Source
Team Fortress 2 Team Fortress 2
Portal Portal
Left 4 Dead Left 4 Dead
Left 4 Dead 2 Left 4 Dead 2
Portal 2 Portal 2
Portal 2: Desolation Portal 2: Desolation[confirm]
NO YES NO
Black Mesa Black Mesa YES NO NO
Counter-Strike: Global Offensive Counter-Strike: Global Offensive YES YES NO
Strata Source Strata Source YES YES NO
Apex Legends Apex Legends
Titanfall 2 Titanfall 2
NO NO YES

Source 2 Source 2

Game FXAA MSAA TAA CMAA
Counter-Strike 2 Counter-Strike 2 NO YES NO YES
Half-Life: Alyx Half-Life: Alyx NO YES NO NO
S&box S&box NO YES NO NO
Dota 2 Dota 2 N/A N/A NO NO

Console commands

Source 2013 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.
Note.pngNote:This commands only accepts positive values as negative ones will do nothing. Also if you are using Source 2013 Source 2013 or newer 6x MSAA is not supported, so it will also do nothing!
mat_aaquality (0-4)
It was used to set CSAA antialiasing settings.
Warning.pngWarning:Ever since the release of Nvidia Nvidia's GTX 600 series cards and newer, support for CSAA has been removed! So this commands will do nothing!

See also

External links