p.Chaos.GC.UseCustomRenderer
p.Chaos.GC.UseCustomRenderer
#Overview
name: p.Chaos.GC.UseCustomRenderer
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When enabled, use a custom renderer if specified
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.GC.UseCustomRenderer is to control whether a custom renderer should be used for Geometry Collection components in the Chaos physics system of Unreal Engine 5.
This setting variable is primarily used in the Geometry Collection subsystem, which is part of the experimental Chaos physics engine in Unreal Engine 5. It’s specifically referenced in the GeometryCollectionComponent.cpp file, indicating its relevance to the Geometry Collection component.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands. Its default value is set to true.
The associated variable bChaos_GC_UseCustomRenderer directly interacts with p.Chaos.GC.UseCustomRenderer. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the rendering of Geometry Collection components. When enabled and a custom renderer is specified, it allows the use of that custom renderer for these components.
Best practices when using this variable include:
- Ensure that a custom renderer is properly implemented and assigned when enabling this feature.
- Be cautious when modifying this value at runtime, as it may affect performance or visual consistency.
- Test thoroughly in both editor and game worlds, as the CanUseCustomRenderer() function checks if the world is a game world.
Regarding the associated variable bChaos_GC_UseCustomRenderer:
- Its purpose is identical to p.Chaos.GC.UseCustomRenderer, serving as the actual boolean flag checked in the code.
- It’s used directly in the CanUseCustomRenderer() function of the UGeometryCollectionComponent class.
- The value is set through the console variable system, allowing for runtime modification.
- It interacts with the CustomRenderer pointer and the world state to determine if a custom renderer can be used.
- Developers should be aware that this variable is checked in conjunction with other conditions (CustomRenderer != nullptr and GetWorld()->IsGameWorld()) to determine if a custom renderer should be used.
- Best practices include ensuring that all conditions for using a custom renderer are met when this flag is enabled, and considering the impact on performance and visual consistency when modifying its value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:110
Scope: file
Source code excerpt:
bool bChaos_GC_UseCustomRenderer = true;
FAutoConsoleVariableRef CVarChaosGCUseCustomRenderer(TEXT("p.Chaos.GC.UseCustomRenderer"), bChaos_GC_UseCustomRenderer, TEXT("When enabled, use a custom renderer if specified"));
bool bChaos_GC_InitConstantDataUseParallelFor = true;
FAutoConsoleVariableRef CVarChaosGCInitConstantDataUseParallelFor(TEXT("p.Chaos.GC.InitConstantDataUseParallelFor"), bChaos_GC_InitConstantDataUseParallelFor, TEXT("When enabled, InitConstant data will use parallelFor for copying some of the data"));
int32 bChaos_GC_InitConstantDataParallelForBatchSize = 5000;
FAutoConsoleVariableRef CVarChaosGCInitConstantDataParallelForBatchSize(TEXT("p.Chaos.GC.InitConstantDataParallelForBatchSize"), bChaos_GC_InitConstantDataParallelForBatchSize, TEXT("When parallelFor is used in InitConstantData, defined the minimium size of a batch of vertex "));
#Associated Variable and Callsites
This variable is associated with another variable named bChaos_GC_UseCustomRenderer
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:109
Scope: file
Source code excerpt:
#endif
bool bChaos_GC_UseCustomRenderer = true;
FAutoConsoleVariableRef CVarChaosGCUseCustomRenderer(TEXT("p.Chaos.GC.UseCustomRenderer"), bChaos_GC_UseCustomRenderer, TEXT("When enabled, use a custom renderer if specified"));
bool bChaos_GC_InitConstantDataUseParallelFor = true;
FAutoConsoleVariableRef CVarChaosGCInitConstantDataUseParallelFor(TEXT("p.Chaos.GC.InitConstantDataUseParallelFor"), bChaos_GC_InitConstantDataUseParallelFor, TEXT("When enabled, InitConstant data will use parallelFor for copying some of the data"));
int32 bChaos_GC_InitConstantDataParallelForBatchSize = 5000;
FAutoConsoleVariableRef CVarChaosGCInitConstantDataParallelForBatchSize(TEXT("p.Chaos.GC.InitConstantDataParallelForBatchSize"), bChaos_GC_InitConstantDataParallelForBatchSize, TEXT("When parallelFor is used in InitConstantData, defined the minimium size of a batch of vertex "));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:6333
Scope (from outer to inner):
file
function bool UGeometryCollectionComponent::CanUseCustomRenderer
Source code excerpt:
bool UGeometryCollectionComponent::CanUseCustomRenderer() const
{
return bChaos_GC_UseCustomRenderer && CustomRenderer != nullptr && GetWorld()->IsGameWorld();
}
void UGeometryCollectionComponent::RefreshCustomRenderer()
{
if (CanUseCustomRenderer())
{