r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius
r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius
#Overview
name: r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Screen space reflection filter kernel radius in pixels
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius is to control the kernel radius for screen space reflection reconstruction in the Lumen rendering system of Unreal Engine 5. This setting is specifically used in the Lumen reflections subsystem.
The Unreal Engine subsystem that relies on this setting variable is the Lumen rendering system, particularly the Lumen reflections module. This can be inferred from the file location (LumenReflections.cpp) and the variable name itself.
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 8.0 pixels and can be modified at runtime.
This variable interacts directly with GLumenReflectionScreenSpaceReconstructionKernelRadius, which is the C++ variable that stores the actual value. They share the same value, with the console variable providing an interface for runtime modification.
Developers must be aware that this variable affects the quality and performance of screen space reflections in Lumen. A larger kernel radius may provide better quality reflections but at the cost of increased computational overhead.
Best practices when using this variable include:
- Balancing between quality and performance based on the target hardware.
- Testing different values to find the optimal setting for specific scenes.
- Considering the impact on different types of surfaces and materials in the scene.
Regarding the associated variable GLumenReflectionScreenSpaceReconstructionKernelRadius:
The purpose of GLumenReflectionScreenSpaceReconstructionKernelRadius is to store the actual value of the kernel radius used in the screen space reflection reconstruction process.
This variable is used directly in the Lumen reflection rendering code, specifically in the RenderLumenReflections function of the FDeferredShadingSceneRenderer class.
The value of this variable is set by the console variable r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius.
It interacts with other parameters in the reflection rendering process, such as NumSpatialReconstructionSamples and SpatialReconstructionRoughnessScale.
Developers should be aware that modifying this variable directly in code will not persist across sessions or be controllable through the console variable system. It’s best to modify the CVar instead.
Best practices for this variable include:
- Avoiding direct modification in code unless absolutely necessary.
- Using it in conjunction with other Lumen reflection parameters for optimal results.
- Profiling the impact of different values on both visual quality and performance.
#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:174
Scope: file
Source code excerpt:
float GLumenReflectionScreenSpaceReconstructionKernelRadius = 8.0;
FAutoConsoleVariableRef CVarLumenReflectionScreenSpaceReconstructionKernelScreenWidth(
TEXT("r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius"),
GLumenReflectionScreenSpaceReconstructionKernelRadius,
TEXT("Screen space reflection filter kernel radius in pixels"),
ECVF_RenderThreadSafe
);
float GLumenReflectionScreenSpaceReconstructionRoughnessScale = 1.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionScreenSpaceReconstructionKernelRadius
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:172
Scope: file
Source code excerpt:
);
float GLumenReflectionScreenSpaceReconstructionKernelRadius = 8.0;
FAutoConsoleVariableRef CVarLumenReflectionScreenSpaceReconstructionKernelScreenWidth(
TEXT("r.Lumen.Reflections.ScreenSpaceReconstruction.KernelRadius"),
GLumenReflectionScreenSpaceReconstructionKernelRadius,
TEXT("Screen space reflection filter kernel radius in pixels"),
ECVF_RenderThreadSafe
);
float GLumenReflectionScreenSpaceReconstructionRoughnessScale = 1.0f;
FAutoConsoleVariableRef CVarLumenReflectionScreenSpaceReconstructionRoughnessScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1244
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
PassParameters->RWResolveVariance = GraphBuilder.CreateUAV(FRDGTextureUAVDesc(ResolveVariance));
PassParameters->NumSpatialReconstructionSamples = NumReconstructionSamples;
PassParameters->SpatialReconstructionKernelRadius = GLumenReflectionScreenSpaceReconstructionKernelRadius;
PassParameters->SpatialReconstructionRoughnessScale = GLumenReflectionScreenSpaceReconstructionRoughnessScale;
PassParameters->SpatialResolveTonemapStrength = GLumenReflectionSpatialResolveTonemapStrength;
PassParameters->ReflectionTracingParameters = ReflectionTracingParameters;
PassParameters->View = View.ViewUniformBuffer;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;