sg.GlobalIlluminationQuality.NumLevels
sg.GlobalIlluminationQuality.NumLevels
#Overview
name: sg.GlobalIlluminationQuality.NumLevels
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of settings quality levels in sg.GlobalIlluminationQuality\n default: 5 (0..4)
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of sg.GlobalIlluminationQuality.NumLevels is to define the number of quality levels available for the Global Illumination (GI) system in Unreal Engine 5. This setting variable is part of the engine’s scalability system, which allows developers to adjust various graphical features to balance performance and visual quality.
This setting variable is primarily used by the Engine module, specifically within the Scalability namespace. It is an integral part of the engine’s rendering system, particularly for managing global illumination quality settings.
The value of this variable is set as a console variable (CVar) with a default value of 5, representing 5 quality levels (0 to 4) for global illumination. It is defined as read-only, meaning it cannot be changed at runtime.
The associated variable CVarGlobalIlluminationQuality_NumLevels interacts directly with sg.GlobalIlluminationQuality.NumLevels. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable affects the range of quality settings available for global illumination. It’s used in various functions to clamp or calculate quality levels, ensuring that the chosen quality level is always within the valid range.
Best practices when using this variable include:
- Respecting the read-only nature of the variable.
- Using it in conjunction with other scalability settings for a balanced approach to performance and quality.
- Understanding that changing this value would require recompiling the engine, as it’s not meant to be altered at runtime.
Regarding the associated variable CVarGlobalIlluminationQuality_NumLevels:
The purpose of CVarGlobalIlluminationQuality_NumLevels is to provide a programmatic way to access the number of quality levels for global illumination within the engine’s C++ code.
This variable is used throughout the Scalability namespace to manage and set global illumination quality levels. It’s particularly important in functions that handle quality level changes, such as OnChangeGlobalIlluminationQuality and SetFromSingleQualityLevel.
The value of CVarGlobalIlluminationQuality_NumLevels is set when the engine initializes the console variables, and it mirrors the value of sg.GlobalIlluminationQuality.NumLevels.
This variable interacts closely with other scalability settings and is often used in conjunction with them to maintain consistent quality levels across different graphical features.
Developers should be aware that this variable is crucial for maintaining the integrity of the scalability system. It’s used to clamp quality levels and calculate relative quality settings.
Best practices when using CVarGlobalIlluminationQuality_NumLevels include:
- Always using it to determine the valid range of global illumination quality levels.
- Considering it when implementing custom scalability features that interact with global illumination.
- Understanding its relationship with sg.GlobalIlluminationQuality.NumLevels and treating them as effectively the same variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:136
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarGlobalIlluminationQuality_NumLevels(
TEXT("sg.GlobalIlluminationQuality.NumLevels"),
5,
TEXT("Number of settings quality levels in sg.GlobalIlluminationQuality\n")
TEXT(" default: 5 (0..4)"),
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarReflectionQuality_NumLevels(
#Associated Variable and Callsites
This variable is associated with another variable named CVarGlobalIlluminationQuality_NumLevels
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:135
Scope: file
Source code excerpt:
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarGlobalIlluminationQuality_NumLevels(
TEXT("sg.GlobalIlluminationQuality.NumLevels"),
5,
TEXT("Number of settings quality levels in sg.GlobalIlluminationQuality\n")
TEXT(" default: 5 (0..4)"),
ECVF_ReadOnly);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:532
Scope (from outer to inner):
file
namespace Scalability
function void OnChangeGlobalIlluminationQuality
Source code excerpt:
void OnChangeGlobalIlluminationQuality(IConsoleVariable* Var)
{
SetGroupQualityLevel(TEXT("GlobalIlluminationQuality"), Var->GetInt(), CVarGlobalIlluminationQuality_NumLevels->GetInt());
}
void OnChangeReflectionQuality(IConsoleVariable* Var)
{
SetGroupQualityLevel(TEXT("ReflectionQuality"), Var->GetInt(), CVarReflectionQuality_NumLevels->GetInt());
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:993
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetFromSingleQualityLevel
Source code excerpt:
AntiAliasingQuality = FMath::Clamp(Value, 0, CVarAntiAliasingQuality_NumLevels->GetInt() - 1);
ShadowQuality = FMath::Clamp(Value, 0, CVarShadowQuality_NumLevels->GetInt() - 1);
GlobalIlluminationQuality = FMath::Clamp(Value, 0, CVarGlobalIlluminationQuality_NumLevels->GetInt() - 1);
ReflectionQuality = FMath::Clamp(Value, 0, CVarReflectionQuality_NumLevels->GetInt() - 1);
PostProcessQuality = FMath::Clamp(Value, 0, CVarPostProcessQuality_NumLevels->GetInt() - 1);
TextureQuality = FMath::Clamp(Value, 0, CVarTextureQuality_NumLevels->GetInt() - 1);
EffectsQuality = FMath::Clamp(Value, 0, CVarEffectsQuality_NumLevels->GetInt() - 1);
FoliageQuality = FMath::Clamp(Value, 0, CVarFoliageQuality_NumLevels->GetInt() - 1);
ShadingQuality = FMath::Clamp(Value, 0, CVarShadingQuality_NumLevels->GetInt() - 1);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1013
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetFromSingleQualityLevelRelativeToMax
Source code excerpt:
AntiAliasingQuality = FMath::Max(CVarAntiAliasingQuality_NumLevels->GetInt() - Value, 0);
ShadowQuality = FMath::Max(CVarShadowQuality_NumLevels->GetInt() - Value, 0);
GlobalIlluminationQuality = FMath::Max(CVarGlobalIlluminationQuality_NumLevels->GetInt() - Value, 0);
ReflectionQuality = FMath::Max(CVarReflectionQuality_NumLevels->GetInt() - Value, 0);
PostProcessQuality = FMath::Max(CVarPostProcessQuality_NumLevels->GetInt() - Value, 0);
TextureQuality = FMath::Max(CVarTextureQuality_NumLevels->GetInt() - Value, 0);
EffectsQuality = FMath::Max(CVarEffectsQuality_NumLevels->GetInt() - Value, 0);
FoliageQuality = FMath::Max(CVarFoliageQuality_NumLevels->GetInt() - Value, 0);
ShadingQuality = FMath::Max(CVarShadingQuality_NumLevels->GetInt() - Value, 0);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1076
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetGlobalIlluminationQuality
Source code excerpt:
void FQualityLevels::SetGlobalIlluminationQuality(int32 Value)
{
GlobalIlluminationQuality = FMath::Clamp(Value, 0, CVarGlobalIlluminationQuality_NumLevels->GetInt() - 1);
}
void FQualityLevels::SetReflectionQuality(int32 Value)
{
ReflectionQuality = FMath::Clamp(Value, 0, CVarReflectionQuality_NumLevels->GetInt() - 1);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1209
Scope (from outer to inner):
file
namespace Scalability
function FQualityLevels GetQualityLevelCounts
Source code excerpt:
Result.AntiAliasingQuality = CVarAntiAliasingQuality_NumLevels->GetInt();
Result.ShadowQuality = CVarShadowQuality_NumLevels->GetInt();
Result.GlobalIlluminationQuality = CVarGlobalIlluminationQuality_NumLevels->GetInt();
Result.ReflectionQuality = CVarReflectionQuality_NumLevels->GetInt();
Result.PostProcessQuality = CVarPostProcessQuality_NumLevels->GetInt();
Result.TextureQuality = CVarTextureQuality_NumLevels->GetInt();
Result.EffectsQuality = CVarEffectsQuality_NumLevels->GetInt();
Result.FoliageQuality = CVarFoliageQuality_NumLevels->GetInt();
Result.ShadingQuality = CVarShadingQuality_NumLevels->GetInt();