fx.NiagaraAllowGPUParticles

fx.NiagaraAllowGPUParticles

#Overview

name: fx.NiagaraAllowGPUParticles

The value of this variable can be defined or overridden in .ini config files. 3 .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.NiagaraAllowGPUParticles is to control whether GPU particles are allowed in the Niagara visual effects system within Unreal Engine 5. This setting is primarily used for the particle system and rendering optimization.

This setting variable is primarily relied upon by the Niagara plugin, which is part of Unreal Engine’s FX (effects) system. It’s specifically used in the Niagara module, which handles advanced particle systems.

The value of this variable is set as a console variable, which means it can be changed at runtime. By default, it’s set to 1 (true), allowing GPU particles in Niagara.

The associated variable GNiagaraAllowGPUParticles interacts directly with fx.NiagaraAllowGPUParticles. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable can significantly impact performance and visual quality. Enabling GPU particles can provide better performance for complex particle systems, but it may not be supported on all hardware.

Best practices when using this variable include:

  1. Testing on various hardware configurations to ensure compatibility.
  2. Considering performance implications, especially on lower-end devices.
  3. Using it in conjunction with other Niagara settings for optimal results.

Regarding the associated variable GNiagaraAllowGPUParticles:

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1131, section: [Meta_Quest_3 DeviceProfile]

Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1142, section: [Oculus_Quest2 DeviceProfile]

Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1151, section: [Oculus_Quest DeviceProfile]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraCommon.cpp:36

Scope: file

Source code excerpt:

int32 GNiagaraAllowGPUParticles = 1;
FAutoConsoleVariableRef CVarAllowGPUParticles(
	TEXT("fx.NiagaraAllowGPUParticles"),
	GNiagaraAllowGPUParticles,
	TEXT("If true, allow the usage of GPU particles for Niagara."),
	ECVF_Scalability | ECVF_Default);

int32 GNiagaraGPUCulling = 1;
FAutoConsoleVariableRef CVarNiagaraGPUCulling(

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/OpenGLDevice.cpp:1375

Scope (from outer to inner):

file
function     FOpenGLDynamicRHI::FOpenGLDynamicRHI

Source code excerpt:

	if (GRHIVendorId == 0x5143)
	{
		auto* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("fx.NiagaraAllowGPUParticles"));
		if (CVar)
		{
			int32 DriverVersion = INT32_MAX;
			FString SubVersionString, DriverVersionString;
			FString VersionString = FString(ANSI_TO_TCHAR((const ANSICHAR*)glGetString(GL_VERSION)));
			

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraCommon.cpp:34

Scope: file

Source code excerpt:

	ECVF_Default);

int32 GNiagaraAllowGPUParticles = 1;
FAutoConsoleVariableRef CVarAllowGPUParticles(
	TEXT("fx.NiagaraAllowGPUParticles"),
	GNiagaraAllowGPUParticles,
	TEXT("If true, allow the usage of GPU particles for Niagara."),
	ECVF_Scalability | ECVF_Default);

int32 GNiagaraGPUCulling = 1;
FAutoConsoleVariableRef CVarNiagaraGPUCulling(
	TEXT("Niagara.GPUCulling"),

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraCommon.cpp:942

Scope (from outer to inner):

file
function     bool FNiagaraUtilities::AllowGPUParticles

Source code excerpt:

bool FNiagaraUtilities::AllowGPUParticles(EShaderPlatform ShaderPlatform)
{
	return GNiagaraAllowGPUParticles && GNiagaraAllowComputeShaders && GRHISupportsDrawIndirect;
}

bool FNiagaraUtilities::AllowComputeShaders(EShaderPlatform ShaderPlatform)
{
	return GNiagaraAllowComputeShaders && GRHISupportsDrawIndirect;
}