r.TemporalAACatmullRom
r.TemporalAACatmullRom
#Overview
name: r.TemporalAACatmullRom
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to use a Catmull-Rom filter kernel. Should be a bit sharper than Gaussian.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TemporalAACatmullRom is to control whether the Temporal Anti-Aliasing (TAA) system uses a Catmull-Rom filter kernel instead of a Gaussian filter kernel. This setting is part of the rendering system, specifically the post-processing and anti-aliasing subsystem in Unreal Engine 5.
This setting variable is primarily used in the Renderer module, specifically within the Temporal Anti-Aliasing implementation. Based on the callsites, we can see that it’s referenced in the TemporalAA.cpp file, which is part of the post-processing pipeline.
The value of this variable is set through a console variable (CVarTemporalAACatmullRom) with a default value of 0. This means that by default, the Catmull-Rom filter is not used.
The associated variable CVarTemporalAACatmullRom interacts directly with r.TemporalAACatmullRom. They share the same value and purpose. The CVarTemporalAACatmullRom is used to retrieve the current value of the setting in the code.
Developers must be aware that changing this variable will affect the sharpness of the anti-aliasing effect. The Catmull-Rom filter is described as being “a bit sharper than Gaussian” in the comment.
Best practices when using this variable include:
- Testing the visual impact of enabling/disabling this feature in various scenarios.
- Considering performance implications, as different filter kernels may have different computational costs.
- Using it in conjunction with other TAA settings to achieve the desired balance between image quality and performance.
Regarding the associated variable CVarTemporalAACatmullRom:
The purpose of CVarTemporalAACatmullRom is to provide a programmatic interface to the r.TemporalAACatmullRom setting. It allows the code to read the current value of the setting and adjust the TAA behavior accordingly.
This variable is used in the Renderer module, specifically in the TemporalAA implementation. It’s defined and used in the TemporalAA.cpp file.
The value of CVarTemporalAACatmullRom is set when the r.TemporalAACatmullRom console variable is modified. It’s retrieved in the code using the GetValueOnRenderThread() method.
CVarTemporalAACatmullRom interacts directly with the r.TemporalAACatmullRom console variable. It’s also used in conjunction with other TAA-related variables like CVarTemporalAAFilterSize.
Developers should be aware that this variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating that it can be changed for scalability purposes and is safe to modify from the render thread.
Best practices for using CVarTemporalAACatmullRom include:
- Accessing its value only from the render thread using GetValueOnRenderThread().
- Considering its impact on the entire TAA process when modifying or reading its value.
- Using it in conjunction with other TAA settings for a comprehensive control over the anti-aliasing process.
#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:26
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarTemporalAACatmullRom(
TEXT("r.TemporalAACatmullRom"),
0,
TEXT("Whether to use a Catmull-Rom filter kernel. Should be a bit sharper than Gaussian."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTemporalAAPauseCorrect(
TEXT("r.TemporalAAPauseCorrect"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarTemporalAACatmullRom
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:25
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTemporalAACatmullRom(
TEXT("r.TemporalAACatmullRom"),
0,
TEXT("Whether to use a Catmull-Rom filter kernel. Should be a bit sharper than Gaussian."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTemporalAAPauseCorrect(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:380
Scope (from outer to inner):
file
namespace anonymous
function void SetupSampleWeightParameters
Source code excerpt:
float FilterSize = CVarTemporalAAFilterSize.GetValueOnRenderThread();
int32 bCatmullRom = CVarTemporalAACatmullRom.GetValueOnRenderThread();
// Compute 3x3 weights
{
float TotalWeight = 0.0f;
for (int32 i = 0; i < 9; i++)
{