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).
- type:
Var
- help:
If true, allow the usage of GPU particles for Niagara.
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:
- Testing on various hardware configurations to ensure compatibility.
- Considering performance implications, especially on lower-end devices.
- Using it in conjunction with other Niagara settings for optimal results.
Regarding the associated variable GNiagaraAllowGPUParticles:
- Its purpose is identical to fx.NiagaraAllowGPUParticles, serving as the internal C++ representation of the console variable.
- It’s used directly in the Niagara module’s code to determine if GPU particles are allowed.
- The value is set by the console variable system when fx.NiagaraAllowGPUParticles is modified.
- It interacts with other variables like GNiagaraAllowComputeShaders and GRHISupportsDrawIndirect to determine overall GPU particle support.
- Developers should not modify this variable directly, but instead use the console variable fx.NiagaraAllowGPUParticles to change its value.
- Best practices include using this variable in conditional statements to enable or disable GPU-specific code paths in Niagara systems.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1131, section: [Meta_Quest_3 DeviceProfile]
- INI Section:
Meta_Quest_3 DeviceProfile
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1142, section: [Oculus_Quest2 DeviceProfile]
- INI Section:
Oculus_Quest2 DeviceProfile
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseDeviceProfiles.ini:1151, section: [Oculus_Quest DeviceProfile]
- INI Section:
Oculus_Quest DeviceProfile
- Raw value:
0
- Is Array:
False
#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;
}