r.TemporalAACurrentFrameWeight
r.TemporalAACurrentFrameWeight
#Overview
name: r.TemporalAACurrentFrameWeight
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Weight of current frame\'s contribution to the history. Low values cause blurriness and ghosting, high values fail to hide jittering.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TemporalAACurrentFrameWeight is to control the weight of the current frame’s contribution in Temporal Anti-Aliasing (TAA) calculations. This setting is part of Unreal Engine’s rendering system, specifically the post-processing pipeline.
This setting variable is primarily used in the Renderer module, particularly in the Temporal Anti-Aliasing implementation. Based on the callsites, it’s utilized in the PostProcess/TemporalAA.cpp file, which is responsible for the TAA post-processing effect.
The value of this variable is set through a console variable (CVarTemporalAACurrentFrameWeight) with a default value of 0.04f. It can be modified at runtime using console commands or through project settings.
The associated variable CVarTemporalAACurrentFrameWeight directly interacts with r.TemporalAACurrentFrameWeight. They share the same value and purpose.
Developers must be aware that this variable significantly impacts the visual quality and performance of Temporal Anti-Aliasing. As stated in the comment, low values can cause blurriness and ghosting, while high values may fail to hide jittering effectively.
Best practices when using this variable include:
- Fine-tuning the value based on the specific needs of your project, considering the trade-off between image stability and responsiveness.
- Testing different values in various scenarios to find the optimal balance for your game’s visual style and performance requirements.
- Potentially exposing this setting to end-users for customization, especially in games where visual fidelity is crucial.
- Monitoring performance impact when adjusting this value, as it can affect frame rates in complex scenes.
Regarding the associated variable CVarTemporalAACurrentFrameWeight:
This is a TAutoConsoleVariable
#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:38
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarTemporalAACurrentFrameWeight(
TEXT("r.TemporalAACurrentFrameWeight"),
.04f,
TEXT("Weight of current frame's contribution to the history. Low values cause blurriness and ghosting, high values fail to hide jittering."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTemporalAAQuality(
TEXT("r.TemporalAA.Quality"), 2,
#Associated Variable and Callsites
This variable is associated with another variable named CVarTemporalAACurrentFrameWeight
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:37
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarTemporalAACurrentFrameWeight(
TEXT("r.TemporalAACurrentFrameWeight"),
.04f,
TEXT("Weight of current frame's contribution to the history. Low values cause blurriness and ghosting, high values fail to hide jittering."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTemporalAAQuality(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.cpp:683
Scope (from outer to inner):
file
function FTAAOutputs AddTemporalAAPass
lambda-function
Source code excerpt:
PassParameters->ViewUniformBuffer = View.ViewUniformBuffer;
PassParameters->CurrentFrameWeight = CVarTemporalAACurrentFrameWeight.GetValueOnRenderThread();
PassParameters->bCameraCut = bCameraCut;
PassParameters->SceneDepthTexture = Inputs.SceneDepthTexture;
PassParameters->GBufferVelocityTexture = Inputs.SceneVelocityTexture;
PassParameters->SceneDepthTextureSampler = TStaticSamplerState<SF_Point>::GetRHI();