r.LumenScene.SurfaceCache.CardMinResolution
r.LumenScene.SurfaceCache.CardMinResolution
#Overview
name: r.LumenScene.SurfaceCache.CardMinResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Minimum mesh card size resolution to be visible in Lumen Scene
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.CardMinResolution is to set the minimum mesh card size resolution that will be visible in the Lumen Scene. This setting is part of Unreal Engine 5’s Lumen global illumination system, which is a key component of the rendering system.
This setting variable is primarily used by the Lumen subsystem within the Unreal Engine 5 renderer module. It’s specifically utilized in the GPU-driven update process for Lumen scenes, as evidenced by its presence in the LumenSceneGPUDrivenUpdate.cpp file.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 4, but can be changed at runtime or through configuration files.
The associated variable CVarLumenSceneCardMinResolution directly interacts with r.LumenScene.SurfaceCache.CardMinResolution. They share the same value and purpose.
Developers must be aware that this variable affects the visibility of mesh cards in the Lumen Scene. A higher value might improve performance but could potentially reduce visual quality, especially for smaller details in the scene.
Best practices when using this variable include:
- Balancing between performance and visual quality.
- Testing different values to find the optimal setting for your specific scene.
- Considering the scale and detail level of your scene when adjusting this value.
- Being mindful that very low values might impact performance, while very high values might cause loss of detail.
Regarding the associated variable CVarLumenSceneCardMinResolution:
The purpose of CVarLumenSceneCardMinResolution is identical to r.LumenScene.SurfaceCache.CardMinResolution. It’s the C++ representation of the console variable in the engine’s code.
This variable is used directly in the Lumen scene subsystem, specifically in the GetCardMinResolution function of the LumenScene class.
The value is set at initialization but can be modified at runtime using the console command system.
CVarLumenSceneCardMinResolution interacts directly with the Lumen scene update process, influencing which mesh cards are considered for visibility.
Developers should be aware that changes to this variable will take effect on the render thread, as indicated by the GetValueOnRenderThread() call.
Best practices include using this variable for fine-tuning performance and visual quality in the editor or during development, and potentially exposing it as a scalability option for end-users if appropriate for your project.
#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:6
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarLumenSceneCardMinResolution(
TEXT("r.LumenScene.SurfaceCache.CardMinResolution"),
4,
TEXT("Minimum mesh card size resolution to be visible in Lumen Scene"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarLumenSceneCardTexelDensityScale(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneCardMinResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:5
Scope: file
Source code excerpt:
#include "LumenSceneData.h"
static TAutoConsoleVariable<int> CVarLumenSceneCardMinResolution(
TEXT("r.LumenScene.SurfaceCache.CardMinResolution"),
4,
TEXT("Minimum mesh card size resolution to be visible in Lumen Scene"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneGPUDrivenUpdate.cpp:104
Scope (from outer to inner):
file
function int32 LumenScene::GetCardMinResolution
Source code excerpt:
}
}
return FMath::Clamp(CVarLumenSceneCardMinResolution.GetValueOnRenderThread(), 1, 1024);
}
FLumenSceneReadback::FLumenSceneReadback()
{
ReadbackBuffers.AddDefaulted(MaxReadbackBuffers);
}