fx.QualityLevelSpawnRateScaleReferenceLevel

fx.QualityLevelSpawnRateScaleReferenceLevel

#Overview

name: fx.QualityLevelSpawnRateScaleReferenceLevel

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of fx.QualityLevelSpawnRateScaleReferenceLevel is to control the reference level for quality-based spawn rate scaling in the particle system of Unreal Engine 5. It is primarily used in the rendering system, specifically for particle effects.

This setting variable is relied upon by the Engine module, particularly in the particle components subsystem. It’s used to determine how particle spawn rates should be scaled based on the current graphics quality settings.

The value of this variable is set as a console variable with a default value of 2. It can be modified at runtime through the console or programmatically.

The associated variable CVarQLSpawnRateReferenceLevel directly interacts with fx.QualityLevelSpawnRateScaleReferenceLevel. They share the same value and purpose.

Developers must be aware that this variable affects the performance and visual quality of particle effects. It determines the baseline quality level at which no spawn rate scaling occurs. For quality levels below this reference, spawn rates will be scaled down according to each emitter’s QualityLevelSpawnRateScale value.

Best practices when using this variable include:

  1. Carefully consider the default value (2) and adjust it based on your game’s performance targets and visual requirements.
  2. Ensure that particle emitters’ QualityLevelSpawnRateScale values are set appropriately to work well with this reference level.
  3. Test thoroughly across different quality settings to ensure a smooth degradation of particle effects as quality decreases.

Regarding the associated variable CVarQLSpawnRateReferenceLevel:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:196

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarQLSpawnRateReferenceLevel(
	TEXT("fx.QualityLevelSpawnRateScaleReferenceLevel"),
	2,
	TEXT("Controls the reference level for quality level based spawn rate scaling. This is the FX quality level\n")
	TEXT("at which spawn rate is not scaled down; Spawn rate scaling will happen by each emitter's\n")
	TEXT("QualityLevelSpawnRateScale value for each reduction in level below the reference level.\n")
	TEXT("\n")
	TEXT("Default = 2. Value should range from 0 to the maximum FX quality level."),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:195

Scope: file

Source code excerpt:

	);

static TAutoConsoleVariable<float> CVarQLSpawnRateReferenceLevel(
	TEXT("fx.QualityLevelSpawnRateScaleReferenceLevel"),
	2,
	TEXT("Controls the reference level for quality level based spawn rate scaling. This is the FX quality level\n")
	TEXT("at which spawn rate is not scaled down; Spawn rate scaling will happen by each emitter's\n")
	TEXT("QualityLevelSpawnRateScale value for each reduction in level below the reference level.\n")
	TEXT("\n")

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:1978

Scope (from outer to inner):

file
function     float UParticleEmitter::GetQualityLevelSpawnRateMult

Source code excerpt:

{
	int32 EffectsQuality = Scalability::GetEffectsQualityDirect(IsInGameThread() || IsInParallelGameThread());
	int32 ReferenceLevel = CVarQLSpawnRateReferenceLevel.GetValueOnAnyThread(true);
	float Level = (ReferenceLevel - EffectsQuality);
	float Q = FMath::Pow(QualityLevelSpawnRateScale, Level);
	return FMath::Min(1.0f, Q);
}

bool UParticleEmitter::HasAnyEnabledLODs()const