r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving
r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving
#Overview
name: r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving is to control the sensitivity of Lumen’s screen probe gather system to changes in lighting conditions based on relative speed differences.
This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically within the screen probe gather subsystem. It is used in the rendering module, as evidenced by its location in the LumenScreenProbeGather.cpp file.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a float with a default value of 0.005f. The variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating that it can be adjusted for performance scaling and is safe to modify from the render thread.
This variable interacts directly with its associated C++ variable GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving. They share the same value, with the console variable acting as an interface for runtime modification.
Developers should be aware that this variable affects the temporal stability of Lumen’s lighting. A lower value will make the system more sensitive to small changes in relative speed, potentially causing more frequent updates to lighting calculations. Conversely, a higher value will make the system more stable but potentially less responsive to small movements.
Best practices when using this variable include:
- Carefully tuning it based on the specific needs of your scene and desired performance characteristics.
- Testing across a range of scenarios to ensure it provides a good balance between lighting responsiveness and stability.
- Considering its impact on overall performance, as more frequent lighting updates can be computationally expensive.
Regarding the associated variable GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving:
This C++ variable directly stores the value set by the console variable. It’s used within the RenderLumenScreenProbeGather function to set the RelativeSpeedDifferenceToConsiderLightingMoving parameter of the ScreenProbeParameters struct. This suggests that the value is used in calculations determining when to update lighting based on relative speed changes in the scene.
Developers should note that modifying this variable directly in code will be overridden by any console commands that set the associated console variable. Therefore, it’s generally better to use the console variable for runtime adjustments and only modify the C++ variable if you need to change the default value in the engine source.
#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:202
Scope: file
Source code excerpt:
float GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving = .005f;
FAutoConsoleVariableRef CVarLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving(
TEXT("r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving"),
GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenScreenProbeTemporalMaxFramesAccumulated = 10.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:200
Scope: file
Source code excerpt:
);
float GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving = .005f;
FAutoConsoleVariableRef CVarLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving(
TEXT("r.Lumen.ScreenProbeGather.Temporal.RelativeSpeedDifferenceToConsiderLightingMoving"),
GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenScreenProbeTemporalMaxFramesAccumulated = 10.0f;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalMaxFramesAccumulated(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1877
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenScreenProbeGather
Source code excerpt:
ScreenProbeParameters.ScreenProbeGatherMaxMip = GLumenScreenProbeGatherNumMips - 1;
ScreenProbeParameters.RelativeSpeedDifferenceToConsiderLightingMoving = GLumenScreenProbeRelativeSpeedDifferenceToConsiderLightingMoving;
ScreenProbeParameters.ScreenTraceNoFallbackThicknessScale = (Lumen::UseHardwareRayTracedScreenProbeGather(ViewFamily) ? 1.0f : GLumenScreenProbeScreenTracesThicknessScaleWhenNoFallback) * View.ViewMatrices.GetPerProjectionDepthThicknessScale();
ScreenProbeParameters.NumUniformScreenProbes = ScreenProbeParameters.ScreenProbeViewSize.X * ScreenProbeParameters.ScreenProbeViewSize.Y;
ScreenProbeParameters.MaxNumAdaptiveProbes = FMath::TruncToInt(ScreenProbeParameters.NumUniformScreenProbes * GLumenScreenProbeGatherAdaptiveProbeAllocationFraction);
ScreenProbeParameters.FixedJitterIndex = GLumenScreenProbeFixedJitterIndex;