r.LumenScene.SurfaceCache.FarField.CardDistance
r.LumenScene.SurfaceCache.FarField.CardDistance
#Overview
name: r.LumenScene.SurfaceCache.FarField.CardDistance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Far Field Lumen card culling distance
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.FarField.CardDistance is to set the far field Lumen card culling distance in the Lumen scene rendering system. This setting is part of Unreal Engine 5’s Lumen global illumination system, which is responsible for real-time dynamic global illumination.
This setting variable is primarily used by the Lumen rendering subsystem within the Renderer module of Unreal Engine 5. It’s specifically related to the surface cache and far field rendering optimizations in the Lumen scene.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 40000.0 units, but can be changed at runtime or through configuration files.
The associated variable CVarLumenSceneFarFieldDistance directly interacts with r.LumenScene.SurfaceCache.FarField.CardDistance. They share the same value and purpose.
Developers must be aware that this variable affects the culling distance for far field Lumen cards. Adjusting this value will impact the rendering performance and visual quality of distant objects in the scene. A higher value will render far field cards at greater distances, potentially improving visual quality at the cost of performance. A lower value will cull far field cards earlier, potentially improving performance but reducing visual quality for distant objects.
Best practices when using this variable include:
- Balancing performance and visual quality based on the specific needs of the project.
- Testing different values to find the optimal setting for the target hardware and scene complexity.
- Considering scalability options, as this variable is marked with ECVF_Scalability flag.
- Being cautious when changing this value at runtime, as it may affect rendering performance.
Regarding the associated variable CVarLumenSceneFarFieldDistance:
The purpose of CVarLumenSceneFarFieldDistance is identical to r.LumenScene.SurfaceCache.FarField.CardDistance, as they share the same value and functionality.
This variable is used in the LumenScene class to retrieve the far field card max distance. It’s accessed through the GetFarFieldCardMaxDistance() function, which is likely called by other parts of the Lumen rendering system to determine culling distances for far field cards.
The value of CVarLumenSceneFarFieldDistance is set through the same console variable system as r.LumenScene.SurfaceCache.FarField.CardDistance.
Developers should be aware that changes to CVarLumenSceneFarFieldDistance will directly affect the behavior of the GetFarFieldCardMaxDistance() function, which may have cascading effects on the Lumen rendering pipeline.
Best practices for CVarLumenSceneFarFieldDistance are the same as those for r.LumenScene.SurfaceCache.FarField.CardDistance, as they are essentially the same variable accessed through different means.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:27
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenSceneFarFieldDistance(
TEXT("r.LumenScene.SurfaceCache.FarField.CardDistance"),
40000.00f,
TEXT("Far Field Lumen card culling distance"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarLumenSceneCardCaptureMargin(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneFarFieldDistance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:26
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarLumenSceneFarFieldDistance(
TEXT("r.LumenScene.SurfaceCache.FarField.CardDistance"),
40000.00f,
TEXT("Far Field Lumen card culling distance"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:91
Scope (from outer to inner):
file
function float LumenScene::GetFarFieldCardMaxDistance
Source code excerpt:
float LumenScene::GetFarFieldCardMaxDistance()
{
return CVarLumenSceneFarFieldDistance.GetValueOnRenderThread();
}
int32 LumenScene::GetCardMinResolution(bool bOrthographicCamera)
{
if (bOrthographicCamera)
{