r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight

r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight

#Overview

name: r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight

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.TemporalFilterProbes.HistoryWeight is to control the weight of historical data in the temporal filtering process for Lumen screen probes. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically for the screen probe gathering and filtering subsystem.

This setting variable is primarily used in the Renderer module, particularly in the Lumen subsystem. Based on the callsites, it’s evident that this variable is utilized in the screen probe filtering process, which is a crucial part of Lumen’s real-time global illumination system.

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

The associated variable GLumenScreenProbeTemporalFilterProbesHistoryWeight directly interacts with this setting. They share the same value, with GLumenScreenProbeTemporalFilterProbesHistoryWeight being the actual variable used in the C++ code to apply the setting.

Developers must be aware that this variable affects the balance between temporal stability and responsiveness in Lumen’s screen probe gathering. A higher value will result in more temporal stability but slower response to changes in lighting or scene geometry, while a lower value will make the system more responsive but potentially introduce more temporal artifacts.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your scene and desired visual quality.
  2. Testing different values to find the optimal balance between stability and responsiveness.
  3. Considering the performance impact of different values, as higher values may require more computational resources.

Regarding the associated variable GLumenScreenProbeTemporalFilterProbesHistoryWeight:

The purpose of GLumenScreenProbeTemporalFilterProbesHistoryWeight is to store and provide the actual value used in the Lumen screen probe temporal filtering process. It directly represents the weight of historical data in the temporal accumulation of radiance for screen probes.

This variable is used in the Renderer module, specifically in the Lumen screen probe filtering system. It’s accessed in the FilterScreenProbes function to set the ProbeTemporalFilterHistoryWeight parameter for the screen probe temporal accumulation compute shader.

The value of GLumenScreenProbeTemporalFilterProbesHistoryWeight is set by the console variable system, linked to the r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight setting.

This variable interacts directly with the console variable system and is used in the shader parameter setting process.

Developers should be aware that modifying this variable directly in code is not recommended, as it’s controlled by the console variable system. Instead, they should use the r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight console command to adjust the value.

Best practices for this variable include:

  1. Accessing it read-only in C++ code when needed.
  2. Using it consistently in relevant shader parameter setting code.
  3. Ensuring that any runtime modifications are done through the console variable system to maintain consistency with the engine’s configuration system.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:72

Scope: file

Source code excerpt:

float GLumenScreenProbeTemporalFilterProbesHistoryWeight = .5f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalFilterProbesHistoryWeight(
	TEXT("r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight"),
	GLumenScreenProbeTemporalFilterProbesHistoryWeight,
	TEXT(""),
	ECVF_RenderThreadSafe
	);

int32 GLumenScreenProbeTemporalDebugForceTracesMoving = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:70

Scope: file

Source code excerpt:

	);

float GLumenScreenProbeTemporalFilterProbesHistoryWeight = .5f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalFilterProbesHistoryWeight(
	TEXT("r.Lumen.ScreenProbeGather.TemporalFilterProbes.HistoryWeight"),
	GLumenScreenProbeTemporalFilterProbesHistoryWeight,
	TEXT(""),
	ECVF_RenderThreadSafe
	);

int32 GLumenScreenProbeTemporalDebugForceTracesMoving = 0;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalForceTracesMoving(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:527

Scope (from outer to inner):

file
function     void FilterScreenProbes

Source code excerpt:

		PassParameters->HistoryScreenProbeSceneDepth = GraphBuilder.RegisterExternalTexture(ScreenProbeGatherState.HistoryScreenProbeSceneDepth);
		PassParameters->HistoryScreenProbeTranslatedWorldPosition = GraphBuilder.RegisterExternalTexture(ScreenProbeGatherState.HistoryScreenProbeTranslatedWorldPosition);
		PassParameters->ProbeTemporalFilterHistoryWeight = GLumenScreenProbeTemporalFilterProbesHistoryWeight;

		auto ComputeShader = View.ShaderMap->GetShader<FScreenProbeTemporallyAccumulateTraceRadianceCS>(0);

		FComputeShaderUtils::AddPass(
			GraphBuilder,
			RDG_EVENT_NAME("TemporallyAccumulateRadiance"),