r.GTAO.TemporalFilter
r.GTAO.TemporalFilter
#Overview
name: r.GTAO.TemporalFilter
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Temporal Filter for GTAO \n 0: Off \n 1: On (default)\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.GTAO.TemporalFilter is to control the Temporal Filter for Ground Truth Ambient Occlusion (GTAO) in Unreal Engine’s rendering system.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the Composition Lighting subsystem. It is defined in the CompositionLighting.cpp file, which handles various lighting composition techniques.
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1, meaning the Temporal Filter for GTAO is enabled by default. Users can change this value at runtime using console commands.
The associated variable CVarGTAOTemporalFilter interacts directly with r.GTAO.TemporalFilter. They share the same value and purpose. This variable is used in the C++ code to retrieve the current setting value.
Developers should be aware that this variable affects the rendering performance and visual quality of the GTAO effect. When enabled (value 1), it applies temporal filtering to GTAO, which can improve the stability and quality of the ambient occlusion effect over time, potentially at the cost of some performance.
Best practices when using this variable include:
- Consider the performance impact when enabling or disabling this feature, especially on lower-end hardware.
- Use it in conjunction with other GTAO settings for optimal results.
- Test the visual impact in various lighting conditions and scenes to ensure it provides the desired effect.
Regarding the associated variable CVarGTAOTemporalFilter:
- Its purpose is to provide programmatic access to the r.GTAO.TemporalFilter setting within the C++ code.
- It is used in the Renderer module, specifically in the AddPostProcessingGTAOAllPasses and AddPostProcessingGTAOPostAsync functions.
- Its value is set automatically based on the r.GTAO.TemporalFilter console variable.
- It interacts with other GTAO-related variables, such as CVarGTAOSpatialFilter.
- Developers should be aware that this variable is checked on the render thread, so any changes to it will affect the next frame’s rendering.
- Best practices include using GetValueOnRenderThread() when accessing this variable to ensure thread-safe operation.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:35
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarGTAOTemporalFilter(
TEXT("r.GTAO.TemporalFilter"),
1,
TEXT("Enable Temporal Filter for GTAO \n ")
TEXT("0: Off \n ")
TEXT("1: On (default)\n "),
ECVF_RenderThreadSafe | ECVF_Scalability);
#Associated Variable and Callsites
This variable is associated with another variable named CVarGTAOTemporalFilter
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:34
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarGTAOTemporalFilter(
TEXT("r.GTAO.TemporalFilter"),
1,
TEXT("Enable Temporal Filter for GTAO \n ")
TEXT("0: Off \n ")
TEXT("1: On (default)\n "),
ECVF_RenderThreadSafe | ECVF_Scalability);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:237
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOAllPasses
Source code excerpt:
const bool bSpatialPass = (CVarGTAOSpatialFilter.GetValueOnRenderThread() == 1);
const bool bTemporalPass = (ViewState && CVarGTAOTemporalFilter.GetValueOnRenderThread() == 1);
{
FGTAOHorizonSearchOutputs HorizonSearchOutputs =
AddGTAOHorizonSearchIntegratePass(
GraphBuilder,
View,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:328
Scope (from outer to inner):
file
function static FScreenPassTexture AddPostProcessingGTAOPostAsync
Source code excerpt:
const bool bSpatialPass = (CVarGTAOSpatialFilter.GetValueOnRenderThread() == 1);
const bool bTemporalPass = (ViewState && CVarGTAOTemporalFilter.GetValueOnRenderThread() == 1);
{
FScreenPassTexture CurrentOutput;
if (CommonParameters.GTAOType == EGTAOType::EAsyncHorizonSearch)
{