r.TSR.History.R11G11B10

r.TSR.History.R11G11B10

#Overview

name: r.TSR.History.R11G11B10

The value of this variable can be defined or overridden in .ini config files. 5 .ini config files referencing this setting variable.

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.TSR.History.R11G11B10 is to control the bit depth of the history buffer in Unreal Engine 5’s Temporal Super Resolution (TSR) system. This setting is part of the rendering system, specifically the post-processing pipeline.

This setting variable is primarily used by the Temporal Super Resolution subsystem within Unreal Engine’s renderer module. It’s referenced in the TemporalSuperResolution.cpp file, which is part of the core rendering implementation.

The value of this variable is set through a console variable (CVarTSRR11G11B10History) with a default value of 1. It can be changed at runtime through console commands or project settings.

This variable interacts closely with the associated variable CVarTSRR11G11B10History, which is the actual console variable implementation. They share the same value and purpose.

Developers must be aware of several important aspects when using this variable:

  1. Setting this to 1 (enabled) saves memory bandwidth, which can improve the performance of TSR’s UpdateHistory operation.
  2. This optimization is incompatible with r.PostProcessing.PropagateAlpha=1.
  3. The effect of this setting is influenced by r.TSR.History.ScreenPercentage.

Best practices for using this variable include:

  1. Enable it (set to 1) when optimizing for performance, especially on bandwidth-constrained platforms.
  2. Disable it (set to 0) when working with alpha channel propagation in post-processing.
  3. Consider the interaction with r.TSR.History.ScreenPercentage when fine-tuning TSR performance and quality.

Regarding the associated variable CVarTSRR11G11B10History:

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:55, section: [AntiAliasingQuality@0]

Location: <Workspace>/Engine/Config/BaseScalability.ini:65, section: [AntiAliasingQuality@1]

Location: <Workspace>/Engine/Config/BaseScalability.ini:75, section: [AntiAliasingQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:85, section: [AntiAliasingQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:95, section: [AntiAliasingQuality@Cine]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:48

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


TAutoConsoleVariable<int32> CVarTSRR11G11B10History(
	TEXT("r.TSR.History.R11G11B10"), 1,
	TEXT("Select the bitdepth of the history. r.TSR.History.R11G11B10=1 Saves memory bandwidth that is of particular interest of the TSR's ")
	TEXT("UpdateHistory's runtime performance by saving memory both at previous frame's history reprojection and write out of the output and ")
	TEXT("new history.\n")
	TEXT("This optimisation is unsupported with r.PostProcessing.PropagateAlpha=1.\n")
	TEXT("\n")
	TEXT("Please also not that increasing r.TSR.History.ScreenPercentage=200 adds 2 additional implicit encoding bits in the history compared to the TSR.Output's bitdepth thanks to the downscaling pass from TSR history resolution to TSR output resolution."),

#Associated Variable and Callsites

This variable is associated with another variable named CVarTSRR11G11B10History. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:47

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	ECVF_Scalability | ECVF_RenderThreadSafe);

TAutoConsoleVariable<int32> CVarTSRR11G11B10History(
	TEXT("r.TSR.History.R11G11B10"), 1,
	TEXT("Select the bitdepth of the history. r.TSR.History.R11G11B10=1 Saves memory bandwidth that is of particular interest of the TSR's ")
	TEXT("UpdateHistory's runtime performance by saving memory both at previous frame's history reprojection and write out of the output and ")
	TEXT("new history.\n")
	TEXT("This optimisation is unsupported with r.PostProcessing.PropagateAlpha=1.\n")
	TEXT("\n")

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1333

Scope (from outer to inner):

file
function     FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses

Source code excerpt:


	EPixelFormat ColorFormat = bSupportsAlpha ? PF_FloatRGBA : PF_FloatR11G11B10;
	EPixelFormat HistoryColorFormat = (CVarTSRR11G11B10History.GetValueOnRenderThread() != 0 && !bSupportsAlpha) ? PF_FloatR11G11B10 : PF_FloatRGBA;

	int32 RejectionAntiAliasingQuality = FMath::Clamp(CVarTSRRejectionAntiAliasingQuality.GetValueOnRenderThread(), 1, 2);
	if (UpdateHistoryQuality == FTSRUpdateHistoryCS::EQuality::Low)
	{
		RejectionAntiAliasingQuality = 0; 
	}