r.Lumen.ReSTIRGather.BilateralFilter.NumSamples
r.Lumen.ReSTIRGather.BilateralFilter.NumSamples
#Overview
name: r.Lumen.ReSTIRGather.BilateralFilter.NumSamples
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of bilateral filter samples.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ReSTIRGather.BilateralFilter.NumSamples is to control the number of bilateral filter samples used in the Lumen ReSTIR (Resampled Importance Sampling for Real-Time Ray Tracing) gather process. This setting is part of the rendering system, specifically the Lumen global illumination system in Unreal Engine 5.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It is referenced in the LumenReSTIRGather.cpp file, which is part of the Renderer module.
The value of this variable is set through the engine’s console variable system. It’s initialized with a default value of 8 and can be modified at runtime or through configuration files.
The associated variable GLumenReSTIRGatherBilateralFilterNumSamples directly interacts with this setting. It’s the internal representation of the console variable and is used in the actual rendering code.
Developers should be aware that this variable affects the quality and performance of the Lumen ReSTIR gather process. A higher number of samples can potentially improve the quality of the global illumination but at the cost of increased computational overhead.
Best practices when using this variable include:
- Balancing quality and performance by adjusting the number of samples based on the specific needs of the scene and target hardware.
- Testing different values to find the optimal setting for your specific use case.
- Considering this setting in conjunction with other Lumen-related variables for a holistic approach to global illumination quality and performance.
Regarding the associated variable GLumenReSTIRGatherBilateralFilterNumSamples:
- Its purpose is to store the actual value used in the rendering code.
- It’s used directly in the RenderLumenReSTIRGather function of the FDeferredShadingSceneRenderer class.
- Its value is set by the console variable system and can be modified at runtime.
- It interacts directly with the shader parameters, affecting the bilateral filtering process in the Lumen ReSTIR gather.
- Developers should be aware that changes to this variable will directly affect the rendering process.
- Best practices include ensuring that any custom code that might modify this variable does so thread-safely, as it’s used in render thread operations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:221
Scope: file
Source code excerpt:
int32 GLumenReSTIRGatherBilateralFilterNumSamples = 8;
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNumSamples(
TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NumSamples"),
GLumenReSTIRGatherBilateralFilterNumSamples,
TEXT("Number of bilateral filter samples."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReSTIRGatherBilateralFilterDepthWeightScale = 10000.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReSTIRGatherBilateralFilterNumSamples
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:219
Scope: file
Source code excerpt:
);
int32 GLumenReSTIRGatherBilateralFilterNumSamples = 8;
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNumSamples(
TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NumSamples"),
GLumenReSTIRGatherBilateralFilterNumSamples,
TEXT("Number of bilateral filter samples."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReSTIRGatherBilateralFilterDepthWeightScale = 10000.0f;
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterDepthWeightScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:1266
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenReSTIRGather
Source code excerpt:
PassParameters->ResolveVariance = ResolveVariance;
PassParameters->BilateralFilterSpatialKernelRadius = GLumenReSTIRGatherBilateralFilterSpatialKernelRadius;
PassParameters->BilateralFilterNumSamples = GLumenReSTIRGatherBilateralFilterNumSamples;
PassParameters->BilateralFilterDepthWeightScale = GLumenReSTIRGatherBilateralFilterDepthWeightScale;
PassParameters->BilateralFilterNormalAngleThresholdScale = GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale;
PassParameters->BilateralFilterStrongBlurVarianceThreshold = GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold;
PassParameters->View = View.ViewUniformBuffer;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);