r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius
r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius
#Overview
name: r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius is to control the influence radius for card interpolation in Lumen’s diffuse indirect lighting system. This setting is part of the Lumen global illumination system in Unreal Engine 5, specifically for the diffuse indirect lighting calculations.
This setting variable is primarily used in the Renderer module, particularly in the Lumen subsystem for diffuse indirect lighting calculations. It’s referenced in the LumenDiffuseIndirect.cpp file, which suggests it’s an important parameter for the Lumen diffuse indirect lighting pipeline.
The value of this variable is set through the Unreal Engine’s console variable system. It’s declared as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.
The variable interacts directly with GLumenDiffuseCardInterpolateInfluenceRadius, which is the C++ variable that stores the actual value. This association allows the engine to access the value efficiently during rendering.
Developers should be aware that this variable affects the interpolation of lighting information on Lumen’s card-based representation of the scene. The value is clamped between 0.01 and 1000.0, so any attempts to set it outside this range will be automatically limited to these bounds.
Best practices when using this variable include:
- Adjusting it carefully, as it can impact both visual quality and performance.
- Testing different values to find the optimal balance between quality and performance for your specific scene.
- Considering its interaction with other Lumen settings for best results.
Regarding the associated variable GLumenDiffuseCardInterpolateInfluenceRadius:
This is the actual C++ variable that stores the value of the console variable. It’s initialized with a default value of 10. The purpose of this variable is to provide fast access to the current value of the influence radius during the rendering process.
The variable is used directly in the SetupLumenDiffuseTracingParameters function, where it’s clamped to ensure it stays within the valid range before being assigned to the output parameters. This suggests that the value is critical for setting up the tracing parameters for Lumen’s diffuse indirect lighting calculations.
Developers should be aware that modifying this variable directly in C++ code is not recommended, as it may be overwritten by the console variable system. Instead, they should use the console variable r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius to change the value, which will ensure consistency across the engine.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:71
Scope: file
Source code excerpt:
float GLumenDiffuseCardInterpolateInfluenceRadius = 10;
FAutoConsoleVariableRef CVarDiffuseCardInterpolateInfluenceRadius(
TEXT("r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius"),
GLumenDiffuseCardInterpolateInfluenceRadius,
TEXT("."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GDiffuseCardTraceEndDistanceFromCamera = 4000.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenDiffuseCardInterpolateInfluenceRadius
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:69
Scope: file
Source code excerpt:
);
float GLumenDiffuseCardInterpolateInfluenceRadius = 10;
FAutoConsoleVariableRef CVarDiffuseCardInterpolateInfluenceRadius(
TEXT("r.Lumen.DiffuseIndirect.CardInterpolateInfluenceRadius"),
GLumenDiffuseCardInterpolateInfluenceRadius,
TEXT("."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GDiffuseCardTraceEndDistanceFromCamera = 4000.0f;
FAutoConsoleVariableRef CVarDiffuseCardTraceEndDistanceFromCamera(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:318
Scope (from outer to inner):
file
function void SetupLumenDiffuseTracingParameters
Source code excerpt:
}
OutParameters.SurfaceBias = FMath::Clamp(GLumenGatherCvars.SurfaceBias, .01f, 100.0f);
OutParameters.CardInterpolateInfluenceRadius = FMath::Clamp(GLumenDiffuseCardInterpolateInfluenceRadius, .01f, 1000.0f);
OutParameters.HeightfieldMaxTracingSteps = Lumen::GetHeightfieldMaxTracingSteps();
//@todo - remove
OutParameters.DiffuseConeHalfAngle = 0.1f;
OutParameters.TanDiffuseConeHalfAngle = FMath::Tan(OutParameters.DiffuseConeHalfAngle);
OutParameters.SpecularFromDiffuseRoughnessStart = 0.0f;
OutParameters.SpecularFromDiffuseRoughnessEnd = 0.0f;