Anti-Aliasing
CVar prefixes: This page documents XFSDK Light with xl_smaa_*. The standalone XFSDK Enhanced SMAA uses x_smaa_* for equivalent controls; only the prefix changes. Core's Advanced AA is a separate feature and should not be inferred from these settings.
XFSDK Light replaces Unreal's anti-aliasing with SMAA (Subpixel Morphological Anti-Aliasing). Pick the mode with one console variable:
xl_smaa_mode | Mode | Use it when |
|---|---|---|
0 | Off (default) | You use Unreal's own AA, or none. |
1 | SMAA 1x | You want a fully spatial image: no ghosting, no blur in motion. |
2 | SMAA TX2 | You want SMAA plus a two-frame temporal blend that cleans up subpixel shimmer. |
Set r.AntiAliasingMethod=0 in your project so the engine does not run its own AA on top.
Runtime SMAA API
XFSDK Light exposes four public functions for selecting and querying SMAA at runtime.
Exposed functions
The Blueprint nodes are available under XFSDK Light → Anti-Aliasing.
| Blueprint node | C++ function | Return value | Description |
|---|---|---|---|
| Enable SMAA 1x | XFSDK_EnableSMAA1X() | bool | Enables spatial SMAA using the current SMAA tuning settings. |
| Enable SMAA TX2 | XFSDK_EnableSMAATX2() | bool | Enables temporal SMAA TX2 and activates its per-view temporal configuration. |
| Disable SMAA | XFSDK_DisableSMAA() | bool | Disables XFSDK SMAA without selecting a replacement Unreal Engine AA method. |
| Get SMAA Mode | XFSDK_GetSMAAMode() | EXFSDKSMAAMode | Returns the currently selected SMAA mode. |
SMAA mode enum
enum class EXFSDKSMAAMode : uint8
{
Disabled,
SMAA1X,
SMAATX2
};
Function behavior
XFSDK_EnableSMAA1X():
- Sets
r.AntiAliasingMethodto0. - Selects
xl_smaa_mode 1. - Preserves the current SMAA 1x tuning settings.
XFSDK_EnableSMAATX2():
- Sets
r.AntiAliasingMethodto0. - Selects
xl_smaa_mode 2. - Causes the scene-view extension to apply the required temporal configuration per supported view.
- Installs SMAA TX2 through Unreal Engine's third-party temporal-upscaler path.
- Uses a two-position temporal jitter sequence.
- Forces native-resolution rendering while TX2 is active.
XFSDK_DisableSMAA():
- Selects
xl_smaa_mode 0. - Does not select or restore an Unreal Engine anti-aliasing method.
XFSDK_GetSMAAMode():
- Returns
Disabled,SMAA1X, orSMAATX2. - Returns
Disabledif the SMAA mode console variable is unavailable.
The enable and disable functions return false if a required console variable is unavailable.
C++ setup
Add XFSDK_System to the consuming module:
PrivateDependencyModuleNames.AddRange(
new string[]
{
"XFSDK_System"
});
Include the public API header:
#include "XFSDK_SMAA_API.h"
Enable spatial SMAA:
const bool bEnabled = UXFSDKSMAAAPI::XFSDK_EnableSMAA1X();
Enable SMAA TX2:
const bool bEnabled = UXFSDKSMAAAPI::XFSDK_EnableSMAATX2();
Query the selected mode:
const EXFSDKSMAAMode Mode = UXFSDKSMAAAPI::XFSDK_GetSMAAMode();
Disable SMAA:
const bool bDisabled = UXFSDKSMAAAPI::XFSDK_DisableSMAA();
Example graphics setting
void UMyGraphicsSettings::SetTemporalSMAA(const bool bEnabled)
{
const bool bApplied = bEnabled
? UXFSDKSMAAAPI::XFSDK_EnableSMAATX2()
: UXFSDKSMAAAPI::XFSDK_DisableSMAA();
if (!bApplied)
{
// The requested SMAA configuration could not be applied.
}
}
XFSDK Light exposes the core SMAA mode-selection functions using the XFSDK_ API prefix.
The same functions are used by Enhanced SMAA; they are not separate APIs. The console-variable
prefix is different (xl_smaa_* in Light, x_smaa_* in standalone Enhanced SMAA).
Blueprints
Search for these nodes in any Blueprint:
| Blueprint node | C++ function | Result |
|---|---|---|
| Enable SMAA 1x | XFSDK_EnableSMAA1X() | Enables spatial SMAA. Returns bool. |
| Enable SMAA TX2 | XFSDK_EnableSMAATX2() | Enables temporal SMAA TX2. Returns bool. |
| Disable SMAA | XFSDK_DisableSMAA() | Disables SMAA. Returns bool. |
| Get SMAA Mode | XFSDK_GetSMAAMode() | Returns EXFSDK_AA_SMAA_Mode: Disabled, SMAA1X, or SMAATX2. |
Enabling SMAA sets r.AntiAliasingMethod to 0. Disabling SMAA does not restore the
previous Unreal anti-aliasing method. Enable/disable nodes return false if their required
console variables are unavailable.
C++
Add XFSDK_AA_Runtime for XFSDK Enhanced SMAA or XFSDK_System for XFSDK Light to your game module's dependencies in its .Build.cs:
PrivateDependencyModuleNames.Add("XFSDK_AA_Runtime");
or
PrivateDependencyModuleNames.Add("XFSDK_System");
Include the public SMAA API header and call the same static methods:
#include "XFSDK_SMAA_API.h" // or XFSDK_AA_SMAA_API.h in case of standalone SMAA version
// Enable either SMAA mode.
const bool bEnabled = UXFSDK_AA_SMAA_API::XFSDK_EnableSMAA1X();
// const bool bEnabled = UXFSDK_AA_SMAA_API::XFSDK_EnableSMAATX2();
// Read the active mode.
const EXFSDK_AA_SMAA_Mode Mode = UXFSDK_AA_SMAA_API::XFSDK_GetSMAAMode();
// Disable SMAA when needed.
UXFSDK_AA_SMAA_API::XFSDK_DisableSMAA();
SMAA 1x
SMAA finds edges in the image, works out which shape each edge belongs to, and blends the pixels along it. It runs in three compute passes:
- Edge detection marks pixels where the color changes sharply.
- Blend weights searches along each edge (also diagonally) to find its length and shape.
- Neighborhood blending mixes each edge pixel with its neighbor by those weights.
XFSDK Light adds two things to the reference implementation:
- HDR edge detection (
xl_smaa_hdr_edge_detection 1): the scene color is tonemapped before edge detection, so bright highlights don't create false edges. - Depth predication (
xl_smaa_predication 1): depth edges lower the detection threshold locally and raise it elsewhere. Geometric edges get caught even at low contrast, and texture detail stays sharp.
Tuning
| Console variable | Default | Description |
|---|---|---|
xl_smaa_max_search_steps | 32 | Edge search length. 16 low, 32 medium, 64 ultra. Longer edges get smoother at a higher cost. |
xl_smaa_max_diag_search_steps | 16 | Diagonal search length. 8 low, 16 medium, 20 high. |
xl_smaa_disable_diag | 0 | 1 skips diagonal detection: faster, worse on slanted edges. |
xl_smaa_corner_rounding | 0.25 | 0 keeps corners sharp, 1 stops corner detection. |
xl_smaa_hdr_edge_detection | 1 | 0 detects edges on raw HDR values, 1 tonemaps first. |
xl_smaa_predication | 1 | Use depth to guide edge detection. |
xl_smaa_predication_threshold | 0.01 | Depth difference that counts as a depth edge. |
xl_smaa_predication_scale | 2.0 | How much the threshold rises away from depth edges (1–5). |
xl_smaa_predication_strength | 0.4 | How much the threshold drops at depth edges (0–1). |
xl_smaa_debug | 0 | 1 shows detected edges, 2 shows blend weights. |
SMAA TX2
SMAA 2TX is inspired by the SMAA T2x mode used in CryEngine 3 (Crysis 3). The camera alternates between two subpixel positions every frame, SMAA runs on each frame, and the result is blended 50/50 with the previous frame moved into place using motion vectors. The two jitter positions cancel each other out, which gives you the quality of two samples per pixel at the cost of a single SMAA pass and one history read.
Because only two frames are mixed, the image stays sharp and ghosting is limited to one frame, unlike TAA or TSR which accumulate many frames.
How the history is handled:
- Reprojection uses camera motion for static geometry and Unreal's velocity buffer for moving objects, including World Position Offset (wind, foliage).
- Velocity dilation (
xl_smaa_tx2_velocity_dilation 1) takes motion from the closest surface in a 3×3 neighborhood, so thin moving foliage keeps its history. - History weight (
xl_smaa_tx2_history_weight): mode1(default) keeps the full 50/50 blend unless the history pixel moved differently from the current one. Mode0is the original CryEngine 3 behavior, which fades the history out with any motion. It is kept for comparison; thin foliage flickers with it while the camera or the wind moves.
What SMAA TX2 changes in the engine
While SMAA TX2 is active, XFSDK Light installs itself as the temporal upscaler and sets these console variables. They are restored when you switch modes.
| Console variable | Value | Why |
|---|---|---|
r.TemporalAA.Upscaler | 1 | Lets a plugin provide the temporal pass. |
r.TemporalAASamples | 2 | Two-position jitter. |
r.ScreenPercentage | 100 | SMAA TX2 always renders at native resolution. |
SMAA TX2 uses the engine's third-party temporal upscaler slot. It cannot run together with DLSS, FSR or XeSS plugins that use the same slot.
Tuning
| Console variable | Default | Description |
|---|---|---|
xl_smaa_tx2_history_weight | 1 | 0 CryEngine 3 motion fade, 1 50/50 unless object motion differs. |
xl_smaa_tx2_velocity_rejection | 1.0 | Object motion difference, in pixels, at which the history is dropped (mode 1). |
xl_smaa_tx2_velocity_dilation | 1 | 1 takes motion from the nearest surface in 3×3. |
xl_smaa_tx2_rcas_intensity | 0.0 | RCAS sharpening after the resolve, see below. |
xl_smaa_tx2_debug | 0 | Debug views, see below. |
Debug views
xl_smaa_tx2_debug | Shows |
|---|---|
1 | History weight. 0.5 (mid grey) is the full 50/50 blend. |
2 | Reprojection: yellow = no history, magenta = invalid, red = outside the previous frame, blue = object velocity, white = camera reprojection. |
3 | Difference between current and previous frame, ×8. |
RCAS sharpening
RCAS (Robust Contrast Adaptive Sharpening) is AMD's sharpener from FidelityFX FSR 1. It sharpens each pixel based on local contrast and limits the result so it never overshoots its neighbors, which avoids halos. It is applied after the SMAA TX2 resolve.
xl_smaa_tx2_rcas_intensity | Result |
|---|---|
0 | Off (default) |
0–1 | Standard RCAS range. 1 is the strongest sharpening without clipping. |
1–2 | Goes past the non-clipping limit by this factor. Stronger, may show halos. |
Screen percentage
SMAA does not upscale. SMAA 2TX forces 100% while active. With SMAA 1x or no AA, Unreal's default lowers the render resolution with the display resolution, so set:
[SystemSettings]
r.ScreenPercentage.Default.Desktop.Mode=0
r.ScreenPercentage.Default=100
References
- J. Jimenez, J. I. Echevarria, T. Sousa, D. Gutierrez. SMAA: Enhanced Subpixel Morphological Antialiasing. Computer Graphics Forum (Eurographics 2012). iryoku.com/smaa · github.com/iryoku/smaa
- T. Sousa. Anti-Aliasing Methods in CryENGINE 3. SIGGRAPH 2011, Filtering Approaches for Real-Time Anti-Aliasing. iryoku.com/aacourse
- T. Sousa, N. Kasyan, N. Schulz. Secrets of CryENGINE 3 Graphics Technology. SIGGRAPH 2011 Advances in Real-Time Rendering.
- AMD. FidelityFX Super Resolution 1 (RCAS). gpuopen.com/fidelityfx-superresolution