bDetailSmooth

bDetailSmooth

#Overview

name: bDetailSmooth

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 bDetailSmooth is to control whether detail-preserving smoothing should be applied during landscape editing operations in Unreal Engine 5. This variable is specifically used in the Landscape editing system, particularly for the smooth brush tool.

The Unreal Engine subsystem that relies on this setting variable is the Landscape Editor module. It’s primarily used within the LandscapeEditor subsystem, which is responsible for terrain editing tools and operations.

The value of this variable is set in multiple places:

  1. It’s initialized in the ULandscapeEditorObject constructor.
  2. It can be loaded from the project’s configuration file (GEditorPerProjectIni) in the ULandscapeEditorObject::Load() function.
  3. It can be modified through the Unreal Editor’s user interface, as it’s exposed as an editable property (UPROPERTY).

This variable interacts closely with the DetailScale variable, which determines the intensity of the detail-preserving smoothing when bDetailSmooth is true.

Developers should be aware that:

  1. This variable is a boolean flag that enables or disables the detail-preserving smoothing feature.
  2. When enabled, it affects the behavior of the smooth brush tool in the Landscape Editor.
  3. It’s part of the non-transactional properties, meaning it won’t be automatically included in undo/redo operations.

Best practices when using this variable include:

  1. Use it in conjunction with the DetailScale variable to fine-tune the smoothing operation.
  2. Consider the performance impact of enabling detail-preserving smoothing, especially on large landscapes.
  3. Save the state of this variable in the project configuration to maintain consistency across editing sessions.
  4. Be mindful of its interaction with other smoothing parameters like SmoothFilterKernelSize.

By properly utilizing bDetailSmooth, developers can achieve more nuanced and controlled smoothing operations in landscape editing, preserving important terrain details while still allowing for overall terrain smoothing.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:756, section: [LandscapeEdit]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEdModePaintTools.cpp:761

Scope (from outer to inner):

file
class        class FLandscapeToolStrokeSmooth : public FLandscapeToolStrokePaintBase<ToolTarget>
function     void Apply

Source code excerpt:


		// Apply the brush
		if (UISettings->bDetailSmooth)
		{
			LowPassFilter<ValueType>(X1, Y1, X2, Y2, BrushInfo, Data, UISettings->DetailScale, ToolStrength);
		}
		else
		{
			const int32 FilterRadius = UISettings->SmoothFilterKernelSize;

#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:52

Scope (from outer to inner):

file
function     ULandscapeEditorObject::ULandscapeEditorObject

Source code excerpt:


	, SmoothFilterKernelSize(4)
	, bDetailSmooth(false)
	, DetailScale(0.3f)

	, ErodeThresh(64)
	, ErodeSurfaceThickness(256)
	, ErodeIterationNum(28)
	, ErosionNoiseMode(ELandscapeToolErosionMode::Lower)

#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:297

Scope (from outer to inner):

file
function     void ULandscapeEditorObject::Load

Source code excerpt:

	GConfig->GetInt(TEXT("LandscapeEdit"), TEXT("SmoothFilterKernelSize"), SmoothFilterKernelSize, GEditorPerProjectIni);
	GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("DetailScale"), DetailScale, GEditorPerProjectIni);
	bool InbDetailSmooth = bDetailSmooth;
	GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bDetailSmooth"), InbDetailSmooth, GEditorPerProjectIni);
	bDetailSmooth = InbDetailSmooth;

	GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("MaximumValueRadius"), MaximumValueRadius, GEditorPerProjectIni);

	bool InbSmoothGizmoBrush = bSmoothGizmoBrush;
	GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bSmoothGizmoBrush"), InbSmoothGizmoBrush, GEditorPerProjectIni);
	bSmoothGizmoBrush = InbSmoothGizmoBrush;

#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:441

Scope (from outer to inner):

file
function     void ULandscapeEditorObject::Save

Source code excerpt:

	GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("SmoothFilterKernelSize"), SmoothFilterKernelSize, GEditorPerProjectIni);
	GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("DetailScale"), DetailScale, GEditorPerProjectIni);
	GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bDetailSmooth"), bDetailSmooth, GEditorPerProjectIni);

	GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("MaximumValueRadius"), MaximumValueRadius, GEditorPerProjectIni);

	GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bSmoothGizmoBrush"), bSmoothGizmoBrush, GEditorPerProjectIni);
	GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("PasteMode"), (int32)PasteMode, GEditorPerProjectIni);

#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:365

Scope (from outer to inner):

file
class        class ULandscapeEditorObject : public UObject

Source code excerpt:

	// If checked, performs a detail preserving smooth using the specified detail smoothing value
	UPROPERTY(Category = "Tool Settings", NonTransactional, EditAnywhere, meta = (InlineEditConditionToggle))
	bool bDetailSmooth;

	// Larger detail smoothing values remove more details, while smaller values preserve more details
	UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Detail Smooth", EditCondition="bDetailSmooth", ShowForTools="Smooth", ClampMin="0", ClampMax="0.99"))
	float DetailScale;

	// Erosion Tool: