r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
#Overview
name: r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
In Degrees. Larger angles allow filtering of nearby features but more leaking.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
is to control the spatial filtering of the Lumen Radiance Cache system in Unreal Engine 5’s rendering pipeline. It specifically sets the maximum angle (in degrees) for filtering radiance hits during the spatial filtering process.
This setting variable is primarily used by the Lumen subsystem, which is part of Unreal Engine 5’s global illumination and rendering system. Based on the callsites, it’s clear that this variable is utilized within the Lumen Radiance Cache module.
The value of this variable is set through the Unreal Engine’s console variable system. It’s initialized with a default value of 0.2 degrees and can be modified at runtime or through configuration files.
The associated variable GLumenRadianceCacheFilterMaxRadianceHitAngle
directly interacts with this console variable. It’s the C++ variable that stores the actual value used in the rendering code.
Developers should be aware that this variable affects the balance between filtering nearby features and potential light leaking. A larger angle allows for more filtering of nearby features but may introduce more light leaking.
Best practices when using this variable include:
- Fine-tuning the value based on the specific scene and desired visual quality.
- Being cautious when increasing the value, as it may introduce unwanted light leaking.
- Testing different values to find the optimal balance between filtering and accuracy for your specific use case.
Regarding the associated variable GLumenRadianceCacheFilterMaxRadianceHitAngle
:
The purpose of GLumenRadianceCacheFilterMaxRadianceHitAngle
is to store the actual value of the maximum radiance hit angle used in the Lumen Radiance Cache filtering process.
This variable is used directly in the Lumen Radiance Cache subsystem of Unreal Engine 5’s rendering pipeline. It’s referenced in the UpdateRadianceCaches
function within the LumenRadianceCache
namespace.
The value of this variable is set by the console variable system through the r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
command.
This variable directly interacts with the console variable r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle
, serving as its in-memory representation.
Developers should be aware that modifying this variable directly in code is not recommended, as it’s intended to be controlled via the console variable system.
Best practices for this variable include:
- Accessing its value through the appropriate Unreal Engine API calls rather than directly.
- Treating it as read-only in most scenarios, allowing the console variable system to manage its value.
- Using it in rendering code where the maximum radiance hit angle for spatial filtering needs to be applied.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCache.cpp:68
Scope: file
Source code excerpt:
float GLumenRadianceCacheFilterMaxRadianceHitAngle = .2f;
FAutoConsoleVariableRef GVarLumenRadianceCacheFilterMaxRadianceHitAngle(
TEXT("r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle"),
GLumenRadianceCacheFilterMaxRadianceHitAngle,
TEXT("In Degrees. Larger angles allow filtering of nearby features but more leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheForceUniformTraceTileLevel = -1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCacheFilterMaxRadianceHitAngle
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCache.cpp:66
Scope: file
Source code excerpt:
);
float GLumenRadianceCacheFilterMaxRadianceHitAngle = .2f;
FAutoConsoleVariableRef GVarLumenRadianceCacheFilterMaxRadianceHitAngle(
TEXT("r.Lumen.RadianceCache.SpatialFilterMaxRadianceHitAngle"),
GLumenRadianceCacheFilterMaxRadianceHitAngle,
TEXT("In Degrees. Larger angles allow filtering of nearby features but more leaking."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenRadianceCacheForceUniformTraceTileLevel = -1;
FAutoConsoleVariableRef CVarLumenRadianceCacheForceUniformTraceTileLevel(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCache.cpp:2086
Scope (from outer to inner):
file
namespace LumenRadianceCache
function void UpdateRadianceCaches
Source code excerpt:
PassParameters->RadianceCacheParameters = RadianceCacheParameters;
PassParameters->FilterProbesIndirectArgs = FilterProbesIndirectArgs[RadianceCacheIndex];
PassParameters->SpatialFilterMaxRadianceHitAngle = GLumenRadianceCacheFilterMaxRadianceHitAngle;
auto ComputeShader = View.ShaderMap->GetShader<FFilterProbeRadianceWithGatherCS>(0);
FComputeShaderUtils::AddPass(
GraphBuilder,
RDG_EVENT_NAME("FilterProbeRadiance Res=%ux%u", RadianceCacheInputs.RadianceProbeResolution, RadianceCacheInputs.RadianceProbeResolution),