sg.ReflectionQuality.NumLevels
sg.ReflectionQuality.NumLevels
#Overview
name: sg.ReflectionQuality.NumLevels
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of settings quality levels in sg.ReflectionQuality\n default: 5 (0..4)
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of sg.ReflectionQuality.NumLevels is to define the number of quality levels available for reflection settings in Unreal Engine 5. This variable is primarily used for the rendering system, specifically for managing reflection quality settings.
This setting variable is primarily used in the Scalability module of Unreal Engine, which is responsible for adjusting graphics quality settings to maintain performance across different hardware configurations.
The value of this variable is set as a console variable (CVar) with a default value of 5, indicating that there are 5 quality levels (0 to 4) for reflection settings. This is done in the Engine/Source/Runtime/Engine/Private/Scalability.cpp file.
The associated variable CVarReflectionQuality_NumLevels interacts directly with sg.ReflectionQuality.NumLevels. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable is read-only (ECVF_ReadOnly), meaning it cannot be changed at runtime. It’s used to define the range of possible quality settings for reflections, which affects how the engine handles reflection rendering.
Best practices when using this variable include:
- Understanding that it defines the upper limit of reflection quality settings (0 to NumLevels-1).
- Using it in conjunction with other scalability settings for a cohesive graphics quality management system.
- Considering it when implementing custom graphics settings or scalability options.
Regarding the associated variable CVarReflectionQuality_NumLevels:
- It serves the same purpose as sg.ReflectionQuality.NumLevels, defining the number of reflection quality levels.
- It’s used directly in the Scalability namespace functions to set and manage reflection quality levels.
- The variable is used in functions like SetFromSingleQualityLevel, SetFromSingleQualityLevelRelativeToMax, and SetReflectionQuality to ensure that the reflection quality setting stays within the defined range.
- It’s also used in the GetQualityLevelCounts function to report the number of available quality levels for reflections.
Developers should use CVarReflectionQuality_NumLevels when working within the C++ code of the engine, particularly in the Scalability namespace, to manage and validate reflection quality settings.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:143
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarReflectionQuality_NumLevels(
TEXT("sg.ReflectionQuality.NumLevels"),
5,
TEXT("Number of settings quality levels in sg.ReflectionQuality\n")
TEXT(" default: 5 (0..4)"),
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarPostProcessQuality_NumLevels(
#Associated Variable and Callsites
This variable is associated with another variable named CVarReflectionQuality_NumLevels
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:142
Scope: file
Source code excerpt:
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarReflectionQuality_NumLevels(
TEXT("sg.ReflectionQuality.NumLevels"),
5,
TEXT("Number of settings quality levels in sg.ReflectionQuality\n")
TEXT(" default: 5 (0..4)"),
ECVF_ReadOnly);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:537
Scope (from outer to inner):
file
namespace Scalability
function void OnChangeReflectionQuality
Source code excerpt:
void OnChangeReflectionQuality(IConsoleVariable* Var)
{
SetGroupQualityLevel(TEXT("ReflectionQuality"), Var->GetInt(), CVarReflectionQuality_NumLevels->GetInt());
}
void OnChangePostProcessQuality(IConsoleVariable* Var)
{
SetGroupQualityLevel(TEXT("PostProcessQuality"), Var->GetInt(), CVarPostProcessQuality_NumLevels->GetInt());
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:994
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetFromSingleQualityLevel
Source code excerpt:
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);
LandscapeQuality = FMath::Clamp(Value, 0, CVarLandscapeQuality_NumLevels->GetInt() - 1);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1014
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetFromSingleQualityLevelRelativeToMax
Source code excerpt:
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);
LandscapeQuality = FMath::Max(CVarLandscapeQuality_NumLevels->GetInt() - Value, 0);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1081
Scope (from outer to inner):
file
namespace Scalability
function void FQualityLevels::SetReflectionQuality
Source code excerpt:
void FQualityLevels::SetReflectionQuality(int32 Value)
{
ReflectionQuality = FMath::Clamp(Value, 0, CVarReflectionQuality_NumLevels->GetInt() - 1);
}
void FQualityLevels::SetPostProcessQuality(int32 Value)
{
PostProcessQuality = FMath::Clamp(Value, 0, CVarPostProcessQuality_NumLevels->GetInt() - 1);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1210
Scope (from outer to inner):
file
namespace Scalability
function FQualityLevels GetQualityLevelCounts
Source code excerpt:
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();
Result.LandscapeQuality = CVarLandscapeQuality_NumLevels->GetInt();