r.Substrate.TileCoord8bits

r.Substrate.TileCoord8bits

#Overview

name: r.Substrate.TileCoord8bits

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Substrate.TileCoord8bits is to control the format of tile coordinates in the Substrate rendering system. This setting variable is used to determine whether 8-bit tile coordinates should be enabled or not.

This setting variable is primarily used in the Substrate rendering system, which is part of Unreal Engine’s renderer module. Based on the callsites, it’s clear that this variable is used within the Substrate namespace and affects the rendering pipeline.

The value of this variable is set through a console variable (CVar) named CVarSubstrateTileCoord8Bits. It’s initialized with a default value of 0, meaning 8-bit tile coordinates are disabled by default.

The associated variable CVarSubstrateTileCoord8Bits directly interacts with r.Substrate.TileCoord8bits. They share the same value and purpose. The Is8bitTileCoordEnabled() function uses this CVar to determine if 8-bit tile coordinates should be used.

Developers must be aware that this variable is marked as read-only (ECVF_RenderThreadSafe flag). This means it’s intended to be set at startup or through configuration files, and not dynamically changed during runtime.

Best practices when using this variable include:

  1. Only modify it if you fully understand the implications on the Substrate rendering system.
  2. Consider performance impacts when enabling 8-bit tile coordinates.
  3. Test thoroughly after changing this setting, as it may affect rendering quality or performance.

Regarding the associated variable CVarSubstrateTileCoord8Bits:

The purpose of CVarSubstrateTileCoord8Bits is to provide a programmatic way to access and control the r.Substrate.TileCoord8bits setting. It’s an instance of TAutoConsoleVariable, which allows the engine to expose this setting to the console and configuration systems.

This variable is used directly in the Substrate rendering system, specifically in the Is8bitTileCoordEnabled() function, which likely influences shader compilation or rendering paths related to tile coordinates.

The value of CVarSubstrateTileCoord8Bits is set at initialization, but can potentially be modified through console commands or configuration files.

Developers should be aware that changes to CVarSubstrateTileCoord8Bits will directly affect the behavior controlled by r.Substrate.TileCoord8bits. They should also note that while the variable itself can be changed, it’s marked as render thread safe, indicating that changes should be made carefully and with consideration for threading implications.

Best practices for CVarSubstrateTileCoord8Bits include:

  1. Use GetValueOnAnyThread() when accessing the value, as shown in the Is8bitTileCoordEnabled() function.
  2. Be cautious about changing this value at runtime, as it may have significant impacts on rendering.
  3. Document any non-default values used in your project to aid in debugging and maintenance.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/AndroidEngine.ini:98, section: [/Script/Engine.RendererSettings]

Location: <Workspace>/Engine/Config/IOS/BaseIOSEngine.ini:16, section: [/Script/Engine.RendererSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Substrate/Substrate.cpp:64

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSubstrateTileCoord8Bits(
	TEXT("r.Substrate.TileCoord8bits"),
	0,
	TEXT("Format of tile coord. This variable is read-only."),
	ECVF_RenderThreadSafe);

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT(FSubstrateGlobalUniformParameters, "Substrate");

#Associated Variable and Callsites

This variable is associated with another variable named CVarSubstrateTileCoord8Bits. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Substrate/Substrate.cpp:63

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarSubstrateTileCoord8Bits(
	TEXT("r.Substrate.TileCoord8bits"),
	0,
	TEXT("Format of tile coord. This variable is read-only."),
	ECVF_RenderThreadSafe);

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT(FSubstrateGlobalUniformParameters, "Substrate");

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Substrate/Substrate.cpp:157

Scope (from outer to inner):

file
namespace    Substrate
function     bool Is8bitTileCoordEnabled

Source code excerpt:

bool Is8bitTileCoordEnabled()
{
	return CVarSubstrateTileCoord8Bits.GetValueOnAnyThread() > 0 ? 1 : 0;
}

bool GetSubstrateUsesComplexSpecialPath(const FViewInfo& View)
{
	if (Substrate::IsSubstrateEnabled())
	{