fx.PSCMan.Enable
fx.PSCMan.Enable
#Overview
name: fx.PSCMan.Enable
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If PSC world manager is enabled.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of fx.PSCMan.Enable is to control whether the Particle System Component (PSC) World Manager is enabled or disabled in Unreal Engine 5. This setting is primarily used for managing particle system components within the game world.
This setting variable is used in the Particle System subsystem of Unreal Engine 5, specifically within the Engine module. It affects the behavior of particle system components and how they are managed in the game world.
The value of this variable is set through a console variable (CVar) named “fx.PSCMan.Enable”. It is initialized with a default value of 1 (enabled) but can be changed at runtime through the console or configuration files.
The fx.PSCMan.Enable variable interacts closely with its associated variable GbEnablePSCWorldManager. They share the same value and are used interchangeably in the code.
Developers must be aware that changing this variable affects the performance and behavior of particle systems in the game. When enabled, it allows for more efficient management of particle system components, potentially improving performance.
Best practices when using this variable include:
- Consider performance implications when enabling or disabling the PSC World Manager.
- Test thoroughly in different scenarios to ensure particle systems behave correctly with the chosen setting.
- Be cautious when changing this value at runtime, as it may affect existing particle systems in the game world.
Regarding the associated variable GbEnablePSCWorldManager:
The purpose of GbEnablePSCWorldManager is to serve as the internal representation of the fx.PSCMan.Enable console variable within the engine’s C++ code.
This variable is used in the Particle System subsystem, specifically in the ParticleSystemManager and ParticleComponents.
The value of GbEnablePSCWorldManager is set by the console variable fx.PSCMan.Enable and is used throughout the engine code to determine if the PSC World Manager should be active.
GbEnablePSCWorldManager interacts directly with fx.PSCMan.Enable and is used in various parts of the particle system code to control behavior.
Developers should be aware that this variable is used to determine whether particle system components should be tick managed by the PSC World Manager.
Best practices for using GbEnablePSCWorldManager include:
- Avoid directly modifying this variable in code; instead, use the console variable fx.PSCMan.Enable to change its value.
- Be aware of its impact on particle system performance and behavior when developing or optimizing particle effects.
- Consider its value when debugging particle system issues, as it can significantly affect how particle components are updated and managed.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:22
Scope: file
Source code excerpt:
int32 GbEnablePSCWorldManager = 1;
FAutoConsoleVariableRef CVarEnablePSCWorldManager(
TEXT("fx.PSCMan.Enable"),
GbEnablePSCWorldManager,
TEXT("If PSC world manager is enabled."),
ECVF_Scalability
);
int32 GParticleManagerAsyncBatchSize = INITIAL_PSC_MANAGER_ASYNC_BATCH_SIZE;
#Associated Variable and Callsites
This variable is associated with another variable named GbEnablePSCWorldManager
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Particles/ParticleSystemManager.h:197
Scope: file
Source code excerpt:
};
extern ENGINE_API int32 GbEnablePSCWorldManager;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:6575
Scope (from outer to inner):
file
function bool UParticleSystemComponent::ShouldBeTickManaged
Source code excerpt:
#endif
return
GbEnablePSCWorldManager &&
Template && Template->AllowManagedTicking() &&
PrimaryComponentTick.GetPrerequisites().Num() <= 1 &&//Don't batch tick if we have complex prerequisites.
GetAttachChildren().Num() == 0 &&//Don't batch tick if people are attached and dependent on us.
!IsNetMode(NM_DedicatedServer);//Never allow for dedicated servers. Use existing tick mechanisms to avoid these.
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:20
Scope: file
Source code excerpt:
//PRAGMA_DISABLE_OPTIMIZATION
int32 GbEnablePSCWorldManager = 1;
FAutoConsoleVariableRef CVarEnablePSCWorldManager(
TEXT("fx.PSCMan.Enable"),
GbEnablePSCWorldManager,
TEXT("If PSC world manager is enabled."),
ECVF_Scalability
);
int32 GParticleManagerAsyncBatchSize = INITIAL_PSC_MANAGER_ASYNC_BATCH_SIZE;
FAutoConsoleVariableRef CVarParticleManagerAsyncBatchSize(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:224
Scope (from outer to inner):
file
function FParticleSystemWorldManager::FParticleSystemWorldManager
Source code excerpt:
TickFunctions.SetNum(TG_NewlySpawned);
bCachedParticleWorldManagerEnabled = GbEnablePSCWorldManager;
for (int32 TickGroup = 0; TickGroup < TickFunctions.Num(); ++TickGroup)
{
FParticleSystemWorldManagerTickFunction& TickFunc = TickFunctions[TickGroup];
TickFunc.TickGroup = (ETickingGroup)TickGroup;
TickFunc.EndTickGroup = TickFunc.TickGroup;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:756
Scope (from outer to inner):
file
function void FParticleSystemWorldManager::HandleManagerEnabled
Source code excerpt:
void FParticleSystemWorldManager::HandleManagerEnabled()
{
if (GbEnablePSCWorldManager != bCachedParticleWorldManagerEnabled)
{
bCachedParticleWorldManagerEnabled = GbEnablePSCWorldManager;
//SetComponentTick on all PSCs. This will set their correct tick state for the current GbEnablePSCWorldManager.
for (TObjectIterator<UParticleSystemComponent> PSCIt; PSCIt; ++PSCIt)
{
UParticleSystemComponent* PSC = *PSCIt;
check(PSC);
UWorld* PSCWorld = PSC->GetWorld();
if (PSCWorld == World)