r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty

r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty

#Overview

name: r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty is to control the number of linear search steps used to determine if a hit feature is thin and should be ignored during screen probe gathering in the Lumen global illumination system.

This setting variable is primarily used in the Lumen rendering subsystem, specifically in the screen probe tracing module of Unreal Engine 5. It’s part of the global illumination system that Lumen provides.

The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 4 and can be modified at runtime.

The associated C++ variable GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty directly interacts with this setting. They share the same value, and changes to the console variable will affect the C++ variable.

Developers should be aware that this variable affects the accuracy and performance of the screen probe gathering process. A higher value may provide more accurate results for thin features but at the cost of increased computation time.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your scene. Scenes with many thin features might benefit from a higher value.
  2. Balancing between visual quality and performance. Higher values may improve quality but impact performance.
  3. Testing different values to find the optimal setting for your specific use case.

Regarding the associated variable GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty:

The purpose of this C++ variable is to store and provide access to the value set by the console variable within the engine’s C++ code.

It’s used in the Lumen screen probe tracing system, specifically in the TraceScreenProbes function.

The value is set initially to 4 and can be modified through the associated console variable.

This variable directly interacts with the console variable, reflecting its value in the C++ code.

Developers should be aware that this variable is used in performance-critical rendering code, so changes to its value can have a direct impact on rendering performance and quality.

Best practices include:

  1. Avoiding direct modification of this variable in code; instead, use the console variable to ensure consistency.
  2. Consider the impact on performance when adjusting this value, especially in performance-critical sections of your game.
  3. Use this variable in conjunction with other Lumen settings to achieve the desired balance between visual quality and performance.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

int32 GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty = 4;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty(
	TEXT("r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty"),
	GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty,
	TEXT("Number of linear search steps to determine if a hit feature is thin and should be ignored."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherVisualizeTraces = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty = 4;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty(
	TEXT("r.Lumen.ScreenProbeGather.ScreenTraces.HZBTraversal.NumThicknessStepsToDetermineCertainty"),
	GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty,
	TEXT("Number of linear search steps to determine if a hit feature is thin and should be ignored."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeGatherVisualizeTraces = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherVisualizeTraces(

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

Scope (from outer to inner):

file
function     void TraceScreenProbes
lambda-function

Source code excerpt:

			PassParameters->RelativeDepthThickness = GLumenScreenProbeGatherRelativeDepthThickness * View.ViewMatrices.GetPerProjectionDepthThicknessScale();
			PassParameters->HistoryDepthTestRelativeThickness = GLumenScreenProbeGatherHistoryDepthTestRelativeThickness * View.ViewMatrices.GetPerProjectionDepthThicknessScale();
			PassParameters->NumThicknessStepsToDetermineCertainty = GLumenScreenProbeGatherHierarchicalScreenTracesSkipFoliageHits ? 0 : GLumenScreenProbeGatherNumThicknessStepsToDetermineCertainty;
			PassParameters->MinimumTracingThreadOccupancy = GLumenScreenProbeGatherScreenTracesMinimumOccupancy;
			PassParameters->SkipFoliageHits = GLumenScreenProbeGatherHierarchicalScreenTracesSkipFoliageHits;

			PassParameters->ScreenProbeParameters = ScreenProbeParameters;
			PassParameters->IndirectTracingParameters = IndirectTracingParameters;
			PassParameters->RadianceCacheParameters = RadianceCacheParameters;