Skip to main content

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_modeModeUse it when
0Off (default)You use Unreal's own AA, or none.
1SMAA 1xYou want a fully spatial image: no ghosting, no blur in motion.
2SMAA TX2You 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 nodeC++ functionReturn valueDescription
Enable SMAA 1xXFSDK_EnableSMAA1X()boolEnables spatial SMAA using the current SMAA tuning settings.
Enable SMAA TX2XFSDK_EnableSMAATX2()boolEnables temporal SMAA TX2 and activates its per-view temporal configuration.
Disable SMAAXFSDK_DisableSMAA()boolDisables XFSDK SMAA without selecting a replacement Unreal Engine AA method.
Get SMAA ModeXFSDK_GetSMAAMode()EXFSDKSMAAModeReturns the currently selected SMAA mode.

SMAA mode enum​

enum class EXFSDKSMAAMode : uint8
{
Disabled,
SMAA1X,
SMAATX2
};

Function behavior​

XFSDK_EnableSMAA1X():

  • Sets r.AntiAliasingMethod to 0.
  • Selects xl_smaa_mode 1.
  • Preserves the current SMAA 1x tuning settings.

XFSDK_EnableSMAATX2():

  • Sets r.AntiAliasingMethod to 0.
  • 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, or SMAATX2.
  • Returns Disabled if 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 nodeC++ functionResult
Enable SMAA 1xXFSDK_EnableSMAA1X()Enables spatial SMAA. Returns bool.
Enable SMAA TX2XFSDK_EnableSMAATX2()Enables temporal SMAA TX2. Returns bool.
Disable SMAAXFSDK_DisableSMAA()Disables SMAA. Returns bool.
Get SMAA ModeXFSDK_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:

  1. Edge detection marks pixels where the color changes sharply.
  2. Blend weights searches along each edge (also diagonally) to find its length and shape.
  3. 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 variableDefaultDescription
xl_smaa_max_search_steps32Edge search length. 16 low, 32 medium, 64 ultra. Longer edges get smoother at a higher cost.
xl_smaa_max_diag_search_steps16Diagonal search length. 8 low, 16 medium, 20 high.
xl_smaa_disable_diag01 skips diagonal detection: faster, worse on slanted edges.
xl_smaa_corner_rounding0.250 keeps corners sharp, 1 stops corner detection.
xl_smaa_hdr_edge_detection10 detects edges on raw HDR values, 1 tonemaps first.
xl_smaa_predication1Use depth to guide edge detection.
xl_smaa_predication_threshold0.01Depth difference that counts as a depth edge.
xl_smaa_predication_scale2.0How much the threshold rises away from depth edges (1–5).
xl_smaa_predication_strength0.4How much the threshold drops at depth edges (0–1).
xl_smaa_debug01 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): mode 1 (default) keeps the full 50/50 blend unless the history pixel moved differently from the current one. Mode 0 is 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 variableValueWhy
r.TemporalAA.Upscaler1Lets a plugin provide the temporal pass.
r.TemporalAASamples2Two-position jitter.
r.ScreenPercentage100SMAA TX2 always renders at native resolution.
caution

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 variableDefaultDescription
xl_smaa_tx2_history_weight10 CryEngine 3 motion fade, 1 50/50 unless object motion differs.
xl_smaa_tx2_velocity_rejection1.0Object motion difference, in pixels, at which the history is dropped (mode 1).
xl_smaa_tx2_velocity_dilation11 takes motion from the nearest surface in 3×3.
xl_smaa_tx2_rcas_intensity0.0RCAS sharpening after the resolve, see below.
xl_smaa_tx2_debug0Debug views, see below.

Debug views​

xl_smaa_tx2_debugShows
1History weight. 0.5 (mid grey) is the full 50/50 blend.
2Reprojection: yellow = no history, magenta = invalid, red = outside the previous frame, blue = object velocity, white = camera reprojection.
3Difference 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_intensityResult
0Off (default)
0–1Standard RCAS range. 1 is the strongest sharpening without clipping.
1–2Goes 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