sg.AntiAliasingQuality.NumLevels

sg.AntiAliasingQuality.NumLevels

#Overview

name: sg.AntiAliasingQuality.NumLevels

This variable is created as a Console Variable (cvar).

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of sg.AntiAliasingQuality.NumLevels is to define the number of quality levels available for anti-aliasing in Unreal Engine 5’s scalability system. This setting is part of the rendering system, specifically for controlling anti-aliasing quality.

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, representing 5 quality levels (0 to 4). It is defined as read-only, meaning it cannot be changed at runtime.

The associated variable CVarAntiAliasingQuality_NumLevels interacts directly with sg.AntiAliasingQuality.NumLevels, sharing the same value. This variable is used throughout the code to access the number of anti-aliasing quality levels.

Developers should be aware that:

  1. This variable defines the range of valid anti-aliasing quality settings.
  2. It’s used to clamp user-specified quality levels to ensure they’re within the valid range.
  3. Changes to this value would require engine recompilation, as it’s set as read-only.

Best practices when using this variable include:

  1. Always use the variable (or its associated CVar) when referencing the number of anti-aliasing quality levels, rather than hardcoding the value.
  2. Ensure that any custom anti-aliasing quality settings respect the range defined by this variable.
  3. Consider the impact on performance and visual quality when adjusting anti-aliasing quality levels within the defined range.

Regarding the associated variable CVarAntiAliasingQuality_NumLevels:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:122

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarAntiAliasingQuality_NumLevels(
	TEXT("sg.AntiAliasingQuality.NumLevels"),
	5,
	TEXT("Number of settings quality levels in sg.AntiAliasingQuality\n")
	TEXT(" default: 5 (0..4)"),
	ECVF_ReadOnly);

static TAutoConsoleVariable<int32> CVarShadowQuality_NumLevels(

#Associated Variable and Callsites

This variable is associated with another variable named CVarAntiAliasingQuality_NumLevels. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:121

Scope: file

Source code excerpt:

	ECVF_ReadOnly);

static TAutoConsoleVariable<int32> CVarAntiAliasingQuality_NumLevels(
	TEXT("sg.AntiAliasingQuality.NumLevels"),
	5,
	TEXT("Number of settings quality levels in sg.AntiAliasingQuality\n")
	TEXT(" default: 5 (0..4)"),
	ECVF_ReadOnly);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:522

Scope (from outer to inner):

file
namespace    Scalability
function     void OnChangeAntiAliasingQuality

Source code excerpt:

void OnChangeAntiAliasingQuality(IConsoleVariable* Var)
{
	SetGroupQualityLevel(TEXT("AntiAliasingQuality"), Var->GetInt(), CVarAntiAliasingQuality_NumLevels->GetInt());
}

void OnChangeShadowQuality(IConsoleVariable* Var)
{
	SetGroupQualityLevel(TEXT("ShadowQuality"), Var->GetInt(), CVarShadowQuality_NumLevels->GetInt());
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:991

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetFromSingleQualityLevel

Source code excerpt:

	ResolutionQuality = GetRenderScaleLevelFromQualityLevel(Value, EQualityLevelBehavior::EAbsolute);
	ViewDistanceQuality = FMath::Clamp(Value, 0, CVarViewDistanceQuality_NumLevels->GetInt() - 1);
	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);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1011

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetFromSingleQualityLevelRelativeToMax

Source code excerpt:


	ViewDistanceQuality = FMath::Max(CVarViewDistanceQuality_NumLevels->GetInt() - Value, 0);
	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);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1066

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetAntiAliasingQuality

Source code excerpt:

void FQualityLevels::SetAntiAliasingQuality(int32 Value)
{
	AntiAliasingQuality = FMath::Clamp(Value, 0, CVarAntiAliasingQuality_NumLevels->GetInt() - 1);
}

void FQualityLevels::SetShadowQuality(int32 Value)
{
	ShadowQuality = FMath::Clamp(Value, 0, CVarShadowQuality_NumLevels->GetInt() - 1);
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scalability.cpp:1207

Scope (from outer to inner):

file
namespace    Scalability
function     FQualityLevels GetQualityLevelCounts

Source code excerpt:

	Result.ResolutionQuality = 100.0f;
	Result.ViewDistanceQuality = CVarViewDistanceQuality_NumLevels->GetInt();
	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();