HLODColorationColors
HLODColorationColors
#Overview
name: HLODColorationColors
The value of this variable can be defined or overridden in .ini config files. 7
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of HLODColorationColors is to define a set of colors used for rendering Hierarchical Level of Detail (HLOD) coloration in Unreal Engine 5. This variable is part of the engine’s visualization and debugging system, specifically for HLOD-related features.
HLODColorationColors is primarily used by the rendering subsystem of Unreal Engine 5. It is referenced in the Engine module and the Renderer module, indicating its importance in the visualization of HLOD levels.
The value of this variable is set through the engine’s configuration system, as indicated by the UPROPERTY(globalconfig) attribute in the Engine.h file. This means that the colors can be defined in the engine’s configuration files and can be adjusted without recompiling the engine.
HLODColorationColors interacts with other debug visualization features, such as the engine show flags (ViewInfo.Family->EngineShowFlags.HLODColoration). It’s also used in conjunction with the RuntimeSpatialHash system for HLOD visualization.
Developers should be aware that:
- The number of colors in this array affects how many HLOD levels can be distinctly visualized.
- The colors are used in a cyclic manner if there are more HLOD levels than defined colors.
- Changing these colors will affect the debug visualization of HLODs across the entire engine.
Best practices when using this variable include:
- Ensuring that the number of colors defined is sufficient for the maximum number of HLOD levels in your project.
- Choosing colors that are visually distinct to make it easier to differentiate between HLOD levels during debugging.
- Considering color-blind accessibility when defining these colors.
- Using this visualization in conjunction with other HLOD debugging tools for a comprehensive understanding of the HLOD system in your project.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:256, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=1.0,G=1.0,B=1.0,A=1.0) ; white (not part of HLOD)
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:257, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=0.0,G=1.0,B=0.0,A=1.0) ; green (part of HLOD but being drawn outside of it)
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:258, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=0.0,G=0.0,B=1.0,A=1.0) ; blue (HLOD level 0)
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:259, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=1.0,G=1.0,B=0.0,A=1.0) ; yellow (HLOD level 1, etc...)
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:260, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=1.0,G=0.0,B=1.0,A=1.0) ; purple
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:261, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=0.0,G=1.0,B=1.0,A=1.0) ; cyan
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:262, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
(R=0.5,G=0.5,B=0.5,A=1.0) ; grey
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1212
Scope (from outer to inner):
file
class class UEngine : public UObject , public FExec
Source code excerpt:
/** The colors used to render LOD coloration. */
UPROPERTY(globalconfig)
TArray<FLinearColor> HLODColorationColors;
/** The colors used for texture streaming accuracy debug view modes. */
UPROPERTY(globalconfig)
TArray<FLinearColor> StreamingAccuracyColors;
/** The visualization color when sk mesh not using skin cache. */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/RuntimeSpatialHash/RuntimeSpatialHashHLOD.cpp:337
Scope (from outer to inner):
file
function static TMap<FName, FSpatialHashRuntimeGrid> CreateHLODGrids
Source code excerpt:
HLODGrid.Priority = 100 + HLODLevel;
// Setup grid debug color to match HLODColorationColors
const int32 LastLODColorationColorIdx = GEngine->HLODColorationColors.Num() - 1;
const int32 HLODColorIdx = FMath::Clamp(HLODLevel + 2, 0U, (int32)LastLODColorationColorIdx);
HLODGrid.DebugColor = GEngine->HLODColorationColors[HLODColorIdx];
}
// Temp solution to have replication working for hlod layers that have a modifier
// Modifiers are used for example for destructible HLODs, that need to have a server side component
// The real solution would probably be to check if we have any actors that are
// returning true for NeedsLoadForServer()
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DebugViewModeRendering.cpp:129
Scope (from outer to inner):
file
function void SetupDebugViewModePassUniformBufferConstants
Source code excerpt:
else if (ViewInfo.Family->EngineShowFlags.HLODColoration)
{
Colors = &GEngine->HLODColorationColors;
}
const int32 NumColors = Colors ? FMath::Min<int32>(NumLODColorationColors, Colors->Num()) : 0;
int32 ColorIndex = 0;
for (; ColorIndex < NumColors; ++ColorIndex)
{