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:

  1. The number of colors in this array affects how many HLOD levels can be distinctly visualized.
  2. The colors are used in a cyclic manner if there are more HLOD levels than defined colors.
  3. Changing these colors will affect the debug visualization of HLODs across the entire engine.

Best practices when using this variable include:

  1. Ensuring that the number of colors defined is sufficient for the maximum number of HLOD levels in your project.
  2. Choosing colors that are visually distinct to make it easier to differentiate between HLOD levels during debugging.
  3. Considering color-blind accessibility when defining these colors.
  4. 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]

Location: <Workspace>/Engine/Config/BaseEngine.ini:257, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:258, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:259, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:260, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:261, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:262, section: [/Script/Engine.Engine]

#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)
		{