ErosionNoiseScale
ErosionNoiseScale
#Overview
name: ErosionNoiseScale
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 ErosionNoiseScale is to control the size of the perlin noise filter used in the Landscape Erosion tool within Unreal Engine 5. This variable is specifically used for the terrain editing and modification system, particularly for simulating erosion effects on landscape surfaces.
ErosionNoiseScale is primarily used in the Landscape Editor module of Unreal Engine 5. It is referenced in the LandscapeEdModeErosionTools and LandscapeEditorObject classes, which are part of the landscape editing system.
The value of this variable is set in several ways:
- It can be initialized in the ULandscapeEditorObject constructor.
- It can be loaded from the project’s configuration file (GEditorPerProjectIni) in the ULandscapeEditorObject::Load function.
- It can be saved to the project’s configuration file in the ULandscapeEditorObject::Save function.
- It can be modified through the Unreal Editor interface, as indicated by the UPROPERTY macro with EditAnywhere attribute.
ErosionNoiseScale interacts with other variables in the erosion system, such as ErosionNoiseMode and BrushValue. These variables work together to determine the intensity and pattern of the erosion effect.
Developers should be aware that:
- The variable is clamped between 1 and 512, with UI limits between 1.1 and 256.
- It directly affects the visual outcome of the erosion tool, so adjusting it can significantly change the appearance of the landscape.
- The scale of this variable is in Unreal Engine units, which typically correspond to centimeters.
Best practices when using this variable include:
- Experiment with different values to achieve the desired erosion effect, as the optimal value can vary depending on the scale and detail of your landscape.
- Consider the overall scale of your landscape when setting this value. Larger landscapes might benefit from higher values to maintain visual consistency.
- Use in conjunction with other erosion parameters like ErosionNoiseMode for more precise control over the erosion effect.
- Save preferred settings to the project configuration for consistency across editing sessions.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:743, section: [LandscapeEdit]
- INI Section:
LandscapeEdit
- Raw value:
60.000000
- 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:275
Scope (from outer to inner):
file
class class FLandscapeToolStrokeErosion : public FLandscapeToolStrokeErosionBase
function void Apply
Source code excerpt:
if (BrushValue > 0.0f)
{
FNoiseParameter NoiseParam(0, UISettings->ErosionNoiseScale, BrushValue * Thresh * UISettings->GetCurrentToolStrength() * BrushSizeAdjust);
float PaintAmount = NoiseModeConversion((ELandscapeToolNoiseMode)UISettings->ErosionNoiseMode, NoiseParam.NoiseAmount, NoiseParam.Sample(X, Y));
HeightData[(X - X1) + (Y - Y1)*(1 + X2 - X1)] = FLandscapeHeightCache::ClampValue(static_cast<int32>(HeightData[(X - X1) + (Y - Y1)*(1 + X2 - X1)] + PaintAmount));
}
}
}
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:59
Scope (from outer to inner):
file
function ULandscapeEditorObject::ULandscapeEditorObject
Source code excerpt:
, ErodeIterationNum(28)
, ErosionNoiseMode(ELandscapeToolErosionMode::Lower)
, ErosionNoiseScale(60.0f)
, bErosionUseLayerHardness(false)
, RainAmount(128)
, SedimentCapacity(0.3f)
, HErodeIterationNum(75)
, RainDistMode(ELandscapeToolHydroErosionMode::Both)
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:275
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Load
Source code excerpt:
GConfig->GetInt(TEXT("LandscapeEdit"), TEXT("ErosionNoiseMode"), InErosionNoiseMode, GEditorPerProjectIni);
ErosionNoiseMode = (ELandscapeToolErosionMode)InErosionNoiseMode;
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("ErosionNoiseScale"), ErosionNoiseScale, GEditorPerProjectIni);
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bErosionUseLayerHardness"), bErosionUseLayerHardness, GEditorPerProjectIni);
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;
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:426
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Save
Source code excerpt:
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("ErodeSurfaceThickness"), ErodeSurfaceThickness, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("ErosionNoiseMode"), (int32)ErosionNoiseMode, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("ErosionNoiseScale"), ErosionNoiseScale, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bErosionUseLayerHardness"), bErosionUseLayerHardness, GEditorPerProjectIni);
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);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:391
Scope (from outer to inner):
file
class class ULandscapeEditorObject : public UObject
Source code excerpt:
// The size of the perlin noise filter used
UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Noise Scale", ShowForTools="Erosion", ClampMin="1", ClampMax="512", UIMin="1.1", UIMax="256"))
float ErosionNoiseScale;
// Whether the erosion tool should take into account the paint layer's hardness parameter (a hardness of 0 means the layer is fully affected by erosion, while 1 means fully unaffected)
UPROPERTY(Category = "Tool Settings", EditAnywhere, NonTransactional, meta = (DisplayName = "Use Layer Hardness", ShowForTools = "Erosion"))
bool bErosionUseLayerHardness;
// Hydraulic Erosion Tool: