ShowFlag.PreviewShadowsIndicator
ShowFlag.PreviewShadowsIndicator
#Overview
name: ShowFlag.PreviewShadowsIndicator
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.PreviewShadowsIndicator is to visualize preview shadow indicators in the Unreal Engine rendering system. This setting is primarily used for debugging and development purposes, allowing developers to see visual representations of shadow indicators in the editor or during development builds.
This setting variable is primarily relied upon by the Unreal Engine’s rendering subsystem, specifically within the deferred shading and lighting components. Based on the callsites, it’s clear that this flag is used in the engine’s core rendering pipeline.
The value of this variable is set through the engine’s show flags system, which allows developers to toggle various visualization and debugging features. It’s important to note that this flag is fixed to 0 (disabled) in shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro.
The PreviewShadowsIndicator interacts directly with the ViewFamily.EngineShowFlags property, which is used to control various rendering features and debug visualizations.
Developers should be aware that:
- This flag is only available in non-shipping builds.
- It’s specifically used for visualizing shadow indicators for lights that don’t have valid precomputed lighting but do have static shadowing.
- Enabling this flag may have performance implications, as it adds additional visualization elements to the rendering pipeline.
Best practices when using this variable include:
- Only enable it when actively debugging shadow-related issues.
- Disable it in performance-critical scenarios or when preparing builds for release.
- Use it in conjunction with other lighting and shadow debugging tools for a comprehensive understanding of the shadow system.
Regarding the associated variable PreviewShadowsIndicator, it appears to be the same variable, just referenced in different contexts. The purpose and usage are identical to ShowFlag.PreviewShadowsIndicator. It’s used in the same way within the rendering pipeline to determine whether to draw preview shadow indicators for lights with static shadowing but invalid precomputed lighting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:323
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(SkyLighting, SFG_LightTypes, NSLOCTEXT("UnrealEd", "SkyLightingSF", "Sky Lighting"))
/** Visualize preview shadow indicator */
SHOWFLAG_FIXED_IN_SHIPPING(0, PreviewShadowsIndicator, SFG_Visualize, NSLOCTEXT("UnrealEd", "PreviewShadowIndicatorSF", "Preview Shadows Indicator"))
/** Visualize precomputed visibility cells */
SHOWFLAG_FIXED_IN_SHIPPING(0, PrecomputedVisibilityCells, SFG_Visualize, NSLOCTEXT("UnrealEd", "PrecomputedVisibilityCellsSF", "Precomputed Visibility Cells"))
/** Visualize volumetric lightmap used for GI on dynamic objects */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricLightmap, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricLightmapSF", "Volumetric Lightmap"))
/** Visualize volume lighting samples used for GI on dynamic objects */
SHOWFLAG_FIXED_IN_SHIPPING(0, VolumeLightingSamples, SFG_Visualize, NSLOCTEXT("UnrealEd", "VolumeLightingSamplesSF", "Volume Lighting Samples"))
#Associated Variable and Callsites
This variable is associated with another variable named PreviewShadowsIndicator
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:323
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(SkyLighting, SFG_LightTypes, NSLOCTEXT("UnrealEd", "SkyLightingSF", "Sky Lighting"))
/** Visualize preview shadow indicator */
SHOWFLAG_FIXED_IN_SHIPPING(0, PreviewShadowsIndicator, SFG_Visualize, NSLOCTEXT("UnrealEd", "PreviewShadowIndicatorSF", "Preview Shadows Indicator"))
/** Visualize precomputed visibility cells */
SHOWFLAG_FIXED_IN_SHIPPING(0, PrecomputedVisibilityCells, SFG_Visualize, NSLOCTEXT("UnrealEd", "PrecomputedVisibilityCellsSF", "Precomputed Visibility Cells"))
/** Visualize volumetric lightmap used for GI on dynamic objects */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeVolumetricLightmap, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeVolumetricLightmapSF", "Volumetric Lightmap"))
/** Visualize volume lighting samples used for GI on dynamic objects */
SHOWFLAG_FIXED_IN_SHIPPING(0, VolumeLightingSamples, SFG_Visualize, NSLOCTEXT("UnrealEd", "VolumeLightingSamplesSF", "Volume Lighting Samples"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:1554
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderLights
Source code excerpt:
const bool bDrawShadows = SortedLightInfo.SortKey.Fields.bShadowed;
const bool bDrawLightFunction = SortedLightInfo.SortKey.Fields.bLightFunction && !bUseLightFunctionAtlas;
const bool bDrawPreviewIndicator = ViewFamily.EngineShowFlags.PreviewShadowsIndicator && !LightSceneInfo.IsPrecomputedLightingValid() && LightSceneProxy.HasStaticShadowing();
const bool bDrawHairShadow = bDrawShadows && bUseHairLighting;
const bool bUseHairDeepShadow = bDrawShadows && bUseHairLighting && LightSceneProxy.CastsHairStrandsDeepShadow();
bool bUsedShadowMaskTexture = false;
bool bElideScreenShadowMask = false;
bool bElideScreenShadowMaskSubPixel = false;