ShowFlag.StationaryLightOverlap
ShowFlag.StationaryLightOverlap
#Overview
name: ShowFlag.StationaryLightOverlap
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.StationaryLightOverlap is to enable a visualization mode that renders the world colored by stationary light overlap. This setting is primarily used for debugging and optimizing lighting in Unreal Engine.
This setting variable is mainly used by the rendering system, specifically in the deferred shading renderer and post-processing pipeline. It is referenced in several Unreal Engine subsystems and modules, including:
- Engine module (ShowFlagsValues.inl, PrimitiveDrawingUtils.cpp, SceneView.cpp)
- Renderer module (BasePassRendering.cpp, DeferredShadingRenderer.cpp, FogRendering.cpp, PostProcessEyeAdaptation.cpp, PostProcessing.cpp)
The value of this variable is typically set through the engine show flags, which can be toggled in the editor or programmatically. It interacts with other view mode and rendering-related variables, such as ViewFamily.EngineShowFlags and ViewFamily.UseDebugViewPS().
Developers should be aware of the following when using this variable:
- It is primarily intended for editor and development use, not for shipping builds.
- Enabling this flag may impact performance, as it requires additional rendering passes.
- It is mutually exclusive with some other visualization modes, such as fog rendering.
Best practices when using this variable include:
- Use it sparingly and only when debugging lighting issues related to stationary lights.
- Disable it in shipping builds to avoid performance overhead.
- Consider its interaction with other show flags and visualization modes when debugging.
The associated variable StationaryLightOverlap serves the same purpose as ShowFlag.StationaryLightOverlap. It is used interchangeably in the code to check if the stationary light overlap visualization is enabled. The same considerations and best practices apply to this variable as well.
When working with StationaryLightOverlap, developers should note that:
- It is used to determine the view mode in the FindViewMode function.
- It affects the base pass rendering, potentially requiring a full buffer clear.
- It triggers a specific rendering pass (RenderStationaryLightOverlap) in the deferred shading renderer.
- It may disable certain post-processing effects when enabled.
In summary, both ShowFlag.StationaryLightOverlap and StationaryLightOverlap are used to control the visualization of stationary light overlap in Unreal Engine, primarily for debugging and optimization purposes in the editor and development environments.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:209
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, ShaderComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "ShaderComplexitySF", "Shader Complexity"))
/** needed for VMI_StationaryLightOverlap, render world colored by stationary light overlap */
SHOWFLAG_FIXED_IN_SHIPPING(0, StationaryLightOverlap, SFG_Hidden, NSLOCTEXT("UnrealEd", "StationaryLightOverlapSF", "Stationary Light Overlap"))
/** needed for VMI_LightmapDensity and VMI_LitLightmapDensity, render checkerboard material with UVs scaled by lightmap resolution w. color tint for world-space lightmap density */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightMapDensity, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightMapDensitySF", "Light Map Density"))
/** Render streaming bounding volumes for the currently selected texture */
SHOWFLAG_FIXED_IN_SHIPPING(0, StreamingBounds, SFG_Advanced, NSLOCTEXT("UnrealEd", "StreamingBoundsSF", "Streaming Bounds"))
/** Render joint limits */
SHOWFLAG_FIXED_IN_SHIPPING(0, Constraints, SFG_Advanced, NSLOCTEXT("UnrealEd", "ConstraintsSF", "Constraints"))
#Associated Variable and Callsites
This variable is associated with another variable named StationaryLightOverlap
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1535
Scope (from outer to inner):
file
function bool IsRichView
Source code excerpt:
if( ViewFamily.UseDebugViewPS() ||
ViewFamily.EngineShowFlags.LightComplexity ||
ViewFamily.EngineShowFlags.StationaryLightOverlap ||
ViewFamily.EngineShowFlags.BSPSplit ||
ViewFamily.EngineShowFlags.LightMapDensity ||
ViewFamily.EngineShowFlags.MeshEdges ||
ViewFamily.EngineShowFlags.LightInfluences ||
ViewFamily.EngineShowFlags.Wireframe ||
ViewFamily.EngineShowFlags.ActorColoration ||
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2945
Scope (from outer to inner):
file
function FSceneViewFamily::FSceneViewFamily
Source code excerpt:
#if !WITH_EDITOR
check(!EngineShowFlags.StationaryLightOverlap);
#else
// instead of checking IsGameWorld on rendering thread to see if we allow this flag to be disabled
// we force it on in the game thread.
if(IsInGameThread() && Scene)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:723
Scope (from outer to inner):
file
function EViewModeIndex FindViewMode
Source code excerpt:
return VMI_VisualizeVirtualShadowMap;
}
else if (EngineShowFlags.StationaryLightOverlap)
{
return VMI_StationaryLightOverlap;
}
// Test QuadComplexity before ShaderComplexity because QuadComplexity also use ShaderComplexity
else if (EngineShowFlags.QuadOverdraw)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:209
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, ShaderComplexity, SFG_Hidden, NSLOCTEXT("UnrealEd", "ShaderComplexitySF", "Shader Complexity"))
/** needed for VMI_StationaryLightOverlap, render world colored by stationary light overlap */
SHOWFLAG_FIXED_IN_SHIPPING(0, StationaryLightOverlap, SFG_Hidden, NSLOCTEXT("UnrealEd", "StationaryLightOverlapSF", "Stationary Light Overlap"))
/** needed for VMI_LightmapDensity and VMI_LitLightmapDensity, render checkerboard material with UVs scaled by lightmap resolution w. color tint for world-space lightmap density */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightMapDensity, SFG_Hidden, NSLOCTEXT("UnrealEd", "LightMapDensitySF", "Light Map Density"))
/** Render streaming bounding volumes for the currently selected texture */
SHOWFLAG_FIXED_IN_SHIPPING(0, StreamingBounds, SFG_Advanced, NSLOCTEXT("UnrealEd", "StreamingBoundsSF", "Streaming Bounds"))
/** Render joint limits */
SHOWFLAG_FIXED_IN_SHIPPING(0, Constraints, SFG_Advanced, NSLOCTEXT("UnrealEd", "ConstraintsSF", "Constraints"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:1028
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderBasePass
Source code excerpt:
// Always perform a full buffer clear for wireframe, shader complexity view mode, and stationary light overlap viewmode.
if (ViewFamily.EngineShowFlags.Wireframe || ViewFamily.EngineShowFlags.ShaderComplexity || ViewFamily.EngineShowFlags.StationaryLightOverlap)
{
bRequiresRHIClear = true;
bRequiresFarZQuadClear = false;
}
const bool bIsWireframeRenderpass = ViewFamily.EngineShowFlags.Wireframe && FSceneRenderer::ShouldCompositeEditorPrimitives(InViews[0]);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:1067
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderBasePass
Source code excerpt:
}
if (ViewFamily.EngineShowFlags.ShaderComplexity || ViewFamily.EngineShowFlags.StationaryLightOverlap)
{
SceneColorClearValue = FLinearColor(0, 0, 0, kSceneColorClearAlpha);
}
else
{
SceneColorClearValue = FLinearColor(InViews[0].BackgroundColor.R, InViews[0].BackgroundColor.G, InViews[0].BackgroundColor.B, kSceneColorClearAlpha);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:3252
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::Render
Source code excerpt:
}
if (ViewFamily.EngineShowFlags.StationaryLightOverlap)
{
RenderStationaryLightOverlap(GraphBuilder, SceneTextures, LightingChannelsTexture);
}
// Composite Heterogeneous Volumes
if (!bHasRayTracedOverlay && ShouldRenderHeterogeneousVolumes(Scene) &&
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/FogRendering.cpp:559
Scope (from outer to inner):
file
function bool ShouldRenderFog
Source code excerpt:
&& !Family.UseDebugViewPS()
&& CVarFog.GetValueOnRenderThread() == 1
&& !EngineShowFlags.StationaryLightOverlap
&& !EngineShowFlags.LightMapDensity;
}
float GetFogDefaultStartDistance()
{
return 30.0f;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:1199
Scope (from outer to inner):
file
function void FViewInfo::UpdatePreExposure
Source code excerpt:
&& ViewFamily.bResolveScene
&& !ViewFamily.EngineShowFlags.LightMapDensity
&& !ViewFamily.EngineShowFlags.StationaryLightOverlap
&& !ViewFamily.EngineShowFlags.LightComplexity
&& !ViewFamily.EngineShowFlags.LODColoration
&& !ViewFamily.EngineShowFlags.HLODColoration
&& !ViewFamily.EngineShowFlags.ActorColoration
&& ((!ViewFamily.EngineShowFlags.VisualizeBuffer) || CurrentBufferVisualizationMode != NAME_None) // disable pre-exposure for the buffer visualization modes
&& !ViewFamily.EngineShowFlags.RayTracingDebug;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:457
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
TOverridePassSequence<EPass> PassSequence(ViewFamilyOutput);
PassSequence.SetNames(PassNames, UE_ARRAY_COUNT(PassNames));
PassSequence.SetEnabled(EPass::VisualizeStationaryLightOverlap, EngineShowFlags.StationaryLightOverlap);
PassSequence.SetEnabled(EPass::VisualizeLightCulling, EngineShowFlags.VisualizeLightCulling);
#if DEBUG_POST_PROCESS_VOLUME_ENABLE
PassSequence.SetEnabled(EPass::VisualizePostProcessStack, EngineShowFlags.VisualizePostProcessStack);
#else
PassSequence.SetEnabled(EPass::VisualizePostProcessStack, false);
#endif