fx.Cascade.SkipZeroDeltaTime
fx.Cascade.SkipZeroDeltaTime
#Overview
name: fx.Cascade.SkipZeroDeltaTime
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When enabled a delta tick time of nearly 0.0 will cause us to skip the component update.\nThis fixes issue like PSA_Velocity aligned sprites, but could cause issues with things that rely on accurate velocities (i.e. TSR).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of fx.Cascade.SkipZeroDeltaTime is to control whether particle system updates are skipped when the delta time between frames is nearly zero. This setting is primarily used in the particle system and rendering components of Unreal Engine 5.
This setting variable is relied upon by the Engine module, specifically within the particle system components. It’s used in the UParticleSystemComponent class, which is responsible for managing and updating particle effects in the engine.
The value of this variable is set through an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. By default, it is set to true.
The associated variable GFXSkipZeroDeltaTime directly interacts with fx.Cascade.SkipZeroDeltaTime. They share the same value and are used interchangeably in the code.
Developers must be aware that enabling this variable (which is the default behavior) can fix issues with velocity-aligned sprites in particle systems. However, it may cause problems with features that rely on accurate velocities, such as Temporal Super Resolution (TSR).
Best practices when using this variable include:
- Keep it enabled (default) unless specific issues arise with velocity-dependent features.
- If disabling it, thoroughly test particle systems, especially those using velocity-aligned sprites.
- Monitor performance impacts, as disabling this could lead to unnecessary updates in scenarios with very small delta times.
Regarding the associated variable GFXSkipZeroDeltaTime:
The purpose of GFXSkipZeroDeltaTime is to provide a direct, code-level access to the same functionality as fx.Cascade.SkipZeroDeltaTime. It’s used within the engine’s C++ code to check whether particle system updates should be skipped for near-zero delta times.
This variable is used in the Engine module, specifically within the UParticleSystemComponent::TickComponent function.
The value of GFXSkipZeroDeltaTime is set through the fx.Cascade.SkipZeroDeltaTime console variable, ensuring they always have the same value.
No other variables directly interact with GFXSkipZeroDeltaTime besides fx.Cascade.SkipZeroDeltaTime.
Developers should be aware that modifying GFXSkipZeroDeltaTime directly in code is not recommended, as its value is controlled by the console variable.
Best practices for GFXSkipZeroDeltaTime include:
- Use the console variable fx.Cascade.SkipZeroDeltaTime to modify its value rather than changing it directly in code.
- When reading its value in code, be aware that it may change at runtime due to console commands.
- Consider the performance implications of disabling this feature, especially in scenarios with frequent, very small delta times.
#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:223
Scope: file
Source code excerpt:
static bool GFXSkipZeroDeltaTime = true;
FAutoConsoleVariableRef CVarFXSkipZeroDeltaTime(
TEXT("fx.Cascade.SkipZeroDeltaTime"),
GFXSkipZeroDeltaTime,
TEXT("When enabled a delta tick time of nearly 0.0 will cause us to skip the component update.\n")
TEXT("This fixes issue like PSA_Velocity aligned sprites, but could cause issues with things that rely on accurate velocities (i.e. TSR)."),
ECVF_Default);
/** Whether to allow particle systems to perform work. */
#Associated Variable and Callsites
This variable is associated with another variable named GFXSkipZeroDeltaTime
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:221
Scope: file
Source code excerpt:
ECVF_Default);
static bool GFXSkipZeroDeltaTime = true;
FAutoConsoleVariableRef CVarFXSkipZeroDeltaTime(
TEXT("fx.Cascade.SkipZeroDeltaTime"),
GFXSkipZeroDeltaTime,
TEXT("When enabled a delta tick time of nearly 0.0 will cause us to skip the component update.\n")
TEXT("This fixes issue like PSA_Velocity aligned sprites, but could cause issues with things that rely on accurate velocities (i.e. TSR)."),
ECVF_Default);
/** Whether to allow particle systems to perform work. */
ENGINE_API bool GIsAllowingParticles = true;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleComponents.cpp:5484
Scope (from outer to inner):
file
function void UParticleSystemComponent::TickComponent
Source code excerpt:
DeltaTime *= CustomTimeDilation;
DeltaTimeTick = DeltaTime;
if (FMath::IsNearlyZero(DeltaTimeTick) && GFXSkipZeroDeltaTime)
{
return;
}
AccumTickTime += DeltaTime;