r.PhysicsField.ClipmapExponent
r.PhysicsField.ClipmapExponent
#Overview
name: r.PhysicsField.ClipmapExponent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Exponent used to derive each clipmap\'s size, together with r.PhysicsField.ClipmapDistance
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PhysicsField.ClipmapExponent is to determine the exponent used to derive each clipmap’s size in the physics field system of Unreal Engine 5. This setting is crucial for the physics simulation and rendering of physics fields within the engine.
This setting variable is primarily used in the Engine module, specifically within the PhysicsField subsystem. It’s directly referenced in the PhysicsFieldComponent.cpp file, which suggests it’s an integral part of the physics field component implementation.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 2 and can be modified at runtime using console commands or through configuration files.
The associated variable GPhysicsFieldClipmapExponent interacts directly with r.PhysicsField.ClipmapExponent. They share the same value, with GPhysicsFieldClipmapExponent being the actual global variable used in the C++ code, while r.PhysicsField.ClipmapExponent is the console variable name used for external access and modification.
Developers must be aware that changing this variable will affect the size calculation of each clipmap in the physics field system. It works in conjunction with another setting, r.PhysicsField.ClipmapDistance, to determine the final clipmap sizes. The exponent nature of this variable means that small changes can have significant effects on the clipmap sizes.
Best practices when using this variable include:
- Carefully consider the impact on performance and memory usage when adjusting this value.
- Test thoroughly after making changes, as it can significantly affect the behavior and appearance of physics fields.
- Use in conjunction with r.PhysicsField.ClipmapDistance for fine-tuning the physics field representation.
- Document any non-default values used in production to ensure consistency across the development team.
Regarding the associated variable GPhysicsFieldClipmapExponent:
The purpose of GPhysicsFieldClipmapExponent is to store the actual value used in the C++ code for the clipmap exponent in the physics field system.
This variable is used directly in the Engine module, specifically in the PhysicsFieldComponent. It’s assigned to the ClipmapExponent member of the FieldInfos structure, which suggests it’s used in the core calculations for physics field resources.
The value of GPhysicsFieldClipmapExponent is set by the console variable system through r.PhysicsField.ClipmapExponent. It’s initialized with a default value of 2.
GPhysicsFieldClipmapExponent interacts with other physics field-related variables such as GPhysicsFieldClipmapCount, GPhysicsFieldClipmapDistance, and GPhysicsFieldClipmapResolution, all of which contribute to defining the characteristics of the physics field system.
Developers should be aware that this variable is used directly in the creation of physics field resources and affects the overall structure of the physics field system. Changes to this variable will propagate through the entire physics field simulation.
Best practices for using GPhysicsFieldClipmapExponent include:
- Treat it as read-only in most cases, modifying it only through the r.PhysicsField.ClipmapExponent console variable.
- Consider its impact on other related variables and the overall physics field system when making adjustments.
- Use logging or debugging tools to verify that changes to r.PhysicsField.ClipmapExponent are correctly reflected in GPhysicsFieldClipmapExponent during runtime.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsField/PhysicsFieldComponent.cpp:74
Scope: file
Source code excerpt:
float GPhysicsFieldClipmapExponent = 2;
FAutoConsoleVariableRef CVarPhysicsFieldClipmapExponent(
TEXT("r.PhysicsField.ClipmapExponent"),
GPhysicsFieldClipmapExponent,
TEXT("Exponent used to derive each clipmap's size, together with r.PhysicsField.ClipmapDistance"),
ECVF_RenderThreadSafe
);
/** Resolution of each clipmaps */
#Associated Variable and Callsites
This variable is associated with another variable named GPhysicsFieldClipmapExponent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsField/PhysicsFieldComponent.cpp:72
Scope: file
Source code excerpt:
/** Exponent used to compute each clipmaps distance */
float GPhysicsFieldClipmapExponent = 2;
FAutoConsoleVariableRef CVarPhysicsFieldClipmapExponent(
TEXT("r.PhysicsField.ClipmapExponent"),
GPhysicsFieldClipmapExponent,
TEXT("Exponent used to derive each clipmap's size, together with r.PhysicsField.ClipmapDistance"),
ECVF_RenderThreadSafe
);
/** Resolution of each clipmaps */
int32 GPhysicsFieldClipmapResolution = 32;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsField/PhysicsFieldComponent.cpp:401
Scope (from outer to inner):
file
function FPhysicsFieldResource::FPhysicsFieldResource
Source code excerpt:
FieldInfos.bShowFields = false;
FieldInfos.ClipmapExponent = GPhysicsFieldClipmapExponent;
FieldInfos.ClipmapCount = GPhysicsFieldClipmapCount;
FieldInfos.ClipmapDistance = GPhysicsFieldClipmapDistance;
FieldInfos.ClipmapResolution = GPhysicsFieldClipmapResolution;
const uint32 CellsCount = FieldInfos.ClipmapCount * EFieldPhysicsType::Field_PhysicsType_Max;
FieldInfos.CellsOffsets.Init(0, CellsCount + 1);