r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount
r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount
#Overview
name: r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Maximum amount of fast-responding temporal filter to use when traces hit a moving object. Values closer to 1 cause more noise, but also faster reaction to scene changes.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount is to control the maximum amount of fast-responding temporal filter used when traces hit a moving object in Lumen’s Screen Probe Gather system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically within the rendering subsystem.
The Lumen Screen Probe Gather module relies on this setting variable to balance between noise reduction and responsiveness to scene changes. It is used in the temporal filtering process of the screen probe gathering, which is a crucial part of Lumen’s real-time global illumination calculations.
The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 0.9f and can be modified at runtime.
This variable interacts closely with GLumenScreenProbeTemporalMaxFastUpdateModeAmount, which is the associated C++ variable that directly holds the value set by the console variable.
Developers must be aware that:
- Higher values (closer to 1) will result in more noise but faster reaction to scene changes.
- Lower values will reduce noise but may cause slower updates to lighting changes in the scene.
- This setting affects the performance and visual quality of the Lumen global illumination system.
Best practices when using this variable include:
- Fine-tuning the value based on the specific needs of your scene. If your scene has many moving objects that affect lighting, you might want to use a higher value for more responsive updates.
- Balancing this setting with other Lumen settings to achieve the desired visual quality and performance.
- Testing the impact of different values in various scenarios to find the optimal setting for your game.
Regarding the associated variable GLumenScreenProbeTemporalMaxFastUpdateModeAmount:
This is the C++ variable that directly holds the value set by the r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount console variable. It is used in the actual rendering code to apply the setting during the screen probe gather process.
The value of GLumenScreenProbeTemporalMaxFastUpdateModeAmount is accessed in the UpdateHistoryScreenProbeGather function, which is part of the Lumen screen probe gather update process. This function uses the value to set the MaxFastUpdateModeAmount parameter in the rendering pass, directly influencing how the temporal filtering behaves for moving objects.
Developers should be aware that modifying GLumenScreenProbeTemporalMaxFastUpdateModeAmount directly in code is not recommended. Instead, they should use the console variable system to ensure proper synchronization and to allow for runtime adjustments.
#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:179
Scope: file
Source code excerpt:
float GLumenScreenProbeTemporalMaxFastUpdateModeAmount = .9f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalMaxFastUpdateModeAmount(
TEXT("r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount"),
GLumenScreenProbeTemporalMaxFastUpdateModeAmount,
TEXT("Maximum amount of fast-responding temporal filter to use when traces hit a moving object. Values closer to 1 cause more noise, but also faster reaction to scene changes."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeTemporalFastUpdateModeUseNeighborhoodClamp = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeTemporalMaxFastUpdateModeAmount
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:177
Scope: file
Source code excerpt:
);
float GLumenScreenProbeTemporalMaxFastUpdateModeAmount = .9f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalMaxFastUpdateModeAmount(
TEXT("r.Lumen.ScreenProbeGather.Temporal.MaxFastUpdateModeAmount"),
GLumenScreenProbeTemporalMaxFastUpdateModeAmount,
TEXT("Maximum amount of fast-responding temporal filter to use when traces hit a moving object. Values closer to 1 cause more noise, but also faster reaction to scene changes."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeTemporalFastUpdateModeUseNeighborhoodClamp = 0;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalFastUpdateModeUseNeighborhoodClamp(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1477
Scope (from outer to inner):
file
function void UpdateHistoryScreenProbeGather
lambda-function
Source code excerpt:
PassParameters->PrevSceneColorPreExposureCorrection = View.PreExposure / View.PrevViewInfo.SceneColorPreExposure;
PassParameters->InvFractionOfLightingMovingForFastUpdateMode = 1.0f / FMath::Max(GLumenScreenProbeFractionOfLightingMovingForFastUpdateMode, .001f);
PassParameters->MaxFastUpdateModeAmount = GLumenScreenProbeTemporalMaxFastUpdateModeAmount;
PassParameters->bIsSubstrateTileHistoryValid = bOverflowTileHistoryValid ? 1u : 0u;
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);