r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated

r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated

#Overview

name: r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated

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.LumenScene.Radiosity.Temporal.MaxFramesAccumulated is to control the temporal accumulation of radiosity in the Lumen scene rendering system. It specifically affects the temporal filtering process for radiosity calculations.

This setting variable is primarily used in the Lumen radiosity subsystem, which is part of Unreal Engine’s rendering module. It’s specifically related to the temporal aspects of radiosity calculations in the Lumen scene lighting system.

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

The variable interacts directly with GLumenRadiosityTemporalMaxFramesAccumulated, which is the C++ variable that stores the actual value. They are linked through the FAutoConsoleVariableRef system.

Developers must be aware that this variable affects the trade-off between lighting change propagation speed and flickering due to noise. Lower values will cause lighting changes to propagate faster but may increase flickering.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of the scene, considering the balance between responsiveness to lighting changes and visual stability.
  2. Testing different values to find the optimal setting for your specific use case.
  3. Being cautious when setting very low values, as this may introduce noticeable flickering.

Regarding the associated variable GLumenRadiosityTemporalMaxFramesAccumulated:

The purpose of GLumenRadiosityTemporalMaxFramesAccumulated is to store the actual value used in the C++ code for the maximum number of frames accumulated in the temporal radiosity calculations.

This variable is used directly in the Lumen radiosity subsystem of the rendering module. It’s accessed in the radiosity texel trace parameters setup.

The value of this variable is set by the console variable system, specifically by r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated.

It interacts with the LumenRadiosity::UseTemporalAccumulation() function to determine the actual number of frames to accumulate.

Developers should be aware that this variable directly affects the radiosity calculations in the Lumen system. Changes to this value will impact the visual quality and performance of the radiosity rendering.

Best practices for using this variable include:

  1. Avoiding direct modification of this variable in code, instead using the console variable for changes.
  2. Considering the impact on both visual quality and performance when adjusting this value.
  3. Using it in conjunction with other Lumen radiosity settings for optimal results.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:144

Scope: file

Source code excerpt:

int32 GLumenRadiosityTemporalMaxFramesAccumulated = 4;
FAutoConsoleVariableRef CVarLumenRadiosityTemporalMaxFramesAccumulated(
	TEXT("r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated"),
	GLumenRadiosityTemporalMaxFramesAccumulated,
	TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GLumenRadiosityFixedJitterIndex = -1;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:142

Scope: file

Source code excerpt:

	);

int32 GLumenRadiosityTemporalMaxFramesAccumulated = 4;
FAutoConsoleVariableRef CVarLumenRadiosityTemporalMaxFramesAccumulated(
	TEXT("r.LumenScene.Radiosity.Temporal.MaxFramesAccumulated"),
	GLumenRadiosityTemporalMaxFramesAccumulated,
	TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GLumenRadiosityFixedJitterIndex = -1;
FAutoConsoleVariableRef CVarLumenRadiosityFixedJitterIndex(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:680

Scope: file

Source code excerpt:

		RadiosityTexelTraceParameters.ProbeOcclusionStrength = RadiosityFrameTemporaries.bUseProbeOcclusion ? FMath::Clamp<float>(GRadiosityFilteringProbeOcclusionStrength, 0.0f, 1.0f) : 0;
		RadiosityTexelTraceParameters.FixedJitterIndex = GLumenRadiosityFixedJitterIndex;
		RadiosityTexelTraceParameters.MaxFramesAccumulated = LumenRadiosity::UseTemporalAccumulation() ? GLumenRadiosityTemporalMaxFramesAccumulated : 1;
		RadiosityTexelTraceParameters.NumViews = Views.Num();
		// Needs to be set to valid value inside view loop
		RadiosityTexelTraceParameters.ViewIndex = Views.Num();
		RadiosityTexelTraceParameters.MaxCardTiles = MaxCardTiles;

		FBlueNoise BlueNoise = GetBlueNoiseGlobalParameters();