r.Lumen.Reflections.Allow
r.Lumen.Reflections.Allow
#Overview
name: r.Lumen.Reflections.Allow
The value of this variable can be defined or overridden in .ini config files. 10
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow Lumen Reflections. Lumen Reflections is enabled in the project settings, this cvar can only disable it.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.Allow is to control whether Lumen Reflections are allowed in the rendering system of Unreal Engine 5. This setting variable is specifically for the Lumen global illumination and reflection system.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically within the Lumen subsystem. It’s referenced in files related to Lumen reflections and indirect light rendering.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (enabled) but can be changed at runtime.
The associated variable CVarLumenAllowReflections directly interacts with r.Lumen.Reflections.Allow. They share the same value and purpose.
Developers must be aware that this variable acts as a scalability setting. It can only disable Lumen Reflections if they are enabled in the project settings. It doesn’t enable Lumen Reflections if they’re disabled in the project settings.
Best practices when using this variable include:
- Use it for performance optimization in different quality settings.
- Remember that it’s a scalability setting, so it should be adjusted based on the target hardware capabilities.
- Consider its interaction with other Lumen settings for a balanced visual quality and performance.
Regarding the associated variable CVarLumenAllowReflections:
The purpose of CVarLumenAllowReflections is the same as r.Lumen.Reflections.Allow. It’s an internal representation of the console variable in the C++ code.
It’s used directly in the Lumen reflection system to determine whether Lumen Reflections should be rendered. This can be seen in the ShouldRenderLumenReflections function.
The value is set through the console variable system and can be accessed using GetValueOnAnyThread() method.
It interacts closely with other rendering conditions such as the reflection method setting, engine show flags, and hardware capabilities.
Developers should be aware that this variable is checked in performance-critical rendering code, so changing its value can have immediate effects on the rendering pipeline.
Best practices include using this variable in conjunction with other Lumen settings for fine-tuning reflection quality and performance, and considering its impact on different hardware configurations when developing scalability settings.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:347, section: [ReflectionQuality@0]
- INI Section:
ReflectionQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:352, section: [ReflectionQuality@1]
- INI Section:
ReflectionQuality@1
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:357, section: [ReflectionQuality@2]
- INI Section:
ReflectionQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:367, section: [ReflectionQuality@3]
- INI Section:
ReflectionQuality@3
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:377, section: [ReflectionQuality@Cine]
- INI Section:
ReflectionQuality@Cine
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:49, section: [ReflectionQuality@0]
- INI Section:
ReflectionQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:52, section: [ReflectionQuality@1]
- INI Section:
ReflectionQuality@1
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:55, section: [ReflectionQuality@2]
- INI Section:
ReflectionQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:60, section: [ReflectionQuality@3]
- INI Section:
ReflectionQuality@3
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:65, section: [ReflectionQuality@Cine]
- INI Section:
ReflectionQuality@Cine
- Raw value:
1
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:20
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarLumenAllowReflections(
TEXT("r.Lumen.Reflections.Allow"),
1,
TEXT("Whether to allow Lumen Reflections. Lumen Reflections is enabled in the project settings, this cvar can only disable it."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionDownsampleFactor = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:42
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
// This is the project default reflection method, NOT the scalability setting (see r.Lumen.Reflections.Allow for scalability)
// Must match EReflectionMethod
// Note: Default for new projects set by GameProjectUtils
static TAutoConsoleVariable<int32> CVarReflectionMethod(
TEXT("r.ReflectionMethod"), 2,
TEXT("0 - None. Reflections can come from placed Reflection Captures, Planar Reflections and Skylight but no global reflection method will be used.\n")
TEXT("1 - Lumen. Use Lumen Reflections, which supports Screen / Software / Hardware Ray Tracing together and integrates with Lumen Global Illumination for rough reflections and Global Illumination seen in reflections.\n")
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenAllowReflections
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:19
Scope: file
Source code excerpt:
extern FLumenGatherCvarState GLumenGatherCvars;
static TAutoConsoleVariable<int> CVarLumenAllowReflections(
TEXT("r.Lumen.Reflections.Allow"),
1,
TEXT("Whether to allow Lumen Reflections. Lumen Reflections is enabled in the project settings, this cvar can only disable it."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:659
Scope (from outer to inner):
file
function bool ShouldRenderLumenReflections
Source code excerpt:
&& View.FinalPostProcessSettings.ReflectionMethod == EReflectionMethod::Lumen
&& View.Family->EngineShowFlags.LumenReflections
&& CVarLumenAllowReflections.GetValueOnAnyThread()
&& (ShouldRenderLumenDiffuseGI(Scene, View, bSkipTracingDataCheck, bSkipProjectCheck)
// GRHISupportsRayTracingShaders is required for standalone Lumen Reflections because Lumen::GetHardwareRayTracingLightingMode forces hit lighting
|| (bIncludeStandalone && Lumen::UseHardwareRayTracedReflections(*View.Family) && GRHISupportsRayTracingShaders))
&& (bSkipTracingDataCheck || Lumen::UseHardwareRayTracedReflections(*View.Family) || Lumen::IsSoftwareRayTracingSupported());
}