sg.PostProcessQuality.NumLevels

sg.PostProcessQuality.NumLevels

#Overview

name: sg.PostProcessQuality.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.PostProcessQuality.NumLevels is to define the number of quality levels available for post-processing effects in Unreal Engine 5. This setting is part of the engine’s scalability system, which allows developers to adjust various graphical settings to optimize performance across different hardware configurations.

This setting variable is primarily used in the Scalability module of Unreal Engine. It’s referenced in the Engine’s source code, specifically in the Scalability.cpp file.

The value of this variable is set as a console variable (CVar) with a default value of 5, indicating that there are five quality levels (0 to 4) for post-processing effects by default. This value is set as read-only, meaning it cannot be changed at runtime.

The associated variable CVarPostProcessQuality_NumLevels interacts directly with sg.PostProcessQuality.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 post-processing effects. It’s used in various functions to clamp or set the post-processing quality level within the defined range.

Best practices when using this variable include:

  1. Consider the performance impact of each quality level when designing post-processing effects.
  2. Ensure that your post-processing effects scale appropriately across all quality levels.
  3. Be aware that changing this value might require adjustments to other parts of the engine that rely on the default number of quality levels.

Regarding the associated variable CVarPostProcessQuality_NumLevels:

This is an internal engine variable that directly corresponds to sg.PostProcessQuality.NumLevels. It’s used throughout the Scalability namespace to manage and set post-processing quality levels. The variable is accessed in various functions related to setting quality levels, such as OnChangePostProcessQuality, SetFromSingleQualityLevel, and GetQualityLevelCounts.

Developers should treat CVarPostProcessQuality_NumLevels as they would sg.PostProcessQuality.NumLevels, understanding that changes to one will affect the other. This variable is crucial in maintaining consistency in post-processing quality levels across different parts of the engine’s scalability system.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


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

static TAutoConsoleVariable<int32> CVarTextureQuality_NumLevels(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_ReadOnly);

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

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

Scope (from outer to inner):

file
namespace    Scalability
function     void OnChangePostProcessQuality

Source code excerpt:

void OnChangePostProcessQuality(IConsoleVariable* Var)
{
	SetGroupQualityLevel(TEXT("PostProcessQuality"), Var->GetInt(), CVarPostProcessQuality_NumLevels->GetInt());
}

void OnChangeTextureQuality(IConsoleVariable* Var)
{
	SetGroupQualityLevel(TEXT("TextureQuality"), Var->GetInt(), CVarTextureQuality_NumLevels->GetInt());
}

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

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetFromSingleQualityLevel

Source code excerpt:

	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:1015

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetFromSingleQualityLevelRelativeToMax

Source code excerpt:

	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:1086

Scope (from outer to inner):

file
namespace    Scalability
function     void FQualityLevels::SetPostProcessQuality

Source code excerpt:

void FQualityLevels::SetPostProcessQuality(int32 Value)
{
	PostProcessQuality = FMath::Clamp(Value, 0, CVarPostProcessQuality_NumLevels->GetInt() - 1);
}

void FQualityLevels::SetTextureQuality(int32 Value)
{
	TextureQuality = FMath::Clamp(Value, 0, CVarTextureQuality_NumLevels->GetInt() - 1);
}

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

Scope (from outer to inner):

file
namespace    Scalability
function     FQualityLevels GetQualityLevelCounts

Source code excerpt:

	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();
	return Result;