r.LandscapeLODDistributionScale
r.LandscapeLODDistributionScale
#Overview
name: r.LandscapeLODDistributionScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Multiplier for the landscape LODDistributionSetting property
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LandscapeLODDistributionScale is to act as a multiplier for the landscape LOD (Level of Detail) distribution setting property. This variable is part of the Unreal Engine’s landscape rendering system.
The Unreal Engine subsystem that relies on this setting variable is the Landscape module, specifically the landscape rendering component. This can be seen from the file location “Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp”.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 1.0f and can be modified at runtime using console commands.
This variable interacts directly with GLandscapeLODDistributionScale, which is the associated C++ variable that holds the actual value. They share the same value, with r.LandscapeLODDistributionScale being the console-accessible name.
Developers must be aware that changing this variable will affect the LOD distribution of landscapes in the game. It’s marked with ECVF_Scalability, indicating that it’s intended to be used for performance scaling.
Best practices when using this variable include:
- Use it for performance optimization, especially on lower-end hardware.
- Be cautious when modifying it, as it can affect the visual quality of landscapes.
- Test thoroughly after changes to ensure the desired balance between performance and visual quality.
Regarding the associated variable GLandscapeLODDistributionScale:
The purpose of GLandscapeLODDistributionScale is to store the actual value of the landscape LOD distribution scale. It’s used directly in the landscape rendering code to modify the LOD distribution.
This variable is used within the Landscape module, specifically in the FLandscapeComponentSceneProxy constructor.
The value of GLandscapeLODDistributionScale is set by the console variable system when r.LandscapeLODDistributionScale is modified.
It interacts with the LODDistributionSetting property of landscape components, multiplying this setting to determine the final LOD distribution.
Developers should be aware that this variable directly affects the rendering of landscape components and can impact both visual quality and performance.
Best practices for GLandscapeLODDistributionScale are similar to those for r.LandscapeLODDistributionScale, as they are essentially the same value accessed in different ways. Developers should primarily interact with r.LandscapeLODDistributionScale rather than modifying GLandscapeLODDistributionScale directly, to ensure proper integration with the engine’s console variable system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:150
Scope: file
Source code excerpt:
float GLandscapeLODDistributionScale = 1.f;
FAutoConsoleVariableRef CVarLandscapeLODDistributionScale(
TEXT("r.LandscapeLODDistributionScale"),
GLandscapeLODDistributionScale,
TEXT("Multiplier for the landscape LODDistributionSetting property"),
FConsoleVariableDelegate::CreateStatic(&OnCVarNeedingRenderStateInvalidationChanged),
ECVF_Scalability
);
#Associated Variable and Callsites
This variable is associated with another variable named GLandscapeLODDistributionScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:148
Scope: file
Source code excerpt:
);
float GLandscapeLODDistributionScale = 1.f;
FAutoConsoleVariableRef CVarLandscapeLODDistributionScale(
TEXT("r.LandscapeLODDistributionScale"),
GLandscapeLODDistributionScale,
TEXT("Multiplier for the landscape LODDistributionSetting property"),
FConsoleVariableDelegate::CreateStatic(&OnCVarNeedingRenderStateInvalidationChanged),
ECVF_Scalability
);
int32 GAllowLandscapeShadows = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp:1429
Scope (from outer to inner):
file
function FLandscapeComponentSceneProxy::FLandscapeComponentSceneProxy
Source code excerpt:
LOD0ScreenSize = Proxy->LOD0ScreenSize;
LOD0Distribution = Proxy->LOD0DistributionSetting * GLandscapeLOD0DistributionScale;
LODDistribution = Proxy->LODDistributionSetting * GLandscapeLODDistributionScale;
}
#if !UE_BUILD_SHIPPING
if (GLandscapeLOD0ScreenSizeOverride > 0.0)
{
LOD0ScreenSize = GLandscapeLOD0ScreenSizeOverride;