r.GTAO.TemporalFilter

r.GTAO.TemporalFilter

#Overview

name: r.GTAO.TemporalFilter

This variable is created as a Console Variable (cvar).

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:

  1. Consider the performance impact when enabling or disabling this feature, especially on lower-end hardware.
  2. Use it in conjunction with other GTAO settings for optimal results.
  3. Test the visual impact in various lighting conditions and scenes to ensure it provides the desired effect.

Regarding the associated variable CVarGTAOTemporalFilter:

#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)
		{