r.Lumen.Reflections.RadianceCache.AngleThresholdScale
r.Lumen.Reflections.RadianceCache.AngleThresholdScale
#Overview
name: r.Lumen.Reflections.RadianceCache.AngleThresholdScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controls when the Radiance Cache is used for distant lighting. A value of 1 means only use the Radiance Cache when appropriate for the reflection cone, lower values are more aggressive.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.RadianceCache.AngleThresholdScale is to control when the Radiance Cache is used for distant lighting in Lumen reflections. It affects the aggressiveness of using the Radiance Cache for reflections.
This setting variable is primarily used in the Lumen Reflections subsystem of Unreal Engine’s rendering module. It’s specifically utilized in the reflection ray generation process.
The value of this variable is set through the console variable system, as evident from the FAutoConsoleVariableRef declaration. It can be modified at runtime using console commands or through project settings.
The associated variable GLumenReflectionRadianceCacheAngleThresholdScale interacts directly with this console variable. They share the same value and purpose.
Developers should be aware that:
- The default value is 1.0, which means the Radiance Cache is used only when appropriate for the reflection cone.
- Lower values result in more aggressive use of the Radiance Cache.
- The value is clamped between 0.05 and 4.0 in actual usage.
Best practices when using this variable include:
- Adjust it carefully to balance between performance and visual quality.
- Monitor its impact on reflection quality, especially for distant objects.
- Consider different values for different quality settings in your game.
Regarding GLumenReflectionRadianceCacheAngleThresholdScale: This is the C++ variable that directly holds the value set by the console variable. It’s used in the reflection generation process to determine when to use the Radiance Cache. The same considerations and best practices apply to this variable as to the console variable it’s associated with.
#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:52
Scope: file
Source code excerpt:
float GLumenReflectionRadianceCacheAngleThresholdScale = 1.0f;
FAutoConsoleVariableRef CVarLumenReflectionRadianceCacheAngleThresholdScale(
TEXT("r.Lumen.Reflections.RadianceCache.AngleThresholdScale"),
GLumenReflectionRadianceCacheAngleThresholdScale,
TEXT("Controls when the Radiance Cache is used for distant lighting. A value of 1 means only use the Radiance Cache when appropriate for the reflection cone, lower values are more aggressive."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionRadianceCacheReprojectionRadiusScale = 10.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionRadianceCacheAngleThresholdScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:50
Scope: file
Source code excerpt:
);
float GLumenReflectionRadianceCacheAngleThresholdScale = 1.0f;
FAutoConsoleVariableRef CVarLumenReflectionRadianceCacheAngleThresholdScale(
TEXT("r.Lumen.Reflections.RadianceCache.AngleThresholdScale"),
GLumenReflectionRadianceCacheAngleThresholdScale,
TEXT("Controls when the Radiance Cache is used for distant lighting. A value of 1 means only use the Radiance Cache when appropriate for the reflection cone, lower values are more aggressive."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionRadianceCacheReprojectionRadiusScale = 10.0f;
FAutoConsoleVariableRef CVarLumenReflectionRadianceCacheReprojectionRadiusScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1145
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
PassParameters->View = View.ViewUniformBuffer;
PassParameters->MaxTraceDistance = Lumen::GetMaxTraceDistance(View);
PassParameters->RadianceCacheAngleThresholdScale = FMath::Clamp<float>(GLumenReflectionRadianceCacheAngleThresholdScale, .05f, 4.0f);
PassParameters->GGXSamplingBias = GLumenReflectionGGXSamplingBias;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
PassParameters->ResolveIndirectArgsForRead = GraphBuilder.CreateSRV(ReflectionTileParameters.TracingIndirectArgs, PF_R32_UINT);
if (FrontLayerReflectionGBuffer)
{
PassParameters->FrontLayerTranslucencyGBufferParameters = *FrontLayerReflectionGBuffer;