ShowFlag.LumenGlobalIllumination
ShowFlag.LumenGlobalIllumination
#Overview
name: ShowFlag.LumenGlobalIllumination
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.LumenGlobalIllumination is to control the visibility of Lumen Global Illumination in the Unreal Engine 5 rendering system. This show flag is part of the lighting features and is used to toggle the display of global illumination effects generated by the Lumen system.
-
The Unreal Engine subsystem that relies on this setting variable is primarily the Rendering system, specifically the Lumen Global Illumination module.
-
The value of this variable is set through the engine show flags system. It can be toggled in the editor UI or programmatically through the engine’s show flags API.
-
This variable interacts with other related variables in the rendering pipeline. For example, it’s used in conjunction with
View.Family->EngineShowFlags.GlobalIllumination
andCVarLumenGlobalIllumination
to determine if Lumen Diffuse Global Illumination should be rendered. -
Developers must be aware that this show flag is always accessible, meaning it can be modified at runtime and in shipping builds. This is indicated by the
SHOWFLAG_ALWAYS_ACCESSIBLE
macro used in its declaration. -
Best practices when using this variable include:
- Ensuring it’s properly synchronized with other related global illumination settings.
- Using it in combination with performance profiling tools to assess the impact of Lumen GI on rendering performance.
- Considering its state when debugging lighting issues in scenes using Lumen.
Regarding the associated variable LumenGlobalIllumination:
The purpose of LumenGlobalIllumination is essentially the same as ShowFlag.LumenGlobalIllumination. It’s an alternative way to access the same functionality, likely for consistency in naming conventions or for use in different contexts within the engine.
-
It’s used in the same subsystem (Rendering, specifically Lumen) as ShowFlag.LumenGlobalIllumination.
-
The value is set in the same way as ShowFlag.LumenGlobalIllumination, through the engine show flags system.
-
It interacts with the same set of variables as ShowFlag.LumenGlobalIllumination.
-
Developers should be aware that these two variables are interchangeable and represent the same state.
-
Best practices include using whichever variable name is most appropriate for the context of the code being written, and ensuring consistency in usage throughout a particular module or function.
Both variables are crucial for controlling the visibility and calculation of Lumen Global Illumination in Unreal Engine 5, allowing developers and users to toggle this advanced lighting feature as needed for performance or visual debugging purposes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:347
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(DistanceFieldAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "DistanceFieldAOSF", "Distance Field Ambient Occlusion"))
/** Lumen GI */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalIllumination, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "LumenGlobalIlluminationSF", "Lumen Global Illumination"))
/** SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(VolumetricFog, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "VolumetricFogSF", "Volumetric Fog"))
/** Visualize screen space reflections, for developer (by default off): */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSSR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSSR", "Screen Space Reflections"))
/** Visualize the Shading Models, mostly or debugging and profiling */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeShadingModels, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeShadingModels", "Shading Models"))
#Associated Variable and Callsites
This variable is associated with another variable named LumenGlobalIllumination
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:347
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(DistanceFieldAO, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "DistanceFieldAOSF", "Distance Field Ambient Occlusion"))
/** Lumen GI */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalIllumination, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "LumenGlobalIlluminationSF", "Lumen Global Illumination"))
/** SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(VolumetricFog, SFG_LightingFeatures, NSLOCTEXT("UnrealEd", "VolumetricFogSF", "Volumetric Fog"))
/** Visualize screen space reflections, for developer (by default off): */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeSSR, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeSSR", "Screen Space Reflections"))
/** Visualize the Shading Models, mostly or debugging and profiling */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeShadingModels, SFG_Visualize, NSLOCTEXT("UnrealEd", "VisualizeShadingModels", "Shading Models"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:275
Scope (from outer to inner):
file
function bool ShouldRenderLumenDiffuseGI
Source code excerpt:
&& CVarLumenGlobalIllumination.GetValueOnAnyThread()
&& View.Family->EngineShowFlags.GlobalIllumination
&& View.Family->EngineShowFlags.LumenGlobalIllumination
&& !View.Family->EngineShowFlags.PathTracing
&& (bSkipTracingDataCheck || Lumen::UseHardwareRayTracedScreenProbeGather(*View.Family) || Lumen::IsSoftwareRayTracingSupported());
}
bool ShouldRenderLumenDirectLighting(const FScene* Scene, const FSceneView& View)
{