ShowFlag.VisualizeHDR
ShowFlag.VisualizeHDR
#Overview
name: ShowFlag.VisualizeHDR
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 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.VisualizeHDR is to enable a visualization mode for High Dynamic Range (HDR) rendering in Unreal Engine 5. This setting variable is part of the rendering system, specifically the post-processing pipeline.
Key points about ShowFlag.VisualizeHDR:
-
It is used in the post-processing subsystem of Unreal Engine’s renderer.
-
When enabled, it triggers a specific visualization pass that displays information about the HDR color values in the scene.
-
The value is typically set through the engine show flags, which can be toggled in the editor or via code.
-
It interacts with other post-processing stages, particularly those related to tone mapping, eye adaptation, and bloom.
-
When active, it may disable or modify certain other post-processing effects to avoid conflicts or obstructions in the visualization.
-
It is commonly used for debugging and fine-tuning HDR rendering and exposure settings.
-
The visualization typically shows a histogram of scene luminance and other HDR-related metrics.
Best practices:
- Use this flag primarily for debugging and development purposes, not in final builds.
- When enabled, be aware that it may affect performance due to additional rendering passes.
- Combine with other HDR-related settings and visualizations for comprehensive HDR tuning.
- Disable other conflicting visualizations when using this flag for clearer results.
Developers should be aware that enabling this flag will significantly change the visual output of the renderer, as it’s designed to display technical information rather than the final rendered scene. It’s a powerful tool for understanding and tweaking HDR rendering, but should be used judiciously and disabled for normal gameplay or final output.
The associated variable VisualizeHDR is directly linked to ShowFlag.VisualizeHDR and is used in the same context. It represents the same functionality and is typically used interchangeably in the codebase. The same considerations and best practices apply to both variables.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:35
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(EyeAdaptation, SFG_PostProcess, NSLOCTEXT("UnrealEd", "EyeAdaptationSF", "Eye Adaptation"))
/** Display a histogram of the scene HDR color */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeHDR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeHDRSF", "HDR (Eye Adaptation)"))
/** Display the illuminance debug view for the skylight */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSkyLightIlluminance, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSkyLightIlluminance", "Visualize SkyLight Illuminance"))
/** Helper to tweak local expsoure settings */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLocalExposure, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLocalExposureSF", "Local Exposure"))
/** Image based lens flares (Simulate artifact of reflections within a camera system) */
SHOWFLAG_FIXED_IN_SHIPPING(1, LensFlares, SFG_PostProcess, NSLOCTEXT("UnrealEd", "LensFlaresSF", "Lens Flares"))
#Associated Variable and Callsites
This variable is associated with another variable named VisualizeHDR
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:35
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(EyeAdaptation, SFG_PostProcess, NSLOCTEXT("UnrealEd", "EyeAdaptationSF", "Eye Adaptation"))
/** Display a histogram of the scene HDR color */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeHDR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeHDRSF", "HDR (Eye Adaptation)"))
/** Display the illuminance debug view for the skylight */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSkyLightIlluminance, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSkyLightIlluminance", "Visualize SkyLight Illuminance"))
/** Helper to tweak local expsoure settings */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLocalExposure, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeLocalExposureSF", "Local Exposure"))
/** Image based lens flares (Simulate artifact of reflections within a camera system) */
SHOWFLAG_FIXED_IN_SHIPPING(1, LensFlares, SFG_PostProcess, NSLOCTEXT("UnrealEd", "LensFlaresSF", "Lens Flares"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugProbeRendering.cpp:82
Scope (from outer to inner):
file
function static bool ViewRequiresAndSupportsIlluminanceMeter
Source code excerpt:
static bool ViewRequiresAndSupportsIlluminanceMeter(const FViewInfo& View)
{
if (View.Family->EngineShowFlags.VisualizeHDR // This is the debug view contain the illuminance meter
&& IsIlluminanceMeterSupportedByView(View)) // For instance: forward shading does not work with illuminance meter (we need a material buffer to work with)
{
return true;
}
return false;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightShaftRendering.cpp:113
Scope (from outer to inner):
file
function bool ShouldRenderLightShafts
Source code excerpt:
&& !ViewFamily.EngineShowFlags.VisualizeDOF
&& !ViewFamily.EngineShowFlags.VisualizeBuffer
&& !ViewFamily.EngineShowFlags.VisualizeHDR
&& !ViewFamily.EngineShowFlags.VisualizeMotionBlur;
}
bool ShouldRenderLightShaftsForLight(const FViewInfo& View, const FLightSceneProxy& LightSceneProxy)
{
if (LightSceneProxy.GetLightType() == LightType_Directional)
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessVisualizeHDR.cpp:74
Scope (from outer to inner):
file
function FScreenPassTexture AddVisualizeHDRPass
Source code excerpt:
if (!Output.IsValid())
{
Output = FScreenPassRenderTarget::CreateFromInput(GraphBuilder, Inputs.SceneColor, View.GetOverwriteLoadAction(), TEXT("VisualizeHDR"));
}
const FScreenPassTextureViewport InputViewport(Inputs.SceneColor);
const FScreenPassTextureViewport OutputViewport(Output);
FRHISamplerState* BilinearClampSampler = TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI();
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:348
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
const FEngineShowFlags& EngineShowFlags = View.Family->EngineShowFlags;
const bool bVisualizeHDR = EngineShowFlags.VisualizeHDR;
const bool bViewFamilyOutputInHDR = View.Family->RenderTarget->GetSceneHDREnabled();
const bool bVisualizeGBufferOverview = IsVisualizeGBufferOverviewEnabled(View);
const bool bVisualizeGBufferDumpToFile = IsVisualizeGBufferDumpToFileEnabled(View);
const bool bVisualizeGBufferDumpToPIpe = IsVisualizeGBufferDumpToPipeEnabled(View);
const bool bOutputInHDR = IsPostProcessingOutputInHDR();
const int32 LumenVisualizeMode = GetLumenVisualizeMode(View);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:384
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
VisualizeGBufferOverview,
VisualizeLumenSceneOverview,
VisualizeHDR,
VisualizeLocalExposure,
VisualizeMotionVectors,
VisualizeTemporalUpscaler,
PixelInspector,
HMDDistortion,
HighResolutionScreenshotMask,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:488
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
PassSequence.SetEnabled(EPass::VisualizeGBufferOverview, bVisualizeGBufferOverview || bVisualizeGBufferDumpToFile || bVisualizeGBufferDumpToPIpe);
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);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1584
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
}
if (PassSequence.IsEnabled(EPass::VisualizeHDR))
{
FVisualizeHDRInputs PassInputs;
PassSequence.AcceptOverrideIfLastPass(EPass::VisualizeHDR, PassInputs.OverrideOutput);
PassInputs.SceneColor = SceneColor;
PassInputs.SceneColorBeforeTonemap = FScreenPassTexture::CopyFromSlice(GraphBuilder, SceneColorBeforeTonemapSlice);
PassInputs.HistogramTexture = HistogramTexture;
PassInputs.EyeAdaptationBuffer = GetEyeAdaptationBuffer(GraphBuilder, View);
PassInputs.EyeAdaptationParameters = &EyeAdaptationParameters;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:2055
Scope (from outer to inner):
file
function void AddVisualizeCalibrationMaterialPostProcessingPasses
Source code excerpt:
const FEngineShowFlags& EngineShowFlags = View.Family->EngineShowFlags;
const bool bVisualizeHDR = EngineShowFlags.VisualizeHDR;
const bool bViewFamilyOutputInHDR = View.Family->RenderTarget->GetSceneHDREnabled();
const bool bOutputInHDR = IsPostProcessingOutputInHDR();
// Post Process Material - Before Color Correction
FPostProcessMaterialInputs PostProcessMaterialInputs;
PostProcessMaterialInputs.SetInput(GraphBuilder, EPostProcessMaterialInput::SceneColor, SceneColor);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:4363
Scope (from outer to inner):
file
function bool FSceneRenderer::ShouldCompositeEditorPrimitives
Source code excerpt:
{
const FEngineShowFlags& ShowFlags = View.Family->EngineShowFlags;
if (ShowFlags.VisualizeHDR || ShowFlags.VisualizeSkyLightIlluminance ||
ShowFlags.VisualizePostProcessStack || View.Family->UseDebugViewPS())
{
// certain visualize modes get obstructed too much
return false;
}