r.Lumen.ScreenProbeGather.ImportanceSample.HistoryDistanceThreshold
r.Lumen.ScreenProbeGather.ImportanceSample.HistoryDistanceThreshold
#Overview
name: r.Lumen.ScreenProbeGather.ImportanceSample.HistoryDistanceThreshold
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.ImportanceSample.HistoryDistanceThreshold is to control the distance threshold for importance sampling in Lumen’s screen probe gathering process. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically related to the screen probe gathering and importance sampling techniques.
This setting variable is primarily used in the Lumen rendering subsystem, which is a part of Unreal Engine 5’s advanced rendering capabilities. Based on the callsites, it’s clear that this variable is utilized in the LumenScreenProbeImportanceSampling module.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 30 and can be modified at runtime using the console command system.
The associated variable GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold directly interacts with this console variable. They share the same value, with the console variable acting as an interface for adjusting the value at runtime.
Developers should be aware that this variable affects the performance and quality of Lumen’s global illumination system. Adjusting this threshold can impact how the system determines the relevance of historical data in the screen probe gathering process.
Best practices when using this variable include:
- Carefully tuning the value to balance performance and visual quality.
- Testing different values in various scenarios to understand its impact on your specific scenes.
- Considering the relationship between this variable and other Lumen settings for optimal results.
Regarding the associated variable GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold:
- Its purpose is to store the actual value used in the rendering calculations.
- It’s used directly in the GenerateImportanceSamplingRays function, indicating its role in the ray generation process for importance sampling.
- The value is set by the console variable and can be accessed throughout the rendering pipeline where needed.
- Developers should treat this as an internal variable and modify its value through the console variable rather than directly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeImportanceSampling.cpp:64
Scope: file
Source code excerpt:
float GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold = 30;
FAutoConsoleVariableRef CVarLumenScreenProbeImportanceSamplingHistoryDistanceThreshold(
TEXT("r.Lumen.ScreenProbeGather.ImportanceSample.HistoryDistanceThreshold"),
GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold,
TEXT(""),
ECVF_RenderThreadSafe
);
extern int32 GLumenScreenProbeGatherReferenceMode;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeImportanceSampling.cpp:62
Scope: file
Source code excerpt:
);
float GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold = 30;
FAutoConsoleVariableRef CVarLumenScreenProbeImportanceSamplingHistoryDistanceThreshold(
TEXT("r.Lumen.ScreenProbeGather.ImportanceSample.HistoryDistanceThreshold"),
GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold,
TEXT(""),
ECVF_RenderThreadSafe
);
extern int32 GLumenScreenProbeGatherReferenceMode;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeImportanceSampling.cpp:342
Scope (from outer to inner):
file
function void GenerateImportanceSamplingRays
Source code excerpt:
(ScreenProbeGatherState.ProbeHistoryViewRect.Max.Y - 0.5f) * InvBufferSize.Y);
PassParameters->ImportanceSamplingHistoryDistanceThreshold = GLumenScreenProbeImportanceSamplingHistoryDistanceThreshold;
PassParameters->HistoryScreenProbeRadiance = GraphBuilder.RegisterExternalTexture(ScreenProbeGatherState.ImportanceSamplingHistoryScreenProbeRadiance);
PassParameters->HistoryScreenProbeSceneDepth = GraphBuilder.RegisterExternalTexture(ScreenProbeGatherState.HistoryScreenProbeSceneDepth);
PassParameters->HistoryScreenProbeTranslatedWorldPosition = GraphBuilder.RegisterExternalTexture(ScreenProbeGatherState.HistoryScreenProbeTranslatedWorldPosition);
}
const uint32 ComputeLightingPDFGroupSize = FScreenProbeComputeLightingProbabilityDensityFunctionCS::GetThreadGroupSize(ScreenProbeParameters.ScreenProbeTracingOctahedronResolution);