r.LumenScene.SurfaceCache.RemovesPerFrame
r.LumenScene.SurfaceCache.RemovesPerFrame
#Overview
name: r.LumenScene.SurfaceCache.RemovesPerFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How many mesh cards removes can be done per frame.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.RemovesPerFrame is to control the number of mesh card removals that can be performed per frame in the Lumen scene rendering system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically related to the surface cache management.
This setting variable is primarily used in the Lumen scene rendering subsystem, which is part of Unreal Engine 5’s rendering module. It’s referenced in the LumenSceneRendering.cpp file, indicating its importance in the Lumen scene rendering process.
The value of this variable is set as a console variable with a default value of 512. It can be modified at runtime through the console or configuration files.
The associated C++ variable CVarLumenSceneSurfaceCacheRemovesPerFrame interacts directly with this setting. It’s used to retrieve the current value of the setting in the GetMaxMeshCardsRemovesPerFrame() function.
Developers should be aware that this variable affects the performance and quality trade-off in Lumen scene rendering. A higher value allows more mesh card removals per frame, which can improve memory usage but may impact performance if set too high.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Monitoring performance impacts when modifying this value.
- Considering the balance between memory usage and rendering performance.
Regarding the associated variable CVarLumenSceneSurfaceCacheRemovesPerFrame:
The purpose of CVarLumenSceneSurfaceCacheRemovesPerFrame is to provide programmatic access to the r.LumenScene.SurfaceCache.RemovesPerFrame setting within the C++ code.
This variable is used in the Lumen scene rendering subsystem of Unreal Engine 5’s rendering module.
The value of this variable is set when the console variable is created, mirroring the value of r.LumenScene.SurfaceCache.RemovesPerFrame.
It interacts directly with the r.LumenScene.SurfaceCache.RemovesPerFrame setting and is used in the GetMaxMeshCardsRemovesPerFrame() function to retrieve the current value.
Developers should be aware that this variable provides thread-safe access to the setting value on the render thread.
Best practices when using this variable include:
- Using it to read the current value of the setting in render thread code.
- Avoiding direct modification of this variable; instead, modify the console variable r.LumenScene.SurfaceCache.RemovesPerFrame.
- Consider caching the value if it’s accessed frequently in performance-critical code paths.
#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:107
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarLumenSceneSurfaceCacheRemovesPerFrame(
TEXT("r.LumenScene.SurfaceCache.RemovesPerFrame"),
512,
TEXT("How many mesh cards removes can be done per frame."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarLumenSceneCardCaptureRefreshFraction(
TEXT("r.LumenScene.SurfaceCache.CardCaptureRefreshFraction"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneSurfaceCacheRemovesPerFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:106
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarLumenSceneSurfaceCacheRemovesPerFrame(
TEXT("r.LumenScene.SurfaceCache.RemovesPerFrame"),
512,
TEXT("How many mesh cards removes can be done per frame."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarLumenSceneCardCaptureRefreshFraction(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:264
Scope (from outer to inner):
file
namespace LumenScene
function int32 GetMaxMeshCardsRemovesPerFrame
Source code excerpt:
int32 GetMaxMeshCardsRemovesPerFrame()
{
return FMath::Max(CVarLumenSceneSurfaceCacheRemovesPerFrame.GetValueOnRenderThread(), 0);
}
}
int32 GetMaxTileCapturesPerFrame()
{
if (Lumen::IsSurfaceCacheFrozen())