ShowFlag.VisualizeOutOfBoundsPixels
ShowFlag.VisualizeOutOfBoundsPixels
#Overview
name: ShowFlag.VisualizeOutOfBoundsPixels
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.VisualizeOutOfBoundsPixels is to visualize pixels that are outside of their object’s bounding box, which is primarily used for detecting content errors in the rendering system.
This setting variable is part of the Unreal Engine’s rendering system and is utilized in the SceneView module. It’s specifically used in the setup of common view uniform buffer parameters, which are essential for shader operations across the engine.
The value of this variable is set through the engine’s show flags system, which allows for toggling various debug visualization features. It’s defined in the ShowFlagsValues.inl file using the SHOWFLAG_FIXED_IN_SHIPPING macro, indicating that it’s set to 0 (disabled) in shipping builds.
The associated variable VisualizeOutOfBoundsPixels interacts directly with ShowFlag.VisualizeOutOfBoundsPixels. They share the same value and purpose, with VisualizeOutOfBoundsPixels being used in the actual shader parameter setup.
Developers should be aware that this feature is primarily for debugging and content creation purposes. It’s not meant to be used in shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro.
Best practices when using this variable include:
- Use it during development and content creation to identify geometry issues.
- Ensure it’s disabled in final builds to avoid unnecessary performance overhead.
- Be aware that it may impact rendering performance when enabled.
Regarding the associated variable VisualizeOutOfBoundsPixels:
- It’s used directly in the FSceneView::SetupCommonViewUniformBufferParameters function to set the OutOfBoundsMask shader parameter.
- This variable allows the visualization feature to be communicated to the shader system.
- Developers should note that modifying this variable directly is not recommended; instead, they should use the engine’s show flags system to toggle the feature.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:131
Scope: file
Source code excerpt:
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"))
/** Whether to display the scene's specular, including reflections. */
SHOWFLAG_ALWAYS_ACCESSIBLE(Specular, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "SpecularSF", "Specular"))
/** Outline around selected objects in the editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, SelectionOutline, SFG_Hidden, NSLOCTEXT("UnrealEd", "SelectionOutlineSF", "Selection Outline"))
#Associated Variable and Callsites
This variable is associated with another variable named VisualizeOutOfBoundsPixels
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2718
Scope (from outer to inner):
file
function void FSceneView::SetupCommonViewUniformBufferParameters
Source code excerpt:
ViewUniformShaderParameters.DebugViewModeMask = Family->UseDebugViewPS() ? 1 : 0;
ViewUniformShaderParameters.UnlitViewmodeMask = !Family->EngineShowFlags.Lighting || Family->EngineShowFlags.PathTracing ? 1 : 0;
ViewUniformShaderParameters.OutOfBoundsMask = Family->EngineShowFlags.VisualizeOutOfBoundsPixels ? 1 : 0;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
float OverrideTimeMaterialExpression = CVarOverrideTimeMaterialExpressions.GetValueOnRenderThread();
if (OverrideTimeMaterialExpression >= 0.0f)
{
ViewUniformShaderParameters.PrevFrameGameTime = OverrideTimeMaterialExpression;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:131
Scope: file
Source code excerpt:
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"))
/** Whether to display the scene's specular, including reflections. */
SHOWFLAG_ALWAYS_ACCESSIBLE(Specular, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "SpecularSF", "Specular"))
/** Outline around selected objects in the editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, SelectionOutline, SFG_Hidden, NSLOCTEXT("UnrealEd", "SelectionOutlineSF", "Selection Outline"))