r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated
r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated
#Overview
name: r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated is to control the temporal filtering behavior in the Lumen screen probe gather system, which is part of Unreal Engine 5’s global illumination solution.
This setting variable is primarily used in the Lumen rendering subsystem, specifically in the screen probe gather component. It is implemented in the Renderer module of Unreal Engine 5.
The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 10.0f and can be modified at runtime using console commands or through the project settings.
The associated variable GLumenScreenProbeTemporalMaxFramesAccumulated directly interacts with r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated. They share the same value, with GLumenScreenProbeTemporalMaxFramesAccumulated being the C++ variable used in the engine’s code.
Developers must be aware that this variable affects the trade-off between lighting change propagation speed and visual stability. Lower values will cause the temporal filter to propagate lighting changes faster but may increase flickering due to noise.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and desired visual quality.
- Considering the performance implications, as lower values may require more frequent updates.
- Testing different values to find the right balance between responsiveness to lighting changes and visual stability.
Regarding the associated variable GLumenScreenProbeTemporalMaxFramesAccumulated:
The purpose of GLumenScreenProbeTemporalMaxFramesAccumulated is to store the actual value used in the Lumen screen probe gather system’s temporal filtering calculations.
This variable is used directly in the Lumen rendering code, specifically in the UpdateHistoryScreenProbeGather function within the LumenScreenProbeGather.cpp file.
The value of GLumenScreenProbeTemporalMaxFramesAccumulated is set by the console variable system and can be modified at runtime.
It interacts with other variables and settings in the temporal filtering process, such as LumenFinalGatherLightingUpdateSpeed from the post-processing settings.
Developers should be aware that this variable is scaled based on other factors like the LumenFinalGatherLightingUpdateSpeed and whether the scene is currently being edited.
Best practices for using GLumenScreenProbeTemporalMaxFramesAccumulated include:
- Understanding its relationship with the console variable r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated.
- Considering its impact on the temporal filtering process when optimizing rendering performance and quality.
- Being cautious when directly modifying this variable, as it’s typically managed by the console variable system.
#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:210
Scope: file
Source code excerpt:
float GLumenScreenProbeTemporalMaxFramesAccumulated = 10.0f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalMaxFramesAccumulated(
TEXT("r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated"),
GLumenScreenProbeTemporalMaxFramesAccumulated,
TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
TAutoConsoleVariable<int32> CVarLumenScreenProbeTemporalMaxRayDirections(
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeTemporalMaxFramesAccumulated
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:208
Scope: file
Source code excerpt:
);
float GLumenScreenProbeTemporalMaxFramesAccumulated = 10.0f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalMaxFramesAccumulated(
TEXT("r.Lumen.ScreenProbeGather.Temporal.MaxFramesAccumulated"),
GLumenScreenProbeTemporalMaxFramesAccumulated,
TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
TAutoConsoleVariable<int32> CVarLumenScreenProbeTemporalMaxRayDirections(
TEXT("r.Lumen.ScreenProbeGather.Temporal.MaxRayDirections"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1482
Scope (from outer to inner):
file
function void UpdateHistoryScreenProbeGather
lambda-function
Source code excerpt:
const float MaxFramesAccumulatedScale = 1.0f / FMath::Sqrt(FMath::Clamp(View.FinalPostProcessSettings.LumenFinalGatherLightingUpdateSpeed, .5f, 8.0f));
const float EditingScale = View.Family->bCurrentlyBeingEdited ? .5f : 1.0f;
PassParameters->MaxFramesAccumulated = FMath::RoundToInt(GLumenScreenProbeTemporalMaxFramesAccumulated * MaxFramesAccumulatedScale * EditingScale);
PassParameters->HistoryNormalCosThreshold = FMath::Cos(GLumenScreenProbeTemporalHistoryNormalThreshold * (float)PI / 180.0f);
PassParameters->HistoryScreenPositionScaleBias = *DiffuseIndirectHistoryScreenPositionScaleBias;
const FVector2f HistoryUVToScreenPositionScale(1.0f / PassParameters->HistoryScreenPositionScaleBias.X, 1.0f / PassParameters->HistoryScreenPositionScaleBias.Y);
const FVector2f HistoryUVToScreenPositionBias = -FVector2f(PassParameters->HistoryScreenPositionScaleBias.W, PassParameters->HistoryScreenPositionScaleBias.Z) * HistoryUVToScreenPositionScale;
PassParameters->HistoryUVToScreenPositionScaleBias = FVector4f(HistoryUVToScreenPositionScale, HistoryUVToScreenPositionBias);