ShowFlag.VisualizeReprojection
ShowFlag.VisualizeReprojection
#Overview
name: ShowFlag.VisualizeReprojection
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.VisualizeReprojection is to provide a visual debugging tool for ensuring that the previous frame’s temporal history reprojections using motion vectors are working correctly. This setting is part of Unreal Engine’s rendering system, specifically related to temporal effects and motion vector visualization.
The Unreal Engine subsystem that primarily relies on this setting variable is the rendering module, particularly the post-processing pipeline. This can be seen from the reference in the PostProcessing.cpp file.
The value of this variable is set through the SHOWFLAG_FIXED_IN_SHIPPING macro in the ShowFlagsValues.inl file. It’s important to note that this flag is not available in shipping builds, as indicated by the ‘0’ parameter in the macro.
This variable interacts with the VisualizeMotionVectors flag, which is deprecated in Unreal Engine 5.2. The VisualizeReprojection flag is meant to replace VisualizeMotionVectors. In the post-processing pass setup, both flags are used to enable the VisualizeMotionVectors pass.
Developers must be aware that this is a visualization tool intended for debugging and development purposes. It should not be relied upon or enabled in shipping builds. Additionally, they should note the transition from VisualizeMotionVectors to VisualizeReprojection in UE 5.2.
Best practices when using this variable include:
- Use it during development to verify the correctness of temporal reprojection.
- Disable it for performance testing and final builds.
- Be aware of its impact on rendering performance when enabled.
Regarding the associated variable VisualizeReprojection:
The purpose of VisualizeReprojection is identical to ShowFlag.VisualizeReprojection, as they share the same value and are defined in the same location. It’s used to visualize the previous frame’s reprojection, which is crucial for temporal effects in rendering.
This variable is also part of the rendering system, specifically the post-processing pipeline. It’s set using the same SHOWFLAG_FIXED_IN_SHIPPING macro in ShowFlagsValues.inl.
VisualizeReprojection interacts with the EngineShowFlags in the post-processing setup, where it’s used to enable the VisualizeMotionVectors pass.
Developers should be aware that this is the preferred flag to use for visualizing reprojection in UE 5.2 and later, replacing the deprecated VisualizeMotionVectors flag.
Best practices for using VisualizeReprojection are the same as for ShowFlag.VisualizeReprojection, focusing on its use as a development and debugging tool rather than a feature for shipping builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:123
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeMotionVectors, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeMotionVectorsSF", "Motion Vectors"))
/** Helper to ensure previous frame's temporal history reprojections using motion vectors are working correctly. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeReprojection, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeReprojectionSF", "Previous frame's reprojection"))
/** Helper to diagnose temporal upscaler's inputs and outputs. */
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"))
#Associated Variable and Callsites
This variable is associated with another variable named VisualizeReprojection
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:120
Scope: file
Source code excerpt:
/** Helper to tweak motion blur settings */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeMotionBlur, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeMotionBlurSF", "Motion Blur"))
/** DEPRECATED in 5.2: Use VisualizeReprojection instead. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeMotionVectors, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeMotionVectorsSF", "Motion Vectors"))
/** Helper to ensure previous frame's temporal history reprojections using motion vectors are working correctly. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeReprojection, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeReprojectionSF", "Previous frame's reprojection"))
/** Helper to diagnose temporal upscaler's inputs and outputs. */
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"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:489
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
PassSequence.SetEnabled(EPass::VisualizeLumenSceneOverview, (LumenVisualizeMode == VISUALIZE_MODE_OVERVIEW || LumenVisualizeMode == VISUALIZE_MODE_PERFORMANCE_OVERVIEW) && bPostProcessingEnabled);
PassSequence.SetEnabled(EPass::VisualizeHDR, EngineShowFlags.VisualizeHDR);
PassSequence.SetEnabled(EPass::VisualizeMotionVectors, EngineShowFlags.VisualizeMotionVectors || EngineShowFlags.VisualizeReprojection);
PassSequence.SetEnabled(EPass::VisualizeTemporalUpscaler, EngineShowFlags.VisualizeTemporalUpscaler);
#if WITH_EDITOR
PassSequence.SetEnabled(EPass::PixelInspector, View.bUsePixelInspector);
#else
PassSequence.SetEnabled(EPass::PixelInspector, false);
#endif