ShowFlag.LumenScreenTraces

ShowFlag.LumenScreenTraces

#Overview

name: ShowFlag.LumenScreenTraces

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.LumenScreenTraces is to control the visibility of screen space tracing in the Lumen global illumination system within Unreal Engine 5. This setting is part of the rendering system, specifically the Lumen subsystem, which is responsible for real-time global illumination.

The Lumen subsystem in Unreal Engine 5 relies on this setting variable. It is primarily used in the Renderer module, as evident from the callsites in LumenReflectionTracing.cpp and LumenScreenProbeTracing.cpp.

The value of this variable is set through the engine’s show flags system. It can be toggled in the editor or programmatically during runtime. The SHOWFLAG_ALWAYS_ACCESSIBLE macro suggests that this flag is always available for modification, regardless of the current rendering path or platform.

This variable interacts with several other variables and settings:

  1. GLumenReflectionScreenTraces
  2. View.FinalPostProcessSettings.LumenReflectionsScreenTraces
  3. GLumenScreenProbeGatherScreenTraces
  4. View.FinalPostProcessSettings.LumenFinalGatherScreenTraces

Developers must be aware that this variable affects both reflections and screen probe tracing in Lumen. Disabling it may improve performance but at the cost of reduced visual quality in global illumination.

Best practices when using this variable include:

  1. Use it for debugging or performance optimization.
  2. Be cautious when disabling it, as it may significantly affect the visual quality of the scene.
  3. Consider the interaction with other Lumen settings for a balanced approach to performance and quality.

Regarding the associated variable LumenScreenTraces:

The purpose of LumenScreenTraces is identical to ShowFlag.LumenScreenTraces. It is the actual variable name used in the C++ code, while ShowFlag.LumenScreenTraces is likely the editor-facing name.

LumenScreenTraces is part of the Lumen subsystem in the Renderer module. It is set using the SHOWFLAG_ALWAYS_ACCESSIBLE macro, which suggests it can be modified through the engine’s show flags system.

This variable interacts with the same set of variables as ShowFlag.LumenScreenTraces. It’s used in conditional statements to determine whether to perform screen space tracing in Lumen calculations.

Developers should be aware that modifying LumenScreenTraces will have the same effect as changing ShowFlag.LumenScreenTraces. It’s crucial for controlling the balance between performance and visual quality in Lumen global illumination.

Best practices for LumenScreenTraces align with those of ShowFlag.LumenScreenTraces, focusing on careful use for debugging, performance optimization, and maintaining visual quality.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:431

Scope: file

Source code excerpt:


/** Use screen space tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenScreenTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenScreenTracesSF", "Screen Traces"))
/** Use detail tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenDetailTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenDetailTracesSF", "Detail Traces"))
/** Use global traces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenGlobalTracesSF", "Global Traces"))
/** Use far field traces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenFarFieldTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenFarFieldTracesSF", "Far Field Traces"))

#Associated Variable and Callsites

This variable is associated with another variable named LumenScreenTraces. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:431

Scope: file

Source code excerpt:


/** Use screen space tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenScreenTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenScreenTracesSF", "Screen Traces"))
/** Use detail tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenDetailTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenDetailTracesSF", "Detail Traces"))
/** Use global traces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenGlobalTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenGlobalTracesSF", "Global Traces"))
/** Use far field traces in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenFarFieldTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenFarFieldTracesSF", "Far Field Traces"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflectionTracing.cpp:886

Scope (from outer to inner):

file
function     void TraceReflections

Source code excerpt:

	const FSceneTextureParameters& SceneTextureParameters = GetSceneTextureParameters(GraphBuilder, SceneTextures);

	const bool bScreenTraces = GLumenReflectionScreenTraces != 0 && View.Family->EngineShowFlags.LumenScreenTraces && View.FinalPostProcessSettings.LumenReflectionsScreenTraces;
	const bool bSampleSceneColorAtHit = (GLumenReflectionsSampleSceneColorAtHit != 0 && bScreenTraces) || GLumenReflectionsSampleSceneColorAtHit == 2;
	const bool bDistantScreenTraces = GLumenReflectionsDistantScreenTraces && bScreenTraces;

	if (bScreenTraces)
	{
		FReflectionTraceScreenTexturesCS::FParameters* PassParameters = GraphBuilder.AllocParameters<FReflectionTraceScreenTexturesCS::FParameters>();

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeTracing.cpp:677

Scope (from outer to inner):

file
function     void TraceScreenProbes

Source code excerpt:

		&& GLumenScreenProbeGatherScreenTraces != 0
		&& GLumenVisualizeIndirectDiffuse == 0
		&& View.Family->EngineShowFlags.LumenScreenTraces
		&& View.FinalPostProcessSettings.LumenFinalGatherScreenTraces;

	if (bTraceScreen)
	{
		auto TraceScreen = [&](bool bTraceLightSamples)
		{