ShowFlag.VisualizeTSR

ShowFlag.VisualizeTSR

#Overview

name: ShowFlag.VisualizeTSR

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.VisualizeTSR is to provide a visualization tool for diagnosing the internals of Temporal Super Resolution (TSR) in Unreal Engine 5’s rendering system.

This setting variable is primarily used in the rendering system, specifically for the Temporal Super Resolution feature. It is part of the engine’s show flags, which are used to toggle various visual debugging and display options.

Based on the callsites, this variable is utilized in the Renderer module of Unreal Engine 5. It’s particularly relevant to the temporal upscaling and anti-aliasing systems.

The value of this variable is set through the SHOWFLAG_FIXED_IN_SHIPPING macro, which indicates that it’s set to 0 (disabled) in shipping builds. In development builds, it can be toggled on and off.

This variable interacts closely with the VisualizeTSR variable, which appears to be an alias or alternative reference to the same functionality. It’s also related to the CVarTSRVisualize console variable, which provides additional control over the visualization settings.

Developers should be aware that:

  1. This flag is only available in non-shipping builds.
  2. It’s used in conjunction with the EMainTAAPassConfig::TSR setting to determine whether TSR visualization should be active.
  3. Enabling this flag may impact performance, as it adds additional visualization passes to the rendering pipeline.

Best practices when using this variable include:

  1. Only enable it when actively debugging or analyzing TSR behavior.
  2. Be aware of potential performance impacts when enabled.
  3. Use it in combination with other TSR-related settings and visualizations for comprehensive debugging.

Regarding the associated variable VisualizeTSR:

Developers should treat ShowFlag.VisualizeTSR and VisualizeTSR as equivalent when working with TSR visualization in Unreal Engine 5.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:127

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeTemporalUpscaler, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeTemporalUpscalerSF", "Temporal Upscaler I/O (TSR, TAAU or third party plugins)"))
/** Helper to diagnose the internals of TSR. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeTSR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeTSRSF", "Temporal Super Resolution"))
/** Whether to display the Reflection Environment feature, which has local reflections from Reflection Capture actors, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(ReflectionEnvironment, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "ReflectionEnvironmentSF", "Reflection Environment"))
/** Visualize pixels that are outside of their object's bounding box (content error). */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeOutOfBoundsPixels, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeOutOfBoundsPixelsSF", "Out of Bounds Pixels"))
/** Whether to display the scene's diffuse. */
SHOWFLAG_FIXED_IN_SHIPPING(1, Diffuse, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DiffuseSF", "Diffuse"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:127

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeTemporalUpscaler, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeTemporalUpscalerSF", "Temporal Upscaler I/O (TSR, TAAU or third party plugins)"))
/** Helper to diagnose the internals of TSR. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeTSR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeTSRSF", "Temporal Super Resolution"))
/** Whether to display the Reflection Environment feature, which has local reflections from Reflection Capture actors, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(ReflectionEnvironment, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "ReflectionEnvironmentSF", "Reflection Environment"))
/** Visualize pixels that are outside of their object's bounding box (content error). */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeOutOfBoundsPixels, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeOutOfBoundsPixelsSF", "Out of Bounds Pixels"))
/** Whether to display the scene's diffuse. */
SHOWFLAG_FIXED_IN_SHIPPING(1, Diffuse, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DiffuseSF", "Diffuse"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/TemporalAA.h:225

Scope: file

Source code excerpt:

	const FDefaultTemporalUpscaler::FInputs& PassInputs);

/** Interface for the VisualizeTSR showflag. */
struct FVisualizeTemporalUpscalerInputs
{
	// [Optional] Render to the specified output. If invalid, a new texture is created and returned.
	FScreenPassRenderTarget OverrideOutput;

	// Scene color.

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

Scope: file

Source code excerpt:

{
	int32 VisualizeSettings = CVarTSRVisualize.GetValueOnRenderThread();
	return GetMainTAAPassConfig(View) == EMainTAAPassConfig::TSR && (View.Family->EngineShowFlags.VisualizeTSR || VisualizeSettings != -1);
}
#endif

FScreenPassTexture AddTSRMeasureFlickeringLuma(FRDGBuilder& GraphBuilder, FGlobalShaderMap* ShaderMap, FScreenPassTexture SceneColor)
{
	check(SceneColor.Texture)

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

Scope (from outer to inner):

file
function     FDefaultTemporalUpscaler::FOutputs AddTemporalSuperResolutionPasses

Source code excerpt:

					/* InArraySize = */ 1);

				// Create an unused texture for the moire history so that the VisualizeTSR can still display the updated moire history.
				FRDGTextureRef UnusedMoireHistoryTexture = GraphBuilder.CreateTexture(Desc, TEXT("TSR.History.Moire"));
				GraphBuilder.RemoveUnusedTextureWarning(UnusedMoireHistoryTexture);

				PassParameters->HistoryMoireOutput = GraphBuilder.CreateUAV(UnusedMoireHistoryTexture);
				MoireHistoryTexture = GraphBuilder.CreateSRV(FRDGTextureSRVDesc::CreateForSlice(UnusedMoireHistoryTexture, 0));
			}