r.TSR.History.UpdateQuality
r.TSR.History.UpdateQuality
#Overview
name: r.TSR.History.UpdateQuality
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).
- type:
Var
- help:
Selects shader permutation of the quality of the update of the history in the TSR HistoryUpdate pass currently driven by the sg.AntiAliasingQuality scalability group. For further details about what each offers, you are invited to look at DIM_UPDATE_QUALITY in TSRUpdateHistory.usf and customise to your need.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.TSR.History.UpdateQuality is to control the quality of the history update in the Temporal Super Resolution (TSR) HistoryUpdate pass. This setting is part of the rendering system, specifically the anti-aliasing and upscaling subsystem.
This setting variable is used in the Renderer module of Unreal Engine 5, particularly in the Temporal Super Resolution feature. The TSR system is responsible for improving image quality and performance by leveraging information from previous frames.
The value of this variable is set through a console variable (CVarTSRHistoryUpdateQuality) in the Unreal Engine’s configuration system. It’s defined with a default value of 3, but can be changed at runtime or through configuration files.
The associated variable CVarTSRHistoryUpdateQuality directly interacts with r.TSR.History.UpdateQuality. They essentially represent the same setting, with CVarTSRHistoryUpdateQuality being the C++ representation used in the engine’s code.
Developers must be aware that this variable affects shader permutations and can impact performance and image quality. It’s part of the scalability settings (ECVF_Scalability flag), meaning it can be automatically adjusted based on the system’s capabilities or user-defined quality presets.
Best practices when using this variable include:
- Testing different values to find the optimal balance between image quality and performance for your specific game.
- Considering its impact on different hardware configurations, as higher quality settings may be more demanding on less powerful systems.
- Using it in conjunction with other TSR and anti-aliasing settings for best results.
- Referring to the TSRUpdateHistory.usf shader file for detailed information about what each quality level offers (as mentioned in the variable’s description).
Regarding the associated variable CVarTSRHistoryUpdateQuality:
Its purpose is to provide a programmatic way to access and modify the r.TSR.History.UpdateQuality setting within the C++ code of the engine.
It’s used in the Renderer module, specifically in the TemporalSuperResolution.cpp file, which implements the TSR feature.
The value of CVarTSRHistoryUpdateQuality is set when the console variable is created, but can be modified at runtime using Unreal Engine’s console variable system.
This variable directly interacts with the FTSRUpdateHistoryCS::EQuality enum, which is used to select the appropriate shader permutation for the history update pass.
Developers should be aware that changes to this variable will affect the TSR system’s behavior and potentially impact both performance and image quality.
Best practices include using the GetValueOnRenderThread() method to safely access its value from the render thread, and clamping the value to ensure it’s within the valid range for the EQuality enum.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:57, section: [AntiAliasingQuality@0]
- INI Section:
AntiAliasingQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:67, section: [AntiAliasingQuality@1]
- INI Section:
AntiAliasingQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:77, section: [AntiAliasingQuality@2]
- INI Section:
AntiAliasingQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:87, section: [AntiAliasingQuality@3]
- INI Section:
AntiAliasingQuality@3
- Raw value:
3
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:97, section: [AntiAliasingQuality@Cine]
- INI Section:
AntiAliasingQuality@Cine
- Raw value:
3
- Is Array:
False
#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:58
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarTSRHistoryUpdateQuality(
TEXT("r.TSR.History.UpdateQuality"), 3,
TEXT("Selects shader permutation of the quality of the update of the history in the TSR HistoryUpdate pass currently driven by the sg.AntiAliasingQuality scalability group. ")
TEXT("For further details about what each offers, you are invited to look at DIM_UPDATE_QUALITY in TSRUpdateHistory.usf and customise to your need."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTSRWaveOps(
TEXT("r.TSR.WaveOps"), 1,
#Associated Variable and Callsites
This variable is associated with another variable named CVarTSRHistoryUpdateQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:57
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTSRHistoryUpdateQuality(
TEXT("r.TSR.History.UpdateQuality"), 3,
TEXT("Selects shader permutation of the quality of the update of the history in the TSR HistoryUpdate pass currently driven by the sg.AntiAliasingQuality scalability group. ")
TEXT("For further details about what each offers, you are invited to look at DIM_UPDATE_QUALITY in TSRUpdateHistory.usf and customise to your need."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarTSRWaveOps(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalSuperResolution.cpp:1328
Scope (from outer to inner):
file
function FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses
Source code excerpt:
FTSRHistoryArrayIndices HistoryArrayIndices = TranslateHistoryFormatBitsToArrayIndices(HistoryFormatBits);
FTSRUpdateHistoryCS::EQuality UpdateHistoryQuality = FTSRUpdateHistoryCS::EQuality(FMath::Clamp(CVarTSRHistoryUpdateQuality.GetValueOnRenderThread(), 0, int32(FTSRUpdateHistoryCS::EQuality::MAX) - 1));
bool bIsSeperateTranslucyTexturesValid = PassInputs.PostDOFTranslucencyResources.IsValid();
EPixelFormat ColorFormat = bSupportsAlpha ? PF_FloatRGBA : PF_FloatR11G11B10;
EPixelFormat HistoryColorFormat = (CVarTSRR11G11B10History.GetValueOnRenderThread() != 0 && !bSupportsAlpha) ? PF_FloatR11G11B10 : PF_FloatRGBA;