r.LumenScene.SurfaceCache.CardMaxResolution
r.LumenScene.SurfaceCache.CardMaxResolution
#Overview
name: r.LumenScene.SurfaceCache.CardMaxResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Maximum card resolution in Lumen Scene
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.CardMaxResolution is to control the maximum card resolution in the Lumen Scene, which is part of Unreal Engine 5’s global illumination system.
This setting variable is primarily used in the rendering subsystem, specifically within the Lumen module. The Lumen system relies on this variable to determine the maximum resolution for scene cards, which are used in the surface cache for global illumination calculations.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 512 and can be modified at runtime or through configuration files.
The associated variable GLumenSceneCardMaxResolution directly interacts with r.LumenScene.SurfaceCache.CardMaxResolution. They share the same value, with GLumenSceneCardMaxResolution being the actual integer variable used in the C++ code.
Developers should be aware that this variable affects the quality and performance of the Lumen global illumination system. Higher values will result in higher quality lighting but may impact performance, especially on lower-end hardware.
Best practices when using this variable include:
- Adjusting it based on the target hardware capabilities.
- Balancing it with other Lumen settings for optimal performance and quality.
- Testing different values to find the sweet spot for your specific game or application.
- Considering scalability options, allowing users to adjust this setting based on their hardware.
Regarding the associated variable GLumenSceneCardMaxResolution:
The purpose of GLumenSceneCardMaxResolution is to store the maximum card resolution value for use in the Lumen Scene rendering code.
This variable is used directly in the rendering subsystem, specifically in the Lumen module of Unreal Engine 5.
Its value is set by the console variable r.LumenScene.SurfaceCache.CardMaxResolution, as seen in the provided code.
GLumenSceneCardMaxResolution interacts with other parts of the Lumen system, such as in the GetCardMaxResolution function, where it’s used to determine the actual maximum resolution, potentially halving it in fast camera mode.
Developers should be aware that modifying GLumenSceneCardMaxResolution directly in code is not recommended, as its value is controlled by the console variable system.
Best practices for GLumenSceneCardMaxResolution include:
- Using it for read-only operations in rendering code.
- Relying on the console variable system to modify its value rather than changing it directly.
- Considering its value when implementing new features or optimizations in the Lumen system.
#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:145
Scope: file
Source code excerpt:
int32 GLumenSceneCardMaxResolution = 512;
FAutoConsoleVariableRef CVarLumenSceneCardMaxResolution(
TEXT("r.LumenScene.SurfaceCache.CardMaxResolution"),
GLumenSceneCardMaxResolution,
TEXT("Maximum card resolution in Lumen Scene"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GSurfaceCacheNumFramesToKeepUnusedPages = 256;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSceneCardMaxResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:143
Scope: file
Source code excerpt:
);
int32 GLumenSceneCardMaxResolution = 512;
FAutoConsoleVariableRef CVarLumenSceneCardMaxResolution(
TEXT("r.LumenScene.SurfaceCache.CardMaxResolution"),
GLumenSceneCardMaxResolution,
TEXT("Maximum card resolution in Lumen Scene"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GSurfaceCacheNumFramesToKeepUnusedPages = 256;
FAutoConsoleVariableRef CVarLumenSceneSurfaceCacheNumFramesToKeepUnusedPages(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:244
Scope (from outer to inner):
file
function int32 GetCardMaxResolution
Source code excerpt:
if (GLumenFastCameraMode)
{
return GLumenSceneCardMaxResolution / 2;
}
return GLumenSceneCardMaxResolution;
}
int32 GetMaxLumenSceneCardCapturesPerFrame()
{
return FMath::Max(GLumenSceneCardCapturesPerFrame * (GLumenFastCameraMode ? 2 : 1), 0);
}