r.TemporalAA.HistoryScreenPercentage

r.TemporalAA.HistoryScreenPercentage

#Overview

name: r.TemporalAA.HistoryScreenPercentage

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

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:

  1. This variable affects the memory usage and performance of the TAA system.
  2. The value is clamped between 100% and 200% of the screen size in actual usage.
  3. It’s render thread safe, meaning it can be changed dynamically without causing threading issues.

Best practices when using this variable include:

  1. Use values between 100 and 200 for the best balance between quality and performance.
  2. Be mindful of the performance impact when increasing the value, especially on lower-end hardware.
  3. Test thoroughly on target platforms to ensure the chosen value doesn’t cause performance issues.

Regarding the associated variable CVarTemporalAAHistorySP:

When working with CVarTemporalAAHistorySP, developers should:

  1. Access its value using GetValueOnRenderThread() to ensure thread-safe access.
  2. Be aware that changes to this variable will affect the TAA upscaling behavior.
  3. 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)