landscape.OverrideLOD0Distribution
landscape.OverrideLOD0Distribution
#Overview
name: landscape.OverrideLOD0Distribution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When > 0, force override the LOD0DistributionSetting property on all landscapes, and ignore r.LandscapeLOD0DistributionScale
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of landscape.OverrideLOD0Distribution is to force override the LOD0DistributionSetting property on all landscapes and ignore the r.LandscapeLOD0DistributionScale setting. This variable is part of Unreal Engine’s landscape rendering system, which manages the level of detail (LOD) for landscape elements.
This setting variable is primarily used by the Landscape module in Unreal Engine. Based on the callsites, it’s clear that the landscape rendering system relies on this variable to determine the distribution of LOD0 (highest detail level) across the landscape.
The value of this variable is set through the console variable system, as indicated by the FAutoConsoleVariableRef declaration. It can be changed at runtime using console commands.
The associated variable GLandscapeLOD0DistributionOverride interacts directly with landscape.OverrideLOD0Distribution. They share the same value, with GLandscapeLOD0DistributionOverride being the actual float variable used in the code.
Developers must be aware that:
- This variable is marked as a cheat (ECVF_Cheat flag), meaning it’s intended for debugging and testing purposes, not for use in shipping builds.
- Changing this value will trigger a render state invalidation, potentially impacting performance.
- It only takes effect when set to a value greater than 0.
Best practices when using this variable include:
- Use it primarily for debugging and fine-tuning landscape LOD behavior during development.
- Be cautious about using it in shipping builds, as it’s marked as a cheat variable.
- Consider the performance implications of frequently changing this value, as it triggers render state invalidations.
Regarding the associated variable GLandscapeLOD0DistributionOverride: The purpose of GLandscapeLOD0DistributionOverride is to store the actual value used for overriding the LOD0 distribution setting. It’s used directly in the landscape rendering code to modify the LOD0 distribution when its value is greater than 0.
This variable is used in the Landscape module, specifically in the landscape rendering system. It’s set through the console variable system and is checked during the construction of landscape component scene proxies.
The value is set indirectly through the landscape.OverrideLOD0Distribution console variable. It interacts closely with other LOD-related variables like GLandscapeLOD0ScreenSizeOverride and GLandscapeLODDistributionOverride.
Developers should be aware that this variable is intended for debugging and testing, and its use can have significant impacts on landscape rendering and performance.
Best practices include using it judiciously during development and testing, and avoiding its use in shipping builds unless absolutely necessary.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:84
Scope: file
Source code excerpt:
float GLandscapeLOD0DistributionOverride = -1.f;
FAutoConsoleVariableRef CVarLandscapeLOD0DistributionOverride(
TEXT("landscape.OverrideLOD0Distribution"),
GLandscapeLOD0DistributionOverride,
TEXT("When > 0, force override the LOD0DistributionSetting property on all landscapes, and ignore r.LandscapeLOD0DistributionScale"),
FConsoleVariableDelegate::CreateStatic(&OnCVarNeedingRenderStateInvalidationChanged),
ECVF_Cheat
);
#Associated Variable and Callsites
This variable is associated with another variable named GLandscapeLOD0DistributionOverride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:82
Scope: file
Source code excerpt:
);
float GLandscapeLOD0DistributionOverride = -1.f;
FAutoConsoleVariableRef CVarLandscapeLOD0DistributionOverride(
TEXT("landscape.OverrideLOD0Distribution"),
GLandscapeLOD0DistributionOverride,
TEXT("When > 0, force override the LOD0DistributionSetting property on all landscapes, and ignore r.LandscapeLOD0DistributionScale"),
FConsoleVariableDelegate::CreateStatic(&OnCVarNeedingRenderStateInvalidationChanged),
ECVF_Cheat
);
float GLandscapeLODDistributionOverride = -1.f;
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:1437
Scope (from outer to inner):
file
function FLandscapeComponentSceneProxy::FLandscapeComponentSceneProxy
Source code excerpt:
LOD0ScreenSize = GLandscapeLOD0ScreenSizeOverride;
}
if (GLandscapeLOD0DistributionOverride > 0.0)
{
LOD0Distribution = GLandscapeLOD0DistributionOverride;
}
if (GLandscapeLODDistributionOverride > 0.0)
{
LODDistribution = GLandscapeLODDistributionOverride;
}
if (GLandscapeNonNaniteVirtualShadowMapConstantDepthBiasOverride > 0.0)