r.Lumen.Reflections.BilateralFilter.StrongBlurVarianceThreshold
r.Lumen.Reflections.BilateralFilter.StrongBlurVarianceThreshold
#Overview
name: r.Lumen.Reflections.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.Reflections.BilateralFilter.StrongBlurVarianceThreshold is to control the threshold for applying a stronger bilateral blur in Lumen reflections. This setting is part of the rendering system, specifically the Lumen global illumination and reflection system in Unreal Engine 5.
This setting variable is primarily used in the Lumen Reflections subsystem of Unreal Engine’s rendering module. It’s referenced in the LumenReflections.cpp file, which is part of the Renderer module.
The value of this variable is set through the console variable system. It’s initialized with a default value of 0.5f and can be modified at runtime using the console command system.
The associated variable GLumenReflectionBilateralFilterStrongBlurVarianceThreshold directly interacts with this setting. 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 visual quality and performance of Lumen reflections. It determines when a stronger bilateral blur is applied to pixels based on their variance from the spatial resolve filter. A lower threshold will result in more pixels receiving the stronger blur, potentially smoothing out noise but also potentially reducing detail.
Best practices when using this variable include:
- Experimenting with different values to find the right balance between noise reduction and detail preservation for your specific scene.
- Considering the performance impact of lower thresholds, as they may result in more pixels being processed with the stronger blur.
- Using this in conjunction with other Lumen reflection settings for optimal results.
Regarding the associated variable GLumenReflectionBilateralFilterStrongBlurVarianceThreshold:
The purpose of this variable is to store the actual value used in the rendering calculations. It’s directly linked to the console variable and is used in the Lumen reflection rendering process.
This variable is used in the FDeferredShadingSceneRenderer::RenderLumenReflections function, which is part of the core Lumen reflection rendering pipeline. It’s passed as a parameter to the rendering pass, influencing how the bilateral filter is applied to the reflections.
The value of this variable is set by the console variable system, allowing for dynamic adjustment during runtime or through configuration files.
Developers should be aware that modifying this variable directly in code won’t have a lasting effect, as it’s controlled by the console variable system. Always use the console variable (r.Lumen.Reflections.BilateralFilter.StrongBlurVarianceThreshold) to make persistent changes.
Best practices include using this variable in conjunction with other Lumen reflection parameters for fine-tuning the reflection quality and performance in your game or application.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:238
Scope: file
Source code excerpt:
float GLumenReflectionBilateralFilterStrongBlurVarianceThreshold = .5f;
FAutoConsoleVariableRef CVarLumenReflectionBilateralFilterStrongBlurVarianceThreshold(
TEXT("r.Lumen.Reflections.BilateralFilter.StrongBlurVarianceThreshold"),
GLumenReflectionBilateralFilterStrongBlurVarianceThreshold,
TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionsVisualizeTracingCoherency = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionBilateralFilterStrongBlurVarianceThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:236
Scope: file
Source code excerpt:
);
float GLumenReflectionBilateralFilterStrongBlurVarianceThreshold = .5f;
FAutoConsoleVariableRef CVarLumenReflectionBilateralFilterStrongBlurVarianceThreshold(
TEXT("r.Lumen.Reflections.BilateralFilter.StrongBlurVarianceThreshold"),
GLumenReflectionBilateralFilterStrongBlurVarianceThreshold,
TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionsVisualizeTracingCoherency = 0;
FAutoConsoleVariableRef GVarLumenReflectionsVisualizeTracingCoherency(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1318
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
PassParameters->BilateralFilterDepthWeightScale = GLumenReflectionBilateralFilterDepthWeightScale;
PassParameters->BilateralFilterNormalAngleThresholdScale = GLumenReflectionBilateralFilterNormalAngleThresholdScale;
PassParameters->BilateralFilterStrongBlurVarianceThreshold = GLumenReflectionBilateralFilterStrongBlurVarianceThreshold;
PassParameters->View = View.ViewUniformBuffer;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);
PassParameters->ReflectionTracingParameters = ReflectionTracingParameters;
PassParameters->ReflectionTileParameters = ReflectionTileParameters;
if (FrontLayerReflectionGBuffer)