ShowFlag.LumenSecondaryBounces
ShowFlag.LumenSecondaryBounces
#Overview
name: ShowFlag.LumenSecondaryBounces
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.LumenSecondaryBounces is to control the computation of secondary bounces in Lumen, which is Unreal Engine 5’s global illumination system. This setting is specifically related to the rendering system, particularly the global illumination and lighting calculations.
This setting variable is primarily used by the Lumen subsystem within Unreal Engine 5’s rendering module. Based on the callsites, we can see that it’s part of the SFG_Lumen (Show Flag Group Lumen) category.
The value of this variable is set through the engine’s show flags system. Show flags are typically toggled in the editor or through code to enable or disable certain rendering features.
The associated variable LumenSecondaryBounces interacts directly with ShowFlag.LumenSecondaryBounces. They share the same value and purpose, but are used in different contexts within the engine.
Developers should be aware that this variable controls a computationally expensive feature. Enabling secondary bounces in Lumen will provide more accurate global illumination but at the cost of performance. It’s important to balance visual quality with performance requirements.
Best practices when using this variable include:
- Only enable it when higher quality global illumination is necessary.
- Consider disabling it for performance-critical scenarios or on lower-end hardware.
- Test the impact on frame rate when enabling this feature, especially in complex scenes.
Regarding the associated variable LumenSecondaryBounces:
The purpose of LumenSecondaryBounces is the same as ShowFlag.LumenSecondaryBounces - to control the computation of secondary bounces in Lumen.
This variable is used directly in the Lumen subsystem, specifically in the LumenRadiosity module as seen in the LumenRadiosity.cpp file.
The value of this variable is set by the show flags system, mirroring ShowFlag.LumenSecondaryBounces.
It interacts with the ViewFamily.EngineShowFlags structure, which is used throughout the rendering pipeline to determine which features should be enabled.
Developers should be aware that this variable is checked in performance-critical code paths, so frequent toggling might have a performance impact.
Best practices for LumenSecondaryBounces include:
- Use it in conjunction with other Lumen settings to fine-tune the global illumination quality and performance.
- Consider exposing it as a quality setting that users can adjust based on their hardware capabilities.
- Profile its impact in various scenarios to understand the performance-quality tradeoff in your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:439
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenFarFieldTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenFarFieldTracesSF", "Far Field Traces"))
/** Compute secondary bounces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenSecondaryBounces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenSecondaryBouncesSF", "Secondary Bounces"))
/** Compute screen space directional occlusion in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenShortRangeAmbientOcclusion, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenShortRangeAmbientOcclusionSF", "Short Range Ambient Occlusion"))
/** Draw Nanite meshes */
SHOWFLAG_ALWAYS_ACCESSIBLE(NaniteMeshes, SFG_Nanite, NSLOCTEXT("UnrealEd", "NaniteMeshesSF", "Meshes"))
/** Draw Nanite streaming geometry */
#Associated Variable and Callsites
This variable is associated with another variable named LumenSecondaryBounces
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:439
Scope: file
Source code excerpt:
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenFarFieldTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenFarFieldTracesSF", "Far Field Traces"))
/** Compute secondary bounces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenSecondaryBounces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenSecondaryBouncesSF", "Secondary Bounces"))
/** Compute screen space directional occlusion in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenShortRangeAmbientOcclusion, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenShortRangeAmbientOcclusionSF", "Short Range Ambient Occlusion"))
/** Draw Nanite meshes */
SHOWFLAG_ALWAYS_ACCESSIBLE(NaniteMeshes, SFG_Nanite, NSLOCTEXT("UnrealEd", "NaniteMeshesSF", "Meshes"))
/** Draw Nanite streaming geometry */
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:214
Scope (from outer to inner):
file
function bool LumenRadiosity::IsEnabled
Source code excerpt:
{
return GLumenRadiosity != 0
&& ViewFamily.EngineShowFlags.LumenSecondaryBounces;
}
bool Lumen::UseHardwareRayTracedRadiosity(const FSceneViewFamily& ViewFamily)
{
#if RHI_RAYTRACING
return IsRayTracingEnabled()