p.ChaosCloth.Solver.ParallelClothUpdate
p.ChaosCloth.Solver.ParallelClothUpdate
#Overview
name: p.ChaosCloth.Solver.ParallelClothUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Skin the physics mesh and do the other cloth update for each cloth in parallel.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.Solver.ParallelClothUpdate is to control whether the cloth update process in the Chaos Cloth simulation should be performed in parallel for each cloth instance. This setting is part of the Chaos Cloth system, which is a physics-based cloth simulation module in Unreal Engine 5.
- The Chaos Cloth plugin, specifically the ChaosCloth module, relies on this setting variable.
- The value of this variable is set through an FAutoConsoleVariableRef, which allows it to be modified at runtime via console commands.
- This variable interacts with the associated boolean variable bClothSolverParallelClothUpdate. They share the same value and purpose.
- Developers must be aware that enabling this setting can improve performance on multi-core systems by parallelizing the cloth update process, but it may also introduce potential synchronization issues or race conditions if not properly managed.
- Best practices when using this variable include:
- Testing the performance impact with and without parallel updates for your specific use case.
- Ensuring that your cloth simulations are designed to work correctly in a parallel environment.
- Monitoring for any unexpected behavior or artifacts that may arise from parallel updates.
Regarding the associated variable bClothSolverParallelClothUpdate:
- Its purpose is identical to p.ChaosCloth.Solver.ParallelClothUpdate, serving as the internal boolean representation of the setting.
- It is used directly in the code to control the parallelization of the cloth update process, as seen in the FClothingSimulationSolver::Update function.
- The value is set by the FAutoConsoleVariableRef and can be modified at runtime.
- Developers should treat this variable as read-only within their code, relying on the console variable to modify its value.
- When working with this variable, it’s important to consider the potential performance implications and ensure that the rest of the cloth simulation code is compatible with parallel updates.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulationSolver.cpp:64
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FAutoConsoleVariableRef CVarClothSolverMinParallelBatchSize(TEXT("p.ChaosCloth.Solver.MinParallelBatchSize"), ClothSolverMinParallelBatchSize, TEXT("The minimum number of particle to process in parallel batch by the solver."));
FAutoConsoleVariableRef CVarClothSolverParallelClothPreUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothPreUpdate"), bClothSolverParallelClothPreUpdate, TEXT("Pre-transform the cloth particles for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverParallelClothUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothUpdate"), bClothSolverParallelClothUpdate, TEXT("Skin the physics mesh and do the other cloth update for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverParallelClothPostUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothPostUpdate"), bClothSolverParallelClothPostUpdate, TEXT("Pre-transform the cloth particles for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverDebugHitchLength(TEXT("p.ChaosCloth.Solver.DebugHitchLength"), ClothSolverDebugHitchLength, TEXT("Hitch length in ms. Create artificial hitches to debug simulation jitter. 0 to disable"));
FAutoConsoleVariableRef CVarClothSolverDebugHitchInterval(TEXT("p.ChaosCloth.Solver.DebugHitchInterval"), ClothSolverDebugHitchInterval, TEXT("Hitch interval in frames. Create artificial hitches to debug simulation jitter. 0 to disable"));
FAutoConsoleVariableRef CVarClothSolverDisableCollision(TEXT("p.ChaosCloth.Solver.DisableCollision"), bClothSolverDisableCollision, TEXT("Disable all collision particles. Needs reset of the simulation (p.ChaosCloth.Reset)."));
#endif
#Associated Variable and Callsites
This variable is associated with another variable named bClothSolverParallelClothUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulationSolver.cpp:51
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
static int32 ClothSolverMinParallelBatchSize = 1000;
static bool bClothSolverParallelClothPreUpdate = true;
static bool bClothSolverParallelClothUpdate = true;
static bool bClothSolverParallelClothPostUpdate = true;
static bool bClothSolverDisableTimeDependentNumIterations = false;
static bool bClothSolverUseVelocityScale = true;
static float ClothSolverMaxVelocity = 0.f;
#if !UE_BUILD_SHIPPING
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulationSolver.cpp:64
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FAutoConsoleVariableRef CVarClothSolverMinParallelBatchSize(TEXT("p.ChaosCloth.Solver.MinParallelBatchSize"), ClothSolverMinParallelBatchSize, TEXT("The minimum number of particle to process in parallel batch by the solver."));
FAutoConsoleVariableRef CVarClothSolverParallelClothPreUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothPreUpdate"), bClothSolverParallelClothPreUpdate, TEXT("Pre-transform the cloth particles for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverParallelClothUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothUpdate"), bClothSolverParallelClothUpdate, TEXT("Skin the physics mesh and do the other cloth update for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverParallelClothPostUpdate(TEXT("p.ChaosCloth.Solver.ParallelClothPostUpdate"), bClothSolverParallelClothPostUpdate, TEXT("Pre-transform the cloth particles for each cloth in parallel."));
FAutoConsoleVariableRef CVarClothSolverDebugHitchLength(TEXT("p.ChaosCloth.Solver.DebugHitchLength"), ClothSolverDebugHitchLength, TEXT("Hitch length in ms. Create artificial hitches to debug simulation jitter. 0 to disable"));
FAutoConsoleVariableRef CVarClothSolverDebugHitchInterval(TEXT("p.ChaosCloth.Solver.DebugHitchInterval"), ClothSolverDebugHitchInterval, TEXT("Hitch interval in frames. Create artificial hitches to debug simulation jitter. 0 to disable"));
FAutoConsoleVariableRef CVarClothSolverDisableCollision(TEXT("p.ChaosCloth.Solver.DisableCollision"), bClothSolverDisableCollision, TEXT("Disable all collision particles. Needs reset of the simulation (p.ChaosCloth.Reset)."));
#endif
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulationSolver.cpp:1927
Scope (from outer to inner):
file
namespace Chaos
function void FClothingSimulationSolver::Update
Source code excerpt:
Cloth->Update(this);
}, /*bForceSingleThreaded =*/ !bClothSolverParallelClothUpdate);
}
// Pre solver step, apply group space transforms for teleport and linear/delta ratios, ...etc
{
TRACE_CPUPROFILER_EVENT_SCOPE(FClothingSimulationSolver_UpdatePreSolverStep);
SCOPE_CYCLE_COUNTER(STAT_ChaosClothSolverUpdatePreSolverStep);