r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold
r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold
#Overview
name: r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold is to control the strength of the bilateral blur in the Lumen ReSTIR gather process. It is used in the rendering system, specifically in the Lumen global illumination pipeline.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s implemented in the LumenReSTIRGather.cpp file, which is part of the Renderer module.
The value of this variable is set to a default of 0.5f in the C++ code. It can be modified at runtime through the console variable system, as indicated by the FAutoConsoleVariableRef declaration.
The associated variable GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold directly interacts with this console variable. 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 quality and performance of the Lumen global illumination system. It determines the threshold at which pixels receive a stronger bilateral blur based on their variance from the spatial resolve filter.
Best practices when using this variable include:
- Adjusting it carefully to balance between image quality and performance.
- Testing different values in various lighting scenarios to find the optimal setting for your specific use case.
- Being mindful of its impact on overall rendering performance, especially on lower-end hardware.
Regarding the associated variable GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold:
The purpose of this variable is to store the actual value used in the rendering calculations. It’s directly tied to the console variable and is used in the implementation of the bilateral filter in the Lumen ReSTIR gather process.
This variable is used in the Lumen subsystem, specifically in the ReSTIR gather pass of the rendering pipeline.
Its value is set by the console variable r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold.
It interacts directly with the console variable of the same name, and is used in the FBilateralFilterCS shader as seen in the provided code excerpt.
Developers should be aware that modifying the console variable will directly affect this variable and, consequently, the rendering output.
Best practices include:
- Accessing this variable through the console variable system rather than modifying it directly in code.
- Considering its impact on shader performance when adjusting its value.
- Using it in conjunction with other Lumen settings for optimal results.
#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:245
Scope: file
Source code excerpt:
float GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold = .5f;
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold(
TEXT("r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold"),
GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold,
TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReSTIRGatherShortRangeAmbientOcclusion = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:243
Scope: file
Source code excerpt:
);
float GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold = .5f;
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold(
TEXT("r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold"),
GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold,
TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReSTIRGatherShortRangeAmbientOcclusion = 1;
FAutoConsoleVariableRef GVarLumenReSTIRGatherShortRangeAO(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReSTIRGather.cpp:1269
Scope (from outer to inner):
file
function FSSDSignalTextures FDeferredShadingSceneRenderer::RenderLumenReSTIRGather
Source code excerpt:
PassParameters->BilateralFilterDepthWeightScale = GLumenReSTIRGatherBilateralFilterDepthWeightScale;
PassParameters->BilateralFilterNormalAngleThresholdScale = GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale;
PassParameters->BilateralFilterStrongBlurVarianceThreshold = GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold;
PassParameters->View = View.ViewUniformBuffer;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);
FBilateralFilterCS::FPermutationDomain PermutationVector;
auto ComputeShader = View.ShaderMap->GetShader<FBilateralFilterCS>(PermutationVector);