ShowFlag.LightInfluences
ShowFlag.LightInfluences
#Overview
name: ShowFlag.LightInfluences
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.LightInfluences is to control the visibility of light influence indicators in the Unreal Engine editor. This setting is primarily used for debugging and visualization purposes in the rendering system.
This setting variable is primarily relied upon by the Unreal Engine’s rendering system, specifically within the SceneVisibility module. It is also referenced in the Engine module, indicating its importance in the core rendering pipeline.
The value of this variable is set through the engine’s show flags system, which allows developers to toggle various debug visualization options. It is defined in the ShowFlagsValues.inl file, which suggests it’s a part of the engine’s configurable rendering options.
The associated variable LightInfluences interacts closely with ShowFlag.LightInfluences. They share the same value and are used interchangeably in different parts of the codebase.
Developers must be aware that this variable is only available in non-shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro. This means it’s intended for development and debugging purposes, not for use in final, released versions of games or applications.
Best practices when using this variable include:
- Use it primarily for debugging lighting issues in the editor.
- Be aware that enabling this flag may have performance implications, especially in complex scenes with many lights.
- Remember to disable it before building shipping versions of the project.
Regarding the associated variable LightInfluences:
The purpose of LightInfluences is the same as ShowFlag.LightInfluences - to control the visibility of light influence indicators. It’s used in the IsRichView function to determine if the current view should include additional debug information.
This variable is used in the Engine and Renderer modules, specifically in functions related to scene rendering and visibility calculations.
The value of LightInfluences is set through the ViewFamily.EngineShowFlags structure, which suggests it can be toggled through the engine’s UI or console commands.
Developers should be aware that enabling LightInfluences may affect performance and should be used judiciously, especially when working on optimizing rendering performance.
Best practices for using LightInfluences include:
- Use it in conjunction with other debug visualization tools for comprehensive lighting analysis.
- Be mindful of its performance impact, especially in scenes with complex lighting setups.
- Consider creating editor-only code paths that utilize this flag to avoid any potential impact on shipping builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:261
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, HitProxies, SFG_Developer, NSLOCTEXT("UnrealEd", "HitProxiesSF", "Hit Proxies"))
/** Draw lines to lights affecting this mesh if its selected. */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightInfluences, SFG_Advanced, NSLOCTEXT("UnrealEd", "LightInfluencesSF", "Light Influences"))
/** for the Editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, Pivot, SFG_Hidden, NSLOCTEXT("UnrealEd", "PivotSF", "Pivot"))
/** Draws un-occluded shadow frustums in wireframe */
SHOWFLAG_FIXED_IN_SHIPPING(0, ShadowFrustums, SFG_Advanced, NSLOCTEXT("UnrealEd", "ShadowFrustumsSF", "Shadow Frustums"))
/** needed for VMI_Wireframe and VMI_BrushWireframe */
SHOWFLAG_FIXED_IN_SHIPPING(0, Wireframe, SFG_Hidden, NSLOCTEXT("UnrealEd", "WireframeSF", "Wireframe"))
#Associated Variable and Callsites
This variable is associated with another variable named LightInfluences
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp:1539
Scope (from outer to inner):
file
function bool IsRichView
Source code excerpt:
ViewFamily.EngineShowFlags.LightMapDensity ||
ViewFamily.EngineShowFlags.MeshEdges ||
ViewFamily.EngineShowFlags.LightInfluences ||
ViewFamily.EngineShowFlags.Wireframe ||
ViewFamily.EngineShowFlags.ActorColoration ||
ViewFamily.EngineShowFlags.LODColoration ||
ViewFamily.EngineShowFlags.HLODColoration ||
ViewFamily.EngineShowFlags.MassProperties )
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:261
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, HitProxies, SFG_Developer, NSLOCTEXT("UnrealEd", "HitProxiesSF", "Hit Proxies"))
/** Draw lines to lights affecting this mesh if its selected. */
SHOWFLAG_FIXED_IN_SHIPPING(0, LightInfluences, SFG_Advanced, NSLOCTEXT("UnrealEd", "LightInfluencesSF", "Light Influences"))
/** for the Editor */
SHOWFLAG_FIXED_IN_SHIPPING(0, Pivot, SFG_Hidden, NSLOCTEXT("UnrealEd", "PivotSF", "Pivot"))
/** Draws un-occluded shadow frustums in wireframe */
SHOWFLAG_FIXED_IN_SHIPPING(0, ShadowFrustums, SFG_Advanced, NSLOCTEXT("UnrealEd", "ShadowFrustumsSF", "Shadow Frustums"))
/** needed for VMI_Wireframe and VMI_BrushWireframe */
SHOWFLAG_FIXED_IN_SHIPPING(0, Wireframe, SFG_Hidden, NSLOCTEXT("UnrealEd", "WireframeSF", "Wireframe"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:4670
Scope (from outer to inner):
file
function void FSceneRenderer::PreVisibilityFrameSetup
Source code excerpt:
#if WITH_EDITOR
// Draw lines to lights affecting this mesh if its selected.
if (ViewFamily.EngineShowFlags.LightInfluences && Scene)
{
Scene->WaitForCreateLightPrimitiveInteractionsTask();
for (TConstSetBitIterator<> It(Scene->PrimitivesSelected); It; ++It)
{
const FPrimitiveSceneInfo* PrimitiveSceneInfo = Scene->Primitives[It.GetIndex()];