landscape.TrackDirty
landscape.TrackDirty
#Overview
name: landscape.TrackDirty
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
This will track the accumulation of data changes during the layer blend phase.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of landscape.TrackDirty is to track the accumulation of data changes during the layer blend phase in Unreal Engine’s landscape system.
This setting variable is primarily used in the Landscape module of Unreal Engine 5. It is specifically utilized in the landscape editing and layer blending processes.
The value of this variable is set through a console variable (CVar) named CVarLandscapeTrackDirty. It is defined in the LandscapeEditLayers.cpp file and initialized with a default value of 0.
The associated variable CVarLandscapeTrackDirty interacts directly with landscape.TrackDirty. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the performance and behavior of landscape editing operations. When enabled (set to a non-zero value), it will track changes in landscape data, which can be useful for debugging but may impact performance.
Best practices when using this variable include:
- Only enable it when necessary for debugging or specific development tasks.
- Be aware of potential performance implications when enabled.
- Use in conjunction with other landscape debugging tools and variables for comprehensive analysis.
Regarding the associated variable CVarLandscapeTrackDirty:
The purpose of CVarLandscapeTrackDirty is to provide programmatic access to the landscape.TrackDirty setting within the C++ code.
It is used in the Landscape module, specifically in functions related to clearing dirty data (ClearDirtyData) and handling changes in weightmaps and heightmaps (OnDirtyWeightmap and OnDirtyHeightmap).
The value of CVarLandscapeTrackDirty is set when the console variable landscape.TrackDirty is modified.
It interacts with other debugging variables like CVarLandscapeDumpDiffDetails and is often used in conjunction with them for more comprehensive landscape debugging.
Developers should be aware that the value of CVarLandscapeTrackDirty is checked in performance-sensitive areas of the landscape editing code. Enabling it may have performance implications.
Best practices for using CVarLandscapeTrackDirty include:
- Use GetValueOnGameThread() or GetValueOnAnyThread() methods to access its value safely from different thread contexts.
- Consider the performance impact when enabling this tracking in production environments.
- Use it in combination with other landscape debugging tools for a more complete picture of landscape data changes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeEditLayers.cpp:166
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarLandscapeTrackDirty(
TEXT("landscape.TrackDirty"),
0,
TEXT("This will track the accumulation of data changes during the layer blend phase."));
TAutoConsoleVariable<int32> CVarLandscapeForceFlush(
TEXT("landscape.ForceFlush"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarLandscapeTrackDirty
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeEditLayers.cpp:165
Scope: file
Source code excerpt:
TEXT("This will highlight the data that has changed during the layer blend phase."));
TAutoConsoleVariable<int32> CVarLandscapeTrackDirty(
TEXT("landscape.TrackDirty"),
0,
TEXT("This will track the accumulation of data changes during the layer blend phase."));
TAutoConsoleVariable<int32> CVarLandscapeForceFlush(
TEXT("landscape.ForceFlush"),
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeEditLayers.cpp:5218
Scope (from outer to inner):
file
function void ALandscape::ClearDirtyData
Source code excerpt:
}
if (!CVarLandscapeTrackDirty.GetValueOnAnyThread())
{
return;
}
FLandscapeEditDataInterface LandscapeEdit(GetLandscapeInfo());
const int32 X1 = InLandscapeComponent->GetSectionBase().X;
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeEditLayers.cpp:5273
Scope (from outer to inner):
file
function void ALandscape::OnDirtyWeightmap
Source code excerpt:
const bool bDumpDiffAllMips = (DumpWeightmapDiff > 1);
const bool bDumpDiffDetails = CVarLandscapeDumpDiffDetails.GetValueOnGameThread();
const bool bTrackDirty = CVarLandscapeTrackDirty.GetValueOnGameThread() != 0;
ULandscapeSubsystem* LandscapeSubsystem = GetWorld()->GetSubsystem<ULandscapeSubsystem>();
check(LandscapeSubsystem != nullptr);
const FDateTime CurrentTime = LandscapeSubsystem->GetAppCurrentDateTime();
if ((!bDumpDiff && !bTrackDirty)
|| (bDumpDiff && !bDumpDiffAllMips && (InMipLevel > 0))
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeEditLayers.cpp:5405
Scope (from outer to inner):
file
function void ALandscape::OnDirtyHeightmap
Source code excerpt:
const bool bDumpDiffAllMips = (DumpHeightmapDiff > 1);
const bool bDumpDiffDetails = CVarLandscapeDumpDiffDetails.GetValueOnGameThread();
const bool bTrackDirty = CVarLandscapeTrackDirty.GetValueOnGameThread() != 0;
ULandscapeSubsystem* LandscapeSubsystem = GetWorld()->GetSubsystem<ULandscapeSubsystem>();
check(LandscapeSubsystem != nullptr);
const FDateTime CurrentTime = LandscapeSubsystem->GetAppCurrentDateTime();
if ((!bDumpDiff && !bTrackDirty)
|| (bDumpDiff && !bDumpDiffAllMips && (InMipLevel > 0))