r.LensFlareQuality
r.LensFlareQuality
#Overview
name: r.LensFlareQuality
The value of this variable can be defined or overridden in .ini config files. 13
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: off but best for performance\n 1: low quality with good performance\n 2: good quality (default)\n 3: very good quality but bad performance
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LensFlareQuality is to control the quality of lens flare effects in the rendering system of Unreal Engine 5. It allows developers to adjust the trade-off between visual quality and performance for lens flare rendering.
This setting variable is primarily used by the rendering subsystem, specifically in the post-processing stage for lens flare effects. It is referenced in the PostProcessLensFlares.cpp file, which is part of the Renderer module.
The value of this variable is set through a console variable (CVarLensFlareQuality) with a default value of 2. It can be changed at runtime or through configuration files.
The associated variable CVarLensFlareQuality directly interacts with r.LensFlareQuality. They share the same value and purpose.
Developers should be aware that this variable offers four quality levels: 0: Disabled (best performance) 1: Low quality (good performance) 2: Good quality (default) 3: Very good quality (worst performance)
When using this variable, developers should consider the following best practices:
- Balance quality and performance based on target hardware and project requirements.
- Use lower quality settings for less powerful devices or when performance is critical.
- Consider exposing this setting to end-users for customization, especially in PC games.
- Test the visual impact and performance implications of different quality levels in various scenarios.
Regarding the associated variable CVarLensFlareQuality:
- It is an instance of TAutoConsoleVariable
, which allows for runtime modification of the lens flare quality setting. - It is used in the GetLensFlareQuality function to determine the current quality level, clamping the value to ensure it’s within the valid range.
- Developers can access this variable on the render thread using CVarLensFlareQuality.GetValueOnRenderThread().
- When modifying this variable, ensure that changes are made in a thread-safe manner, as indicated by the ECVF_RenderThreadSafe flag in its declaration.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:397, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:417, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:450, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:485, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:523, section: [PostProcessQuality@Cine]
- INI Section:
PostProcessQuality@Cine
- Raw value:
3
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:96, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:106, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:116, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:126, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:96, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:106, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:116, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:126, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
2
- 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/PostProcess/PostProcessLensFlares.cpp:17
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarLensFlareQuality(
TEXT("r.LensFlareQuality"),
2,
TEXT(" 0: off but best for performance\n")
TEXT(" 1: low quality with good performance\n")
TEXT(" 2: good quality (default)\n")
TEXT(" 3: very good quality but bad performance"),
ECVF_Scalability | ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named CVarLensFlareQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessLensFlares.cpp:16
Scope: file
Source code excerpt:
const int32 GLensFlareQuadsPerInstance = 4;
TAutoConsoleVariable<int32> CVarLensFlareQuality(
TEXT("r.LensFlareQuality"),
2,
TEXT(" 0: off but best for performance\n")
TEXT(" 1: low quality with good performance\n")
TEXT(" 2: good quality (default)\n")
TEXT(" 3: very good quality but bad performance"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessLensFlares.cpp:122
Scope (from outer to inner):
file
function GetLensFlareQuality
Source code excerpt:
{
return static_cast<ELensFlareQuality>(FMath::Clamp(
CVarLensFlareQuality.GetValueOnRenderThread(),
static_cast<int32>(ELensFlareQuality::Disabled),
static_cast<int32>(ELensFlareQuality::MAX) - 1));
}
FScreenPassTexture AddLensFlaresPass(
FRDGBuilder& GraphBuilder,