r.LumenScene.SurfaceCache.Feedback.MinPageHits
r.LumenScene.SurfaceCache.Feedback.MinPageHits
#Overview
name: r.LumenScene.SurfaceCache.Feedback.MinPageHits
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Min number of page hits to demand a new page.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.SurfaceCache.Feedback.MinPageHits is to control the minimum number of page hits required to demand a new page in Lumen’s surface cache feedback system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically the surface cache component.
This setting variable is primarily used in the Lumen rendering subsystem, which is part of Unreal Engine 5’s advanced rendering capabilities. Based on the callsite information, it’s clear that this variable is utilized in the LumenSurfaceCacheFeedback.cpp file, which is part of the Renderer module.
The value of this variable is set through the Unreal Engine console variable system, as evidenced by the FAutoConsoleVariableRef declaration. This allows the value to be changed at runtime or through configuration files.
The associated variable GLumenSurfaceCacheFeedbackFeedbackMinPageHits directly interacts with r.LumenScene.SurfaceCache.Feedback.MinPageHits. They share the same value, with GLumenSurfaceCacheFeedbackFeedbackMinPageHits being the C++ variable used in the code logic.
Developers should be aware that this variable affects the performance and quality trade-off in Lumen’s surface cache system. A higher value will result in more conservative page creation, potentially saving memory but possibly reducing rendering quality or responsiveness to scene changes.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project, considering both performance and visual quality.
- Testing different values to find the optimal balance for your scene complexity and available resources.
- Being mindful of its impact on memory usage and rendering performance.
Regarding the associated variable GLumenSurfaceCacheFeedbackFeedbackMinPageHits:
- Its purpose is to serve as the in-code representation of the console variable.
- It’s used directly in the rendering logic to determine when to create new pages in the surface cache.
- The value is set by the console variable system and can be modified at runtime.
- It’s used in a comparison operation to determine if a new page should be created based on the number of page hits.
- Developers should be aware that modifying this variable directly in code is not recommended; instead, they should use the console variable r.LumenScene.SurfaceCache.Feedback.MinPageHits to adjust the value.
#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:39
Scope: file
Source code excerpt:
float GLumenSurfaceCacheFeedbackFeedbackMinPageHits = 16;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackMinPageHits(
TEXT("r.LumenScene.SurfaceCache.Feedback.MinPageHits"),
GLumenSurfaceCacheFeedbackFeedbackMinPageHits,
TEXT("Min number of page hits to demand a new page."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenSurfaceCacheFeedbackMaxUniqueElements = 1024;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenSurfaceCacheFeedbackFeedbackMinPageHits
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:37
Scope: file
Source code excerpt:
);
float GLumenSurfaceCacheFeedbackFeedbackMinPageHits = 16;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackMinPageHits(
TEXT("r.LumenScene.SurfaceCache.Feedback.MinPageHits"),
GLumenSurfaceCacheFeedbackFeedbackMinPageHits,
TEXT("Min number of page hits to demand a new page."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenSurfaceCacheFeedbackMaxUniqueElements = 1024;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackUniqueElements(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:419
Scope (from outer to inner):
file
function void FLumenSceneData::UpdateSurfaceCacheFeedback
Source code excerpt:
const uint32 PageHitNum = (PackedB >> 16) & 0xFFFF;
if (PageHitNum > GLumenSurfaceCacheFeedbackFeedbackMinPageHits
&& CardIndex < Cards.Num()
&& Cards.IsAllocated(CardIndex))
{
FLumenCard& Card = Cards[CardIndex];
FLumenMipMapDesc MipMapDesc;