sg.PostProcessQuality

sg.PostProcessQuality

#Overview

name: sg.PostProcessQuality

The value of this variable can be defined or overridden in .ini config files. 21 .ini config files referencing this setting variable.

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

It is referenced in 10 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of sg.PostProcessQuality is to control the quality level of post-processing effects in Unreal Engine 5. This setting variable is part of the scalability system, which allows developers to adjust various quality settings to optimize performance across different hardware configurations.

The Unreal Engine subsystem that primarily relies on this setting variable is the rendering system, specifically the post-processing pipeline. It’s also used by the scalability system to manage overall graphics quality.

The value of this variable is set in several ways:

  1. It’s initialized with a default value (DefaultQualityLevel) when the engine starts.
  2. It can be loaded from an INI file using the Scalability::LoadState function.
  3. It can be set programmatically using the Scalability::SetQualityLevels function.
  4. It can be changed via console commands due to its ECVF_ScalabilityGroup flag.

This variable interacts with other scalability settings such as GlobalIlluminationQuality, ReflectionQuality, TextureQuality, EffectsQuality, FoliageQuality, ShadingQuality, and LandscapeQuality. They are often set and retrieved together as part of the overall quality settings.

Developers should be aware that:

  1. This variable affects performance significantly, as post-processing can be computationally expensive.
  2. Changes to this variable trigger a callback (OnChangePostProcessQuality) which likely updates the rendering pipeline.
  3. The value is clamped to a range (probably 0-4, representing low to cinematic quality).

Best practices when using this variable include:

  1. Consider hardware capabilities when setting this value to ensure good performance.
  2. Use it in conjunction with other scalability settings for a balanced approach to graphics quality.
  3. Allow users to adjust this setting in graphics options menus for better user experience across different hardware.

The associated variable CVarPostProcessQuality is the actual console variable that stores and manages the post-process quality value. It’s defined using TAutoConsoleVariable and is used internally by the engine to get and set the post-process quality level. The main difference is that sg.PostProcessQuality is the string used to refer to this setting in configuration files and console commands, while CVarPostProcessQuality is the C++ variable used in the engine code to access and modify this setting.

#Setting Variables

#References In INI files

<Workspace>/Engine/Config/BaseDeviceProfiles.ini:310, section: [IOS DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:327, section: [iPhone6S DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:338, section: [iPhone6SPlus DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:349, section: [iPhoneSE DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:527, section: [iPadAir2 DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:537, section: [iPadMini4 DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:552, section: [iPadPro DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:682, section: [AppleTV DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:834, section: [Android_Low DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:849, section: [Android_Mid DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:863, section: [Android_High DeviceProfile]
<Workspace>/Engine/Config/BaseDeviceProfiles.ini:888, section: [Android_Vulkan_SM5 DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:44, section: [Mobile DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:91, section: [IOS_Low DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:104, section: [IOS_Mid DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:131, section: [IOS_High DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:148, section: [IOS_Epic DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:504, section: [Android_Low DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:517, section: [Android_Mid DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:544, section: [Android_High DeviceProfile]
<Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:560, section: [Android_Epic DeviceProfile]

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarPostProcessQuality(
	TEXT("sg.PostProcessQuality"),
	Scalability::DefaultQualityLevel,
	TEXT("Scalability quality state (internally used by scalability system, ini load/save or using SCALABILITY console command)\n")
	TEXT(" 0:low, 1:med, 2:high, 3:epic, 4:cinematic, default: 3"),
	ECVF_ScalabilityGroup | ECVF_Preview);

static TAutoConsoleVariable<int32> CVarTextureQuality(

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/Nodes/MovieGraphGlobalGameOverrides.cpp:35

Scope (from outer to inner):

file
function     void UMovieGraphGlobalGameOverridesNode::BuildNewProcessCommandLineArgsImpl

Source code excerpt:

		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.GlobalIlluminationQuality={0}"), {QualityLevels.GlobalIlluminationQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.ReflectionQuality={0}"), {QualityLevels.ReflectionQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.PostProcessQuality={0}"), {QualityLevels.PostProcessQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.TextureQuality={0}"), {QualityLevels.TextureQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.EffectsQuality={0}"), {QualityLevels.EffectsQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.FoliageQuality={0}"), {QualityLevels.FoliageQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.ShadingQuality={0}"), {QualityLevels.ShadingQuality}));
		InOutDeviceProfileCvars.Add(FString::Format(TEXT("sg.LandscapeQuality={0}"), {QualityLevels.LandscapeQuality}));
	}

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineGameOverrideSetting.cpp:167

Scope (from outer to inner):

file
function     void UMoviePipelineGameOverrideSetting::BuildNewProcessCommandLineArgsImpl

Source code excerpt:

		InOutDeviceProfileCvars.Add(TEXT("sg.GlobalIlluminationQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.ReflectionQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.PostProcessQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.TextureQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.EffectsQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.FoliageQuality=4"));
		InOutDeviceProfileCvars.Add(TEXT("sg.ShadingQuality=4"));
	}

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

Scope (from outer to inner):

file
namespace    Scalability
function     void LoadState

Source code excerpt:

	GConfig->GetInt(Section, TEXT("sg.GlobalIlluminationQuality"), State.GlobalIlluminationQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.ReflectionQuality"), State.ReflectionQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.PostProcessQuality"), State.PostProcessQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.TextureQuality"), State.TextureQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.EffectsQuality"), State.EffectsQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.FoliageQuality"), State.FoliageQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.ShadingQuality"), State.ShadingQuality, IniName);
	GConfig->GetInt(Section, TEXT("sg.LandscapeQuality"), State.LandscapeQuality, IniName);

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

Scope (from outer to inner):

file
namespace    Scalability
function     void SaveState

Source code excerpt:

	GConfig->SetInt(Section, TEXT("sg.GlobalIlluminationQuality"), State.GlobalIlluminationQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.ReflectionQuality"), State.ReflectionQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.PostProcessQuality"), State.PostProcessQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.TextureQuality"), State.TextureQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.EffectsQuality"), State.EffectsQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.FoliageQuality"), State.FoliageQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.ShadingQuality"), State.ShadingQuality, IniName);
	GConfig->SetInt(Section, TEXT("sg.LandscapeQuality"), State.LandscapeQuality, IniName);
}

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:273

Scope (from outer to inner):

file
namespace    LyraSettingsHelpers
function     void FillScalabilitySettingsFromDeviceProfile

Source code excerpt:

		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.GlobalIlluminationQuality%s"), *Suffix), Mode.Qualities.GlobalIlluminationQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.ReflectionQuality%s"), *Suffix), Mode.Qualities.ReflectionQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.PostProcessQuality%s"), *Suffix), Mode.Qualities.PostProcessQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.TextureQuality%s"), *Suffix), Mode.Qualities.TextureQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.EffectsQuality%s"), *Suffix), Mode.Qualities.EffectsQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.FoliageQuality%s"), *Suffix), Mode.Qualities.FoliageQuality);
		Mode.bHasOverrides |= UDeviceProfileManager::GetScalabilityCVar(FString::Printf(TEXT("sg.ShadingQuality%s"), *Suffix), Mode.Qualities.ShadingQuality);
	}

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_ScalabilityGroup | ECVF_Preview);

static TAutoConsoleVariable<int32> CVarPostProcessQuality(
	TEXT("sg.PostProcessQuality"),
	Scalability::DefaultQualityLevel,
	TEXT("Scalability quality state (internally used by scalability system, ini load/save or using SCALABILITY console command)\n")
	TEXT(" 0:low, 1:med, 2:high, 3:epic, 4:cinematic, default: 3"),
	ECVF_ScalabilityGroup | ECVF_Preview);

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

Scope (from outer to inner):

file
namespace    Scalability
function     void InitScalabilitySystem

Source code excerpt:

	CVarGlobalIlluminationQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeGlobalIlluminationQuality));
	CVarReflectionQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeReflectionQuality));
	CVarPostProcessQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangePostProcessQuality));
	CVarTextureQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeTextureQuality));
	CVarEffectsQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeEffectsQuality));
	CVarFoliageQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeFoliageQuality));
	CVarShadingQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeShadingQuality));
	CVarLandscapeQuality.AsVariable()->SetOnChangedCallback(FConsoleVariableDelegate::CreateStatic(&OnChangeLandscapeQuality));

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

Scope (from outer to inner):

file
namespace    Scalability
function     void SetQualityLevels

Source code excerpt:

		SetQualityLevelCVar(CVarGlobalIlluminationQuality, ClampedLevels.GlobalIlluminationQuality, GScalabilityQualityLevelsOverride.GlobalIlluminationQuality, bForce);
		SetQualityLevelCVar(CVarReflectionQuality, ClampedLevels.ReflectionQuality, GScalabilityQualityLevelsOverride.ReflectionQuality, bForce);
		SetQualityLevelCVar(CVarPostProcessQuality, ClampedLevels.PostProcessQuality, GScalabilityQualityLevelsOverride.PostProcessQuality, bForce);
		SetQualityLevelCVar(CVarTextureQuality, ClampedLevels.TextureQuality, GScalabilityQualityLevelsOverride.TextureQuality, bForce);
		SetQualityLevelCVar(CVarEffectsQuality, ClampedLevels.EffectsQuality, GScalabilityQualityLevelsOverride.EffectsQuality, bForce);
		SetQualityLevelCVar(CVarFoliageQuality, ClampedLevels.FoliageQuality, GScalabilityQualityLevelsOverride.FoliageQuality, bForce);
		SetQualityLevelCVar(CVarShadingQuality, ClampedLevels.ShadingQuality, GScalabilityQualityLevelsOverride.ShadingQuality, bForce);
		SetQualityLevelCVar(CVarLandscapeQuality, ClampedLevels.LandscapeQuality, GScalabilityQualityLevelsOverride.LandscapeQuality, bForce);

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

Scope (from outer to inner):

file
namespace    Scalability
function     FQualityLevels GetQualityLevels

Source code excerpt:

		Ret.GlobalIlluminationQuality = CVarGlobalIlluminationQuality.GetValueOnGameThread();
		Ret.ReflectionQuality = CVarReflectionQuality.GetValueOnGameThread();
		Ret.PostProcessQuality = CVarPostProcessQuality.GetValueOnGameThread();
		Ret.TextureQuality = CVarTextureQuality.GetValueOnGameThread();
		Ret.EffectsQuality = CVarEffectsQuality.GetValueOnGameThread();
		Ret.FoliageQuality = CVarFoliageQuality.GetValueOnGameThread();
		Ret.ShadingQuality = CVarShadingQuality.GetValueOnGameThread();
		Ret.LandscapeQuality = CVarLandscapeQuality.GetValueOnGameThread();
	}