fx.Niagara.QualityLevel

fx.Niagara.QualityLevel

#Overview

name: fx.Niagara.QualityLevel

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

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of fx.Niagara.QualityLevel is to control the quality level of Niagara effects in Unreal Engine 5. This setting variable is primarily used by the Niagara visual effects system to adjust the fidelity and performance of particle effects.

The Niagara plugin, which is part of Unreal Engine’s FX system, relies heavily on this setting variable. It’s used across various parts of the Niagara module, including the NiagaraPlatformSet and NiagaraConstants.

The value of this variable is typically set through the engine’s configuration files, specifically in the Engine.ini or Game.ini files. It can also be overridden at runtime using console commands, as evidenced by the GCmdSetNiagaraQualityLevelOverride command.

This variable interacts with several other components of the Niagara system:

  1. CachedQualityLevel: A cached version of the quality level for performance reasons.
  2. CachedAvailableQualityLevelMask: Likely used to determine which quality levels are available.
  3. QualityLevelOverride: An override value that can be set from the Niagara UI.

Developers should be aware of several things when using this variable:

  1. The quality level ranges from 0 to 4, representing Low to Cinematic quality.
  2. Changes to this variable can significantly impact performance and visual fidelity.
  3. It can be overridden both through configuration files and at runtime.

Best practices for using this variable include:

  1. Setting appropriate default values in configuration files for different platforms.
  2. Using the override functionality judiciously, as it can impact performance.
  3. Consider the target hardware when adjusting this value, as higher quality levels may not be suitable for all devices.
  4. Use in conjunction with other Niagara scalability settings for fine-tuned control over performance and quality.
  5. Test thoroughly across different quality levels to ensure your effects look good and perform well at all settings.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:637, section: [EffectsQuality@0]

Location: <Workspace>/Engine/Config/BaseScalability.ini:664, section: [EffectsQuality@1]

Location: <Workspace>/Engine/Config/BaseScalability.ini:691, section: [EffectsQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:718, section: [EffectsQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:746, section: [EffectsQuality@Cine]

Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:155, section: [EffectsQuality@0]

Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:168, section: [EffectsQuality@1]

Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:181, section: [EffectsQuality@2]

Location: <Workspace>/Engine/Config/Android/AndroidScalability.ini:194, section: [EffectsQuality@3]

Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:155, section: [EffectsQuality@0]

Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:168, section: [EffectsQuality@1]

Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:181, section: [EffectsQuality@2]

Location: <Workspace>/Engine/Config/IOS/IOSScalability.ini:194, section: [EffectsQuality@3]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Classes/NiagaraPlatformSet.h:449

Scope: file

Source code excerpt:

	static NIAGARA_API uint32 LastDirtiedFrame;

	/** Cached value of the CVar fx.Niagara.QualityLevel. Allows us to detect when it has changed so we can properly apply scalability changes. */
	static NIAGARA_API int32 CachedQualityLevel;
	static NIAGARA_API int32 CachedAvailableQualityLevelMask;

	/** An override for Niagara quality level, driven from the Niagara UI. */
	static NIAGARA_API int32 QualityLevelOverride;

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraConstants.cpp:230

Scope (from outer to inner):

file
function     void FNiagaraConstants::Init

Source code excerpt:

		SystemStrMap.Add(SYS_PARAM_ENGINE_TIME, LOCTEXT("EngineTimeDesc", "Time in seconds since level began play, but IS paused when the game is paused, and IS dilated/clamped."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_REAL_TIME, LOCTEXT("EngineRealTimeDesc", "Time in seconds since level began play, but IS NOT paused when the game is paused, and IS NOT dilated/clamped."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_QUALITY_LEVEL, LOCTEXT("EngineQualityLevelDesc", "The current value of fx.Niagara.QualityLevel."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_SYSTEM_AGE, LOCTEXT("EngineSystemTimeDesc", "Time in seconds since the system was first created. Managed by the NiagaraSystemInstance in code."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_SYSTEM_TICK_COUNT, LOCTEXT("EngineSystemTickCount", "The current tick of this system simulation."));

		SystemStrMap.Add(SYS_PARAM_ENGINE_POSITION, LOCTEXT("EnginePositionDesc", "The owning component's position in world space."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_SCALE, LOCTEXT("EngineScaleDesc", "The owning component's scale in world space."));
		SystemStrMap.Add(SYS_PARAM_ENGINE_VELOCITY, LOCTEXT("EngineVelocityDesc", "The owning component's velocity in world space."));

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraPlatformSet.cpp:48

Scope: file

Source code excerpt:


static const int32 DefaultQualityLevel = 3;
const TCHAR* NiagaraQualityLevelName = TEXT("fx.Niagara.QualityLevel");
int32 GNiagaraQualityLevel = DefaultQualityLevel;

static FAutoConsoleCommand GCmdSetNiagaraQualityLevelOverride(
	TEXT("fx.Niagara.SetOverrideQualityLevel"),
	TEXT("Sets which quality level we should override with, no args means clear the override and return to non overriden quality level). Valid levels are 0-4 (Low-Cinematic)"),
	FConsoleCommandWithArgsDelegate::CreateLambda(

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraPlatformSet.cpp:1256

Scope (from outer to inner):

file
function     FNiagaraPlatformSet::FPlatformIniSettings& FNiagaraPlatformSet::GetPlatformIniSettings

Source code excerpt:

	}

	//Load config files in which we can reasonable expect to find fx.Niagara.QualityLevel and may be set.
	FConfigFile LocalEngineIni;
	FConfigFile* LoadedEngineIni = FConfigCacheIni::FindOrLoadPlatformConfig(LocalEngineIni, TEXT("Engine"), *PlatformName); //Should use BaseProfileName? Are either of these ensured to be correct? I worry this is brittle.

	FConfigFile LocalGameIni;
	FConfigFile* LoadedGameIni = FConfigCacheIni::FindOrLoadPlatformConfig(LocalGameIni, TEXT("Game"), *PlatformName); //Should use BaseProfileName? Are either of these ensured to be correct? I worry this is brittle.