r.TemporalAA.Upscaler
r.TemporalAA.Upscaler
#Overview
name: r.TemporalAA.Upscaler
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Choose the upscaling algorithm.\n 0: Forces the default temporal upscaler of the renderer;\n 1: GTemporalUpscaler which may be overridden by a third party plugin (default).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TemporalAA.Upscaler is to control the choice of upscaling algorithm used in the Temporal Anti-Aliasing (TAA) process within Unreal Engine 5’s rendering system.
This setting variable is primarily used by the rendering subsystem, specifically within the Temporal Anti-Aliasing module. It is referenced in the PostProcess/TemporalAA.cpp file, which is part of the Renderer module.
The value of this variable is set through a console variable (CVarUseTemporalAAUpscaler) with a default value of 1. It can be changed at runtime using console commands or through configuration files.
The variable interacts closely with the View.Family->GetTemporalUpscalerInterface() and affects the choice between the default temporal upscaler and potentially third-party upscaling plugins.
Developers should be aware that:
- Setting this variable to 0 forces the use of the default temporal upscaler of the renderer.
- Setting it to 1 (default) allows the use of GTemporalUpscaler, which can be overridden by third-party plugins.
Best practices when using this variable include:
- Consider the performance and visual quality trade-offs when choosing between the default upscaler and potential third-party solutions.
- Test thoroughly when switching between upscaling methods, as it may affect the overall image quality and performance.
- Be mindful of potential conflicts or compatibility issues when using third-party upscaling plugins.
Regarding the associated variable CVarUseTemporalAAUpscaler:
The purpose of CVarUseTemporalAAUpscaler is to provide a programmatic interface for controlling the r.TemporalAA.Upscaler setting within the engine’s C++ code.
This console variable is used directly in the rendering subsystem, specifically in the GetMainTAAPassConfig function, to determine the appropriate Temporal Anti-Aliasing pass configuration.
The value of CVarUseTemporalAAUpscaler is set when the engine initializes the console variables, but it can be modified at runtime through console commands.
It interacts with the View.Family->GetTemporalUpscalerInterface() to determine whether to use a third-party upscaler or the default TAA method.
Developers should be aware that:
- Changes to this variable will take effect on the render thread, as indicated by the ECVF_RenderThreadSafe flag.
- The variable’s value is checked on the render thread, which means it’s designed for real-time adjustments.
Best practices when using this variable include:
- Use GetValueOnRenderThread() when accessing the variable’s value in render thread code.
- Consider exposing this setting in user-facing graphics options if you want to allow players to switch between upscaling methods.
- Be cautious when modifying this value frequently, as it may impact performance or cause visual inconsistencies if not handled properly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:59
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
static TAutoConsoleVariable<int32> CVarUseTemporalAAUpscaler(
TEXT("r.TemporalAA.Upscaler"),
1,
TEXT("Choose the upscaling algorithm.\n")
TEXT(" 0: Forces the default temporal upscaler of the renderer;\n")
TEXT(" 1: GTemporalUpscaler which may be overridden by a third party plugin (default)."),
ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named CVarUseTemporalAAUpscaler
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:58
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarUseTemporalAAUpscaler(
TEXT("r.TemporalAA.Upscaler"),
1,
TEXT("Choose the upscaling algorithm.\n")
TEXT(" 0: Forces the default temporal upscaler of the renderer;\n")
TEXT(" 1: GTemporalUpscaler which may be overridden by a third party plugin (default)."),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:1083
Scope (from outer to inner):
file
function EMainTAAPassConfig GetMainTAAPassConfig
Source code excerpt:
}
int32 CustomUpscalerMode = CVarUseTemporalAAUpscaler.GetValueOnRenderThread();
if (View.Family->GetTemporalUpscalerInterface() && CustomUpscalerMode != 0)
{
return EMainTAAPassConfig::ThirdParty;
}
else if (View.AntiAliasingMethod == AAM_TSR)