r.Lumen.ScreenProbeGather.Temporal.ClearHistoryEveryFrame

r.Lumen.ScreenProbeGather.Temporal.ClearHistoryEveryFrame

#Overview

name: r.Lumen.ScreenProbeGather.Temporal.ClearHistoryEveryFrame

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.Temporal.ClearHistoryEveryFrame is to control whether the history buffer for Lumen’s screen probe gathering should be cleared every frame. This setting is primarily used for debugging purposes in the Lumen rendering system, which is part of Unreal Engine 5’s global illumination solution.

This setting variable is used in the Lumen subsystem, specifically in the screen probe gathering component of the rendering module. It’s referenced in the LumenScreenProbeGather.cpp file, which is part of the Renderer module.

The value of this variable is set through the Unreal Engine’s console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.

The associated variable GLumenScreenProbeClearHistoryEveryFrame directly interacts with this setting. They share the same value, and GLumenScreenProbeClearHistoryEveryFrame is used in the actual rendering code to determine whether to clear the history buffer.

Developers must be aware that enabling this setting (setting it to 1) will clear the screen probe history every frame. This can be useful for debugging but will likely impact performance and visual quality in normal gameplay scenarios. It should typically be disabled (set to 0) for production builds.

Best practices when using this variable include:

  1. Use it primarily for debugging purposes.
  2. Be aware of the performance implications when enabled.
  3. Ensure it’s disabled in production builds unless specifically needed for a particular effect.
  4. When debugging temporal stability issues in Lumen, this can be a useful tool to isolate problems.

Regarding the associated variable GLumenScreenProbeClearHistoryEveryFrame:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:155

Scope: file

Source code excerpt:

int32 GLumenScreenProbeClearHistoryEveryFrame = 0;
FAutoConsoleVariableRef CVarLumenScreenProbeClearHistoryEveryFrame(
	TEXT("r.Lumen.ScreenProbeGather.Temporal.ClearHistoryEveryFrame"),
	GLumenScreenProbeClearHistoryEveryFrame,
	TEXT("Whether to clear the history every frame for debugging"),
	ECVF_RenderThreadSafe
	);

float GLumenScreenProbeHistoryDistanceThreshold = .005f;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:153

Scope: file

Source code excerpt:

	);

int32 GLumenScreenProbeClearHistoryEveryFrame = 0;
FAutoConsoleVariableRef CVarLumenScreenProbeClearHistoryEveryFrame(
	TEXT("r.Lumen.ScreenProbeGather.Temporal.ClearHistoryEveryFrame"),
	GLumenScreenProbeClearHistoryEveryFrame,
	TEXT("Whether to clear the history every frame for debugging"),
	ECVF_RenderThreadSafe
	);

float GLumenScreenProbeHistoryDistanceThreshold = .005f;
FAutoConsoleVariableRef CVarLumenScreenProbeHistoryDistanceThreshold(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1413

Scope (from outer to inner):

file
function     void UpdateHistoryScreenProbeGather

Source code excerpt:

			&& !View.bCameraCut 
			&& !View.bPrevTransformsReset
			&& !GLumenScreenProbeClearHistoryEveryFrame
			&& bSceneTextureExtentMatchHistory
			&& ScreenProbeGatherState.LumenGatherCvars == GLumenGatherCvars
			&& !bPropagateGlobalLightingChange)
		{
			FRDGTextureDesc DiffuseIndirectDesc = FRDGTextureDesc::Create2DArray(EffectiveResolution, PF_FloatRGBA, FClearValueBinding::Black, TexCreate_ShaderResource | TexCreate_UAV, ClosureCount);
			FRDGTextureDesc RoughSpecularIndirectDesc = FRDGTextureDesc::Create2DArray(EffectiveResolution, PF_FloatRGB, FClearValueBinding::Black, TexCreate_ShaderResource | TexCreate_UAV, ClosureCount);