ShowFlag.GBufferHints

ShowFlag.GBufferHints

#Overview

name: ShowFlag.GBufferHints

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 ShowFlag.GBufferHints is to highlight materials that indicate performance issues or show unrealistic materials in the Unreal Engine renderer. This setting is part of the engine’s development and debugging tools, specifically related to the GBuffer (Geometry Buffer) visualization.

This setting variable is primarily used in the rendering system of Unreal Engine 5. Based on the callsites, it’s evident that the Renderer module relies on this setting variable, particularly in the post-processing pipeline.

The value of this variable is set through the engine’s show flags system, which allows developers to toggle various rendering features on and off. It’s defined in the ShowFlagsValues.inl file, which suggests it’s part of the core engine configuration.

The ShowFlag.GBufferHints interacts closely with its associated variable GBufferHints. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable is fixed in shipping builds, meaning it’s set to 0 and cannot be changed in release versions of the game. This is indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro used in its definition.

Best practices when using this variable include:

  1. Use it primarily during development and debugging phases.
  2. Be aware that enabling this flag may impact performance, so it should be used judiciously.
  3. Understand that this visualization tool can help identify material-related performance issues or unrealistic material setups.
  4. Remember that this feature won’t be available in shipping builds, so don’t rely on it for release versions of the game.

Regarding the associated variable GBufferHints: The purpose of GBufferHints is the same as ShowFlag.GBufferHints - to highlight materials with performance issues or unrealistic properties. It’s used in the post-processing pipeline to enable the visualization of GBuffer hints.

This variable is also part of the rendering system, specifically the post-processing module. It’s used to control whether the VisualizeGBufferHints pass is enabled in the post-processing sequence.

The value of GBufferHints is set through the engine’s show flags system, just like ShowFlag.GBufferHints.

Developers should be aware that enabling this flag will add an additional pass to the post-processing pipeline, which could have performance implications. It’s a valuable tool for identifying material issues but should be used primarily during development and optimization phases.

Best practices for using GBufferHints include:

  1. Use it in conjunction with other visualization tools to get a comprehensive view of the rendering pipeline.
  2. Be prepared to disable it in shipping builds, as it’s not available in release versions.
  3. Use it to iteratively improve material performance and realism during development.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(DepthOfField, SFG_PostProcess, NSLOCTEXT("UnrealEd", "DepthOfFieldSF", "Depth Of Field"))
/** Highlight materials that indicate performance issues or show unrealistic materials */
SHOWFLAG_FIXED_IN_SHIPPING(0, GBufferHints, SFG_Developer, NSLOCTEXT("UnrealEd", "GBufferHintsSF", "GBuffer Hints (material attributes)"))
/** MotionBlur, for now only camera motion blur, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(MotionBlur, SFG_PostProcess, NSLOCTEXT("UnrealEd", "MotionBlurSF", "Motion Blur"))
/** Whether to render the editor gizmos and other foreground editor widgets off screen and apply them after post process, only needed for the editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, CompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "CompositeEditorPrimitivesSF", "Composite Editor Primitives"))
/** When CompositeEditorPrimitives is set, determines whether occluded portions are drawn opaquely on top, or dithered when they are occluded */
SHOWFLAG_FIXED_IN_SHIPPING(0, OpaqueCompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "OpaqueCompositeEditorPrimitives", "Make Composite Editor Primitives Opaque"))

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(DepthOfField, SFG_PostProcess, NSLOCTEXT("UnrealEd", "DepthOfFieldSF", "Depth Of Field"))
/** Highlight materials that indicate performance issues or show unrealistic materials */
SHOWFLAG_FIXED_IN_SHIPPING(0, GBufferHints, SFG_Developer, NSLOCTEXT("UnrealEd", "GBufferHintsSF", "GBuffer Hints (material attributes)"))
/** MotionBlur, for now only camera motion blur, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(MotionBlur, SFG_PostProcess, NSLOCTEXT("UnrealEd", "MotionBlurSF", "Motion Blur"))
/** Whether to render the editor gizmos and other foreground editor widgets off screen and apply them after post process, only needed for the editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, CompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "CompositeEditorPrimitivesSF", "Composite Editor Primitives"))
/** When CompositeEditorPrimitives is set, determines whether occluded portions are drawn opaquely on top, or dithered when they are occluded */
SHOWFLAG_FIXED_IN_SHIPPING(0, OpaqueCompositeEditorPrimitives, SFG_Developer, NSLOCTEXT("UnrealEd", "OpaqueCompositeEditorPrimitives", "Make Composite Editor Primitives Opaque"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:484

Scope (from outer to inner):

file
function     void AddPostProcessingPasses

Source code excerpt:

#endif
	PassSequence.SetEnabled(EPass::VisualizeShadingModels, EngineShowFlags.VisualizeShadingModels);
	PassSequence.SetEnabled(EPass::VisualizeGBufferHints, EngineShowFlags.GBufferHints);
	PassSequence.SetEnabled(EPass::VisualizeSubsurface, EngineShowFlags.VisualizeSSS);
	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);