r.Lumen.UsesLightFunctionAtlas

r.Lumen.UsesLightFunctionAtlas

#Overview

name: r.Lumen.UsesLightFunctionAtlas

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.Lumen.UsesLightFunctionAtlas is to control whether the light function atlas is sampled for Lumen scene lighting in Unreal Engine 5. This setting is part of the rendering system, specifically related to the Lumen global illumination system.

This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the light function atlas functionality. Based on the callsites, it’s clear that this variable is crucial for the Lumen lighting system.

The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 1 (enabled) and can be changed at runtime using console commands.

The associated variable GLumenUsesLightFunctionAtlas directly interacts with r.Lumen.UsesLightFunctionAtlas. They share the same value, with GLumenUsesLightFunctionAtlas being the actual integer variable used in the C++ code to check if the light function atlas should be used for Lumen lighting.

Developers must be aware that this variable affects the performance and quality of Lumen lighting. Enabling it (value > 0) allows for more detailed lighting effects but may come at a performance cost. Disabling it might improve performance but could reduce lighting quality in scenes that heavily rely on light functions.

Best practices when using this variable include:

  1. Testing the visual impact and performance with it enabled and disabled in your specific scenes.
  2. Considering the complexity of your light functions and their importance to the scene lighting.
  3. Balancing the use of light function atlas with other Lumen settings for optimal performance and quality.

Regarding the associated variable GLumenUsesLightFunctionAtlas:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightFunctionAtlas.cpp:109

Scope: file

Source code excerpt:

int GLumenUsesLightFunctionAtlas = 1;
FAutoConsoleVariableRef CVarLumenUsesLightFunctionAtlas(
	TEXT("r.Lumen.UsesLightFunctionAtlas"),
	GLumenUsesLightFunctionAtlas,
	TEXT("Whether the light function atlas is sampled for lumen scene lighting."),
	ECVF_RenderThreadSafe
);

//////////////////////////////////////////////////////////////////////////

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightFunctionAtlas.cpp:107

Scope: file

Source code excerpt:

);

int GLumenUsesLightFunctionAtlas = 1;
FAutoConsoleVariableRef CVarLumenUsesLightFunctionAtlas(
	TEXT("r.Lumen.UsesLightFunctionAtlas"),
	GLumenUsesLightFunctionAtlas,
	TEXT("Whether the light function atlas is sampled for lumen scene lighting."),
	ECVF_RenderThreadSafe
);

//////////////////////////////////////////////////////////////////////////

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightFunctionAtlas.cpp:272

Scope (from outer to inner):

file
namespace    LightFunctionAtlas
function     void FLightFunctionAtlas::BeginSceneFrame

Source code excerpt:

		bDeferredlightingRequestsLF	= GDeferredUsesLightFunctionAtlas > 0;
		bManyLightsRequestsLF		= ManyLights::IsUsingLightFunctions();
		bLumenRequestsLF 			= GLumenUsesLightFunctionAtlas > 0;// && IsLumenTranslucencyGIEnabled();// GLumenScene enabled ...;

		bLightFunctionAtlasEnabled = bLightFunctionAtlasEnabled && 
			(bVolumetricFogRequestsLF || 
			bDeferredlightingRequestsLF || 
			bManyLightsRequestsLF ||
			bLumenRequestsLF ||