FX.AllowGPUParticles
FX.AllowGPUParticles
#Overview
name: FX.AllowGPUParticles
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, allow the usage of GPU particles.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of FX.AllowGPUParticles is to control whether GPU particles are allowed in the Unreal Engine’s particle system. This setting variable is primarily used for the rendering and particle systems within the engine.
The Unreal Engine subsystems that rely on this setting variable are the particle system (FXSystem) and the rendering system. This can be seen from the file locations where the variable is referenced, such as Engine/Source/Runtime/Engine/Private/Particles/FXSystem.cpp and Engine/Plugins/VirtualProduction/ICVFXTesting/Source/ICVFXTesting/Public/ICVFXTestControllerBase.h.
The value of this variable is set through the Unreal Engine console system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands.
The associated variable that interacts with FX.AllowGPUParticles is bAllowGPUParticles. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the entire particle system’s behavior. Enabling or disabling GPU particles can have significant performance implications, especially on different hardware configurations.
Best practices when using this variable include:
- Testing the performance impact of enabling/disabling GPU particles on target hardware.
- Considering the target platforms and their GPU capabilities when deciding to use GPU particles.
- Using this in conjunction with other particle system optimizations for best results.
Regarding the associated variable bAllowGPUParticles:
The purpose of bAllowGPUParticles is the same as FX.AllowGPUParticles - to control whether GPU particles are allowed.
It is used in the FXSystem and rendering subsystems, as evident from its usage in FXSystem.cpp and FXSystem.h.
The value of bAllowGPUParticles is set in tandem with FX.AllowGPUParticles through the console variable system.
This variable directly interacts with the RHISupportsGPUParticles() function, which checks if the current rendering hardware interface supports GPU particles.
Developers should be aware that this variable is used in conditional checks to determine if GPU particles should be used. It’s part of a larger check that includes other GPU capabilities.
Best practices for using bAllowGPUParticles include:
- Checking its value in conjunction with other GPU capability checks when implementing particle systems.
- Understanding that it’s not just a simple on/off switch, but part of a more complex system check for GPU particle support.
- Considering fallback options for when GPU particles are not supported or allowed.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:35, section: [Mobile DeviceProfile]
- INI Section:
Mobile DeviceProfile
- Raw value:
1
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/FXSystem.cpp:211
Scope (from outer to inner):
file
namespace FXConsoleVariables
Source code excerpt:
int32 bAllowGPUParticles = true;
FAutoConsoleVariableRef CVarAllowGPUParticles(
TEXT("FX.AllowGPUParticles"),
bAllowGPUParticles,
TEXT("If true, allow the usage of GPU particles.")
);
}
/*------------------------------------------------------------------------------
#Loc: <Workspace>/Engine/Plugins/VirtualProduction/ICVFXTesting/Source/ICVFXTesting/Public/ICVFXTestControllerBase.h:79
Scope (from outer to inner):
file
class class UICVFXTestControllerBase : public UGauntletTestController
Source code excerpt:
TEXT("r.ReflectionMethod"),
TEXT("r.Lumen"),
TEXT("FX.AllowGPUParticles"),
TEXT("r.Shadow.Virtual.Enable")};
uint32 RunCount;
bool bRequestsFPSChart;
bool bRequestsMemReport;
#Associated Variable and Callsites
This variable is associated with another variable named bAllowGPUParticles
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/FXSystem.cpp:209
Scope (from outer to inner):
file
namespace FXConsoleVariables
Source code excerpt:
ECVF_Cheat
);
int32 bAllowGPUParticles = true;
FAutoConsoleVariableRef CVarAllowGPUParticles(
TEXT("FX.AllowGPUParticles"),
bAllowGPUParticles,
TEXT("If true, allow the usage of GPU particles.")
);
}
/*------------------------------------------------------------------------------
FX system.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/FXSystem.h:87
Scope (from outer to inner):
file
namespace FXConsoleVariables
Source code excerpt:
extern TAutoConsoleVariable<int32> TestGPUSort;
/** true if GPU particles are allowed. */
extern int32 bAllowGPUParticles;
}
/**
* Returns true if the shader platform supports GPU particles.
*/
inline bool SupportsGPUParticles(EShaderPlatform Platform)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/FXSystem.h:106
Scope (from outer to inner):
file
function inline bool RHISupportsGPUParticles
Source code excerpt:
inline bool RHISupportsGPUParticles()
{
return FXConsoleVariables::bAllowGPUParticles
&& GSupportsWideMRT
&& GPixelFormats[PF_G32R32F].Supported
&& GSupportsTexture3D;
}
class FFXSystemInterface;