r.LumenScene.SurfaceCache.CardCapturesPerFrame
r.LumenScene.SurfaceCache.CardCapturesPerFrame
#Overview
name: r.LumenScene.SurfaceCache.CardCapturesPerFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.CardCapturesPerFrame is to control the number of card captures per frame in the Lumen Scene Surface Cache system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically the surface cache component used for real-time lighting calculations.
This setting variable is primarily used in the Renderer module, specifically within the Lumen subsystem. It’s utilized in the LumenSceneRendering.cpp file, which is responsible for rendering Lumen scenes.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.
The associated variable GLumenSceneCardCapturesPerFrame directly interacts with r.LumenScene.SurfaceCache.CardCapturesPerFrame. They share the same value, with GLumenSceneCardCapturesPerFrame being the actual integer variable used in the code.
Developers should be aware that this variable affects performance and quality trade-offs in the Lumen lighting system. A higher value may provide more accurate lighting updates but at the cost of performance.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Monitoring performance impacts when changing this value.
- Considering it in conjunction with other Lumen settings for optimal results.
Regarding the associated variable GLumenSceneCardCapturesPerFrame:
The purpose of GLumenSceneCardCapturesPerFrame is to store the actual integer value used in the code for the number of card captures per frame in the Lumen Scene Surface Cache system.
This variable is used directly in the Renderer module, specifically in the Lumen subsystem within LumenSceneRendering.cpp.
Its value is set by the r.LumenScene.SurfaceCache.CardCapturesPerFrame console variable.
GLumenSceneCardCapturesPerFrame interacts with other parts of the Lumen system, such as in the GetMaxLumenSceneCardCapturesPerFrame() function, where it’s multiplied by 2 if GLumenFastCameraMode is true.
Developers should be aware that modifying this variable directly in code (rather than through the console variable) may lead to inconsistencies with the engine’s configuration system.
Best practices include using the console variable (r.LumenScene.SurfaceCache.CardCapturesPerFrame) to modify this value rather than changing it directly in code, unless there’s a specific need to do so.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:92
Scope: file
Source code excerpt:
int32 GLumenSceneCardCapturesPerFrame = 300;
FAutoConsoleVariableRef CVarLumenSceneCardCapturesPerFrame(
TEXT("r.LumenScene.SurfaceCache.CardCapturesPerFrame"),
GLumenSceneCardCapturesPerFrame,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenSceneCardCaptureFactor = 64;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSceneCardCapturesPerFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:90
Scope: file
Source code excerpt:
);
int32 GLumenSceneCardCapturesPerFrame = 300;
FAutoConsoleVariableRef CVarLumenSceneCardCapturesPerFrame(
TEXT("r.LumenScene.SurfaceCache.CardCapturesPerFrame"),
GLumenSceneCardCapturesPerFrame,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenSceneCardCaptureFactor = 64;
FAutoConsoleVariableRef CVarLumenSceneCardCaptureFactor(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:252
Scope (from outer to inner):
file
function int32 GetMaxLumenSceneCardCapturesPerFrame
Source code excerpt:
int32 GetMaxLumenSceneCardCapturesPerFrame()
{
return FMath::Max(GLumenSceneCardCapturesPerFrame * (GLumenFastCameraMode ? 2 : 1), 0);
}
namespace LumenScene
{
int32 GetMaxMeshCardsToAddPerFrame()
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:1194
Scope (from outer to inner):
file
function void UpdateSurfaceCacheMeshCards
Source code excerpt:
if (SurfaceCacheRequestsCount >= GetMaxLumenSceneCardCapturesPerFrame())
{
LastBucketRequestCount = GLumenSceneCardCapturesPerFrame - (SurfaceCacheRequestsCount - RequestHistogram[LastBucketIndex]);
SurfaceCacheRequestsCount = GLumenSceneCardCapturesPerFrame;
break;
}
}
if (SurfaceCacheRequestsCount == 0)
{