r.LumenScene.SurfaceCache.Feedback.UniqueElements
r.LumenScene.SurfaceCache.Feedback.UniqueElements
#Overview
name: r.LumenScene.SurfaceCache.Feedback.UniqueElements
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Limit of unique surface cache feedback elements. Used to resize buffers.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.Feedback.UniqueElements is to limit the number of unique surface cache feedback elements in Unreal Engine 5’s Lumen lighting system. It is used to control the size of buffers in the Lumen surface cache feedback mechanism.
This setting variable is primarily used by the Lumen rendering system, which is part of Unreal Engine 5’s global illumination solution. Specifically, it’s utilized in the surface cache feedback component of Lumen.
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.
This variable directly interacts with GLumenSurfaceCacheFeedbackMaxUniqueElements, which is an integer variable that holds the actual value. They share the same value, with GLumenSurfaceCacheFeedbackMaxUniqueElements being the C++ variable used in the code, while r.LumenScene.SurfaceCache.Feedback.UniqueElements is the console variable name.
Developers should be aware that this variable affects the memory usage and performance of the Lumen surface cache feedback system. Setting it too high might increase memory consumption, while setting it too low might limit the quality or accuracy of the lighting.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Monitoring performance and memory usage when changing this value.
- Considering the trade-off between quality and performance.
Regarding the associated variable GLumenSurfaceCacheFeedbackMaxUniqueElements:
The purpose of GLumenSurfaceCacheFeedbackMaxUniqueElements is to store the actual value of the maximum unique surface cache feedback elements in the C++ code.
This variable is used directly in the Lumen rendering system, specifically in the LumenSurfaceCacheFeedback module.
Its value is set by the console variable r.LumenScene.SurfaceCache.Feedback.UniqueElements, as they are linked through the FAutoConsoleVariableRef.
GLumenSurfaceCacheFeedbackMaxUniqueElements is used in functions like Lumen::GetCompactedFeedbackBufferSize() to determine buffer sizes.
Developers should be aware that changes to r.LumenScene.SurfaceCache.Feedback.UniqueElements will directly affect this variable.
Best practices include using this variable for read-only purposes in the code, and modifying its value through the console variable system rather than directly in the C++ code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:47
Scope: file
Source code excerpt:
int32 GLumenSurfaceCacheFeedbackMaxUniqueElements = 1024;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackUniqueElements(
TEXT("r.LumenScene.SurfaceCache.Feedback.UniqueElements"),
GLumenSurfaceCacheFeedbackMaxUniqueElements,
TEXT("Limit of unique surface cache feedback elements. Used to resize buffers."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
uint32 Lumen::GetFeedbackBufferTileSize()
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSurfaceCacheFeedbackMaxUniqueElements
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:45
Scope: file
Source code excerpt:
);
int32 GLumenSurfaceCacheFeedbackMaxUniqueElements = 1024;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackUniqueElements(
TEXT("r.LumenScene.SurfaceCache.Feedback.UniqueElements"),
GLumenSurfaceCacheFeedbackMaxUniqueElements,
TEXT("Limit of unique surface cache feedback elements. Used to resize buffers."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
uint32 Lumen::GetFeedbackBufferTileSize()
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:74
Scope (from outer to inner):
file
function uint32 Lumen::GetCompactedFeedbackBufferSize
Source code excerpt:
uint32 Lumen::GetCompactedFeedbackBufferSize()
{
return FMath::RoundUpToPowerOfTwo(FMath::Clamp(GLumenSurfaceCacheFeedbackMaxUniqueElements, 1, 16 * 1024));
}
FLumenSurfaceCacheFeedback::FLumenSurfaceCacheFeedback()
{
ReadbackBuffers.AddZeroed(MaxReadbackBuffers);
}