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).

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:

  1. Adjusting it based on the specific needs of your project, considering both performance and visual quality.
  2. Testing different values to find the optimal balance for your scene complexity and available resources.
  3. Being mindful of its impact on memory usage and rendering performance.

Regarding the associated variable GLumenSurfaceCacheFeedbackFeedbackMinPageHits:

#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;