r.Lumen.UsesLightFunctionAtlas
r.Lumen.UsesLightFunctionAtlas
#Overview
name: r.Lumen.UsesLightFunctionAtlas
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether the light function atlas is sampled for lumen scene lighting.
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:
- Testing the visual impact and performance with it enabled and disabled in your specific scenes.
- Considering the complexity of your light functions and their importance to the scene lighting.
- Balancing the use of light function atlas with other Lumen settings for optimal performance and quality.
Regarding the associated variable GLumenUsesLightFunctionAtlas:
- Its purpose is to provide a quick, thread-safe way to check if the light function atlas should be used for Lumen lighting in C++ code.
- It’s used within the LightFunctionAtlas namespace, specifically in the BeginSceneFrame function of the FLightFunctionAtlas class.
- Its value is set by the console variable system, mirroring r.Lumen.UsesLightFunctionAtlas.
- It interacts with other lighting-related variables like GDeferredUsesLightFunctionAtlas and is part of the decision process for enabling the light function atlas.
- Developers should be aware that this variable is checked in performance-critical rendering code, so frequent changes might impact performance.
- Best practices include using this variable for conditional compilation or runtime checks related to Lumen lighting features that depend on the light function atlas.
#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 ||