GPUSkinCacheVisualizationRayTracingLODOffsetColors

GPUSkinCacheVisualizationRayTracingLODOffsetColors

#Overview

name: GPUSkinCacheVisualizationRayTracingLODOffsetColors

The value of this variable can be defined or overridden in .ini config files. 4 .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 GPUSkinCacheVisualizationRayTracingLODOffsetColors is to provide a set of visualization colors for representing different levels of detail (LOD) offsets between ray tracing and raster LODs in the GPU skin cache system.

This setting variable is primarily used by the GPU skin cache subsystem within Unreal Engine’s rendering module. It is specifically utilized for debugging and visualization purposes related to ray tracing LOD offsets.

The value of this variable is set through the engine’s global configuration system, as indicated by the UPROPERTY(globalconfig) decorator in the UEngine class definition.

This variable interacts with other components of the GPU skin cache system, particularly when comparing LOD levels between regular raster entries and ray tracing entries. It’s used in conjunction with the GPUSkinCacheVisualizationMode to determine the appropriate visualization color.

Developers should be aware that:

  1. This variable is an array of FLinearColor, allowing for multiple color definitions for different LOD offsets.
  2. It’s primarily used in ray tracing scenarios, so it may not have an effect if ray tracing is not enabled.
  3. The number of colors defined can affect the visualization behavior, especially when there are more LOD offsets than defined colors.

Best practices when using this variable include:

  1. Defining a sufficient number of colors to cover all possible LOD offsets in your project.
  2. Choosing distinct colors for each offset to make visualization clear and easily interpretable.
  3. Ensuring that the colors are suitable for the intended visualization environment (e.g., considering contrast against typical scene colors).
  4. Using this variable in conjunction with other GPU skin cache debugging tools for comprehensive analysis.
  5. Remembering that this is a visualization aid and should be disabled in release builds for performance reasons.

#Setting Variables

#References In INI files

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

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

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

Location: <Workspace>/Engine/Config/BaseEngine.ini:274, 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:1246

Scope (from outer to inner):

file
class        class UEngine : public UObject , public FExec

Source code excerpt:

	/** The visualization colors of ray tracing LOD index offset from raster LOD */
	UPROPERTY(globalconfig)
	TArray<FLinearColor> GPUSkinCacheVisualizationRayTracingLODOffsetColors;

	/**
	* Complexity limits for the various complexity view mode combinations.
	* These limits are used to map instruction counts to ShaderComplexityColors.
	*/
	UPROPERTY(globalconfig)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:2482

Scope (from outer to inner):

file
function     FColor FGPUSkinCache::GetVisualizationDebugColor

Source code excerpt:

			int32 LODOffset = (Entry && RayTracingEntry) ? (RayTracingEntry->LOD - Entry->LOD) : 0;
			check (LODOffset >= 0);
			const TArray<FLinearColor>& VisualizationColors = GEngine->GPUSkinCacheVisualizationRayTracingLODOffsetColors;
			if (VisualizationColors.Num() > 0)
			{
				int32 Index = VisualizationColors.IsValidIndex(LODOffset) ? LODOffset : (VisualizationColors.Num()-1);
				return VisualizationColors[Index].QuantizeRound();
			}
	#endif

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GPUSkinCache.cpp:2534

Scope (from outer to inner):

file
function     void FGPUSkinCache::DrawVisualizationInfoText

Source code excerpt:

	#if RHI_RAYTRACING
			DrawText(TEXT("Skin Cache Visualization - RayTracingLODOffset"), FColor::White);
			const TArray<FLinearColor>& VisualizationColors = GEngine->GPUSkinCacheVisualizationRayTracingLODOffsetColors;
			for (int32 i = 0; i < VisualizationColors.Num(); ++i)
			{
				DrawText(FString::Printf(TEXT("RT_LOD == Raster_LOD %s %d"), (i > 0 ? TEXT("+") : TEXT("")), i), VisualizationColors[i].QuantizeRound());
			}
	#endif
		}