HErodeIterationNum
HErodeIterationNum
#Overview
name: HErodeIterationNum
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of HErodeIterationNum is to control the number of iterations in the hydro erosion simulation for landscape editing in Unreal Engine 5. This setting variable is specifically used in the landscape editing system, particularly for the hydro erosion tool.
The Unreal Engine subsystem that relies on this setting variable is the Landscape Editor module, as evidenced by its usage in the LandscapeEditor source files.
The value of this variable is set in several places:
- It is initialized in the ULandscapeEditorObject constructor.
- It can be loaded from the project’s configuration file using GConfig->GetInt().
- It can be saved to the project’s configuration file using GConfig->SetInt().
- It is exposed as an editable property in the ULandscapeEditorObject class, allowing users to modify it through the Unreal Editor interface.
This variable interacts with other erosion-related variables such as RainAmount, SedimentCapacity, and DissolvingRatio in the hydro erosion simulation process.
Developers must be aware that:
- This variable directly affects the simulation’s performance and result quality.
- It has a recommended range (ClampMin=“1”, ClampMax=“300”, UIMin=“1”, UIMax=“150”) to prevent extreme values that might cause performance issues or unrealistic results.
Best practices when using this variable include:
- Start with lower values and gradually increase to find a balance between simulation quality and performance.
- Consider the size and complexity of the landscape when setting this value.
- Use in conjunction with other erosion parameters for realistic results.
- Remember that higher values will increase computation time, so optimize for your specific use case.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:747, section: [LandscapeEdit]
- INI Section:
LandscapeEdit
- Raw value:
28
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEdModeErosionTools.cpp:358
Scope (from outer to inner):
file
class class FLandscapeToolStrokeHydraErosion : public FLandscapeToolStrokeErosionBase
function void Apply
Source code excerpt:
Y2 += 1;
const int32 Iteration = UISettings->HErodeIterationNum;
const uint16 RainAmount = static_cast<uint16>(UISettings->RainAmount);
const float DissolvingRatio = 0.07f * UISettings->GetCurrentToolStrength() * Pressure; //0.01;
const float EvaporateRatio = 0.5f;
const float SedimentCapacity = 0.10f * UISettings->SedimentCapacity; //DissolvingRatio; //0.01;
TArray<uint16> HeightData;
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:64
Scope (from outer to inner):
file
function ULandscapeEditorObject::ULandscapeEditorObject
Source code excerpt:
, RainAmount(128)
, SedimentCapacity(0.3f)
, HErodeIterationNum(75)
, RainDistMode(ELandscapeToolHydroErosionMode::Both)
, RainDistScale(60.0f)
, bHErosionDetailSmooth(true)
, HErosionDetailScale(0.01f)
, NoiseMode(ELandscapeToolNoiseMode::Both)
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:280
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Load
Source code excerpt:
GConfig->GetInt(TEXT("LandscapeEdit"), TEXT("RainAmount"), RainAmount, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("SedimentCapacity"), SedimentCapacity, GEditorPerProjectIni);
GConfig->GetInt(TEXT("LandscapeEdit"), TEXT("HErodeIterationNum"), HErodeIterationNum, GEditorPerProjectIni);
int32 InRainDistMode = (int32)RainDistMode;
GConfig->GetInt(TEXT("LandscapeEdit"), TEXT("RainDistNoiseMode"), InRainDistMode, GEditorPerProjectIni);
RainDistMode = (ELandscapeToolHydroErosionMode)InRainDistMode;
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("RainDistScale"), RainDistScale, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("HErosionDetailScale"), HErosionDetailScale, GEditorPerProjectIni);
bool InbHErosionDetailSmooth = bHErosionDetailSmooth;
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:431
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Save
Source code excerpt:
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("RainAmount"), RainAmount, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("SedimentCapacity"), SedimentCapacity, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("HErodeIterationNum"), ErodeIterationNum, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("RainDistMode"), (int32)RainDistMode, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("RainDistScale"), RainDistScale, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("HErosionDetailScale"), HErosionDetailScale, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bHErosionDetailSmooth"), bHErosionDetailSmooth, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("NoiseMode"), (int32)NoiseMode, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:409
Scope (from outer to inner):
file
class class ULandscapeEditorObject : public UObject
Source code excerpt:
// Number of erosion iterations, more means more erosion but is slower
UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Iterations", ShowForTools="HydraErosion", ClampMin="1", ClampMax="300", UIMin="1", UIMax="150"))
int32 HErodeIterationNum;
// Selects how rain is distributed over the brush area for hydro erosion
UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Initial Rain Distribution", ShowForTools="HydraErosion"))
ELandscapeToolHydroErosionMode RainDistMode;
// The size of the noise filter for applying initial rain to the surface