r.LumenScene.SurfaceCache.Feedback.ResLevelBias

r.LumenScene.SurfaceCache.Feedback.ResLevelBias

#Overview

name: r.LumenScene.SurfaceCache.Feedback.ResLevelBias

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.ResLevelBias is to bias the resolution of on-demand surface cache pages in the Lumen global illumination system. This setting variable is part of Unreal Engine 5’s rendering system, specifically the Lumen lighting system.

The Lumen rendering subsystem relies on this setting variable. It is used in the surface cache feedback mechanism, which is a critical component of Lumen’s dynamic global illumination system.

The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of -0.5f and can be modified at runtime.

The associated variable GLumenSurfaceCacheFeedbackResLevelBias directly interacts with r.LumenScene.SurfaceCache.Feedback.ResLevelBias. They share the same value, with GLumenSurfaceCacheFeedbackResLevelBias being the C++ variable that stores the console variable’s value.

Developers must be aware of several things when using this variable:

  1. Changing this value will affect the resolution of surface cache pages, which can impact rendering quality and performance.
  2. Modifying this variable triggers a debug reset of the surface cache (Lumen::DebugResetSurfaceCache()).
  3. The variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it’s used for scalability settings and is safe to modify from the render thread.

Best practices when using this variable include:

  1. Use it for fine-tuning Lumen’s performance and quality balance.
  2. Be cautious when modifying it, as it can have a significant impact on rendering.
  3. Test thoroughly after changes, as it affects the entire Lumen surface cache system.

Regarding the associated variable GLumenSurfaceCacheFeedbackResLevelBias:

#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:27

Scope: file

Source code excerpt:

float GLumenSurfaceCacheFeedbackResLevelBias = -0.5f;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackResLevelBias(
	TEXT("r.LumenScene.SurfaceCache.Feedback.ResLevelBias"),
	GLumenSurfaceCacheFeedbackResLevelBias,
	TEXT("Bias resolution of on demand surface cache pages."),
	FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable)
		{
			Lumen::DebugResetSurfaceCache();
		}),

#Associated Variable and Callsites

This variable is associated with another variable named GLumenSurfaceCacheFeedbackResLevelBias. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCacheFeedback.cpp:25

Scope: file

Source code excerpt:

);

float GLumenSurfaceCacheFeedbackResLevelBias = -0.5f;
FAutoConsoleVariableRef CVarLumenSurfaceCacheFeedbackResLevelBias(
	TEXT("r.LumenScene.SurfaceCache.Feedback.ResLevelBias"),
	GLumenSurfaceCacheFeedbackResLevelBias,
	TEXT("Bias resolution of on demand surface cache pages."),
	FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable)
		{
			Lumen::DebugResetSurfaceCache();
		}),
	ECVF_Scalability | ECVF_RenderThreadSafe

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTracingUtils.cpp:74

Scope (from outer to inner):

file
function     void GetLumenCardTracingParameters

Source code excerpt:

	}

	extern float GLumenSurfaceCacheFeedbackResLevelBias;
	TracingParameters.SurfaceCacheFeedbackResLevelBias = GLumenSurfaceCacheFeedbackResLevelBias + 0.5f; // +0.5f required for uint to float rounding in shader
	TracingParameters.SurfaceCacheUpdateFrameIndex = Scene->GetLumenSceneData(View)->GetSurfaceCacheUpdateFrameIndex();

	// Lumen surface cache atlas
	TracingParameters.DirectLightingAtlas = FrameTemporaries.DirectLightingAtlas ? FrameTemporaries.DirectLightingAtlas : GSystemTextures.GetBlackDummy(GraphBuilder);
	TracingParameters.IndirectLightingAtlas = FrameTemporaries.IndirectLightingAtlas ? FrameTemporaries.IndirectLightingAtlas : GSystemTextures.GetBlackDummy(GraphBuilder);
	TracingParameters.FinalLightingAtlas = FrameTemporaries.FinalLightingAtlas ? FrameTemporaries.FinalLightingAtlas : GSystemTextures.GetBlackDummy(GraphBuilder);