r.TemporalAA.HistoryScreenPercentage
r.TemporalAA.HistoryScreenPercentage
#Overview
name: r.TemporalAA.HistoryScreenPercentage
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Size of temporal AA\'s history.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TemporalAA.HistoryScreenPercentage is to control the size of the temporal anti-aliasing (TAA) history buffer. This setting is part of Unreal Engine’s rendering system, specifically the post-processing pipeline.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Temporal Anti-Aliasing (TAA) component of the post-processing pipeline.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 100.0f, which represents 100% of the screen size.
This variable interacts with the associated variable CVarTemporalAAHistorySP, which is the actual console variable object. They share the same value and purpose.
Developers must be aware that:
- This variable affects the memory usage and performance of the TAA system.
- The value is clamped between 100% and 200% of the screen size in actual usage.
- It’s render thread safe, meaning it can be changed dynamically without causing threading issues.
Best practices when using this variable include:
- Use values between 100 and 200 for the best balance between quality and performance.
- Be mindful of the performance impact when increasing the value, especially on lower-end hardware.
- Test thoroughly on target platforms to ensure the chosen value doesn’t cause performance issues.
Regarding the associated variable CVarTemporalAAHistorySP:
- It’s the actual console variable object that stores and manages the r.TemporalAA.HistoryScreenPercentage value.
- It’s used in the GetTemporalAAHistoryUpscaleFactor function to calculate the upscale factor for the TAA history buffer.
- The value is divided by 100 to convert from percentage to a factor, then clamped between 1.0 and 2.0.
- This variable is crucial for platforms that support temporal history upscaling, as determined by the DoesPlatformSupportTemporalHistoryUpscale function.
When working with CVarTemporalAAHistorySP, developers should:
- Access its value using GetValueOnRenderThread() to ensure thread-safe access.
- Be aware that changes to this variable will affect the TAA upscaling behavior.
- Consider the relationship between this setting and other TAA-related variables for optimal image quality and performance.
#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:53
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarTemporalAAHistorySP(
TEXT("r.TemporalAA.HistoryScreenPercentage"),
100.0f,
TEXT("Size of temporal AA's history."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarUseTemporalAAUpscaler(
TEXT("r.TemporalAA.Upscaler"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarTemporalAAHistorySP
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:52
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarTemporalAAHistorySP(
TEXT("r.TemporalAA.HistoryScreenPercentage"),
100.0f,
TEXT("Size of temporal AA's history."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarUseTemporalAAUpscaler(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:523
Scope (from outer to inner):
file
function float GetTemporalAAHistoryUpscaleFactor
Source code excerpt:
if (DoesPlatformSupportTemporalHistoryUpscale(View.GetShaderPlatform()))
{
UpscaleFactor = FMath::Clamp(CVarTemporalAAHistorySP.GetValueOnRenderThread() / 100.0f, 1.0f, 2.0f);
}
return UpscaleFactor;
}
bool DoesTemporalAAUseComputeShader(EShaderPlatform Platform)