FinalUniversalTiling

FinalUniversalTiling

#Overview

name: FinalUniversalTiling

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

It is referenced in 8 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of FinalUniversalTiling is to control the universal tiling setting for texture encoding in Unreal Engine 5. Universal tiling is a technique used to optimize texture sizes for platforms with opaque tiling, such as desktop platforms.

This setting variable is primarily used in the texture encoding and rendering systems of Unreal Engine. It is referenced in the TextureEditor module and the Engine module, specifically in the texture encoding and derived data generation processes.

The value of this variable is set in the UTextureEncodingProjectSettings class, which is a subclass of UDeveloperSettings. This suggests that it can be configured through the project settings in the Unreal Engine editor.

FinalUniversalTiling interacts with several other variables related to texture encoding, such as FinalEffortLevel, FinalRDOLambda, and their corresponding “Fast” versions (FastUniversalTiling, FastEffortLevel, FastRDOLambda). These variables work together to control different aspects of texture encoding, including effort level, rate-distortion optimization (RDO), and universal tiling.

Developers should be aware that changing this variable may have implications for texture quality, performance, and disk space usage. It’s important to note that this setting is specifically for the “Final” encoding speed, which is typically used for higher quality encoding at the cost of longer processing times.

Best practices when using this variable include:

  1. Carefully considering the target platforms and their tiling capabilities when setting this value.
  2. Testing the impact of different universal tiling settings on texture quality and performance.
  3. Balancing this setting with other texture encoding settings to achieve the desired quality and performance trade-offs.
  4. Being aware that changes to this setting may require a project restart, as indicated by the ConfigRestartRequired meta tag.
  5. Considering the interaction between this setting and the RDO (Rate-Distortion Optimization) settings, as they can work together to optimize texture compression and quality.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/TextureEditor/Private/Models/TextureEditorViewportClient.cpp:390

Scope (from outer to inner):

file
function     void FTextureEditorViewportClient::Draw

Source code excerpt:

				EncodeSettings.Project.FastEffortLevel != EncodeSettings.Project.FinalEffortLevel ||
				EncodeSettings.Project.FastRDOLambda != EncodeSettings.Project.FinalRDOLambda ||
				EncodeSettings.Project.FastUniversalTiling != EncodeSettings.Project.FinalUniversalTiling);

			if (PlatformDataPtr[0]->ResultMetadata.bWasEditorCustomEncoding)
			{
				const FText LeadInText = NSLOCTEXT("TextureEditor", "ViewingCustom", "Viewing custom encoding");
				Canvas->DrawShadowedText(ReportingLineX, ReportingLineY, LeadInText, ReportingFont, FLinearColor::Yellow);
				ReportingLineY += ReportingLineHeight;

#Loc: <Workspace>/Engine/Source/Editor/TextureEditor/Private/Models/TextureEditorViewportClient.cpp:442

Scope (from outer to inner):

file
function     void FTextureEditorViewportClient::Draw

Source code excerpt:

						bNeedComma = true;
					}
					if (EncodeSettings.Project.FastUniversalTiling != EncodeSettings.Project.FinalUniversalTiling)
					{
						if (bNeedComma)
						{
							DrawComma();
						}
						const FText EffortText = NSLOCTEXT("TextureEditor", "UTDifference", "RDO Universal Tiling");

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureDerivedData.cpp:595

Scope (from outer to inner):

file
function     static void GetEncodeSpeedOptions

Source code excerpt:

		OutOptions->bUsesRDO = EncodeSettings.Project.bFinalUsesRDO;
		OutOptions->Effort = EncodeSettings.Project.FinalEffortLevel;
		OutOptions->Tiling = EncodeSettings.Project.FinalUniversalTiling;
		OutOptions->RDOLambda = EncodeSettings.Project.FinalRDOLambda;
	}
	else
	{
		OutOptions->bUsesRDO = EncodeSettings.Project.bFastUsesRDO;
		OutOptions->Effort = EncodeSettings.Project.FastEffortLevel;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:15

Scope (from outer to inner):

file
function     UTextureEncodingProjectSettings::UTextureEncodingProjectSettings

Source code excerpt:

	FinalRDOLambda(30), /* OodleTex_RDOLagrangeLambda_Default */
	FinalEffortLevel(ETextureEncodeEffort::Normal),
	FinalUniversalTiling(ETextureUniversalTiling::Disabled),
	bFastUsesRDO(false),
	FastRDOLambda(30), /* OodleTex_RDOLagrangeLambda_Default */
	FastEffortLevel(ETextureEncodeEffort::Normal),
	FastUniversalTiling(ETextureUniversalTiling::Disabled),
	CookUsesSpeed(ETextureEncodeSpeed::Final),
	EditorUsesSpeed(ETextureEncodeSpeed::FinalIfAvailable)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:81

Scope (from outer to inner):

file
function     static void ConstructResolvedSettings

Source code excerpt:

	OutResolvedSettings->Project.FastRDOLambda = ProjectSettings->FastRDOLambda;
	OutResolvedSettings->Project.FinalEffortLevel = ProjectSettings->FinalEffortLevel;
	OutResolvedSettings->Project.FinalUniversalTiling = ProjectSettings->FinalUniversalTiling;
	OutResolvedSettings->Project.FastEffortLevel = ProjectSettings->FastEffortLevel;
	OutResolvedSettings->Project.FastUniversalTiling = ProjectSettings->FastUniversalTiling;
	OutResolvedSettings->Project.CookUsesSpeed = ProjectSettings->CookUsesSpeed;
	OutResolvedSettings->Project.EditorUsesSpeed = ProjectSettings->EditorUsesSpeed;

	// Determine what encode speed to use

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:156

Scope (from outer to inner):

file
function     static void ConstructResolvedSettings

Source code excerpt:

		{
			FinalRDOString = FString(TEXT("On"));
			if (OutResolvedSettings->Project.FinalUniversalTiling != ETextureUniversalTiling::Disabled)
			{
				FinalRDOString += TEXT(" UT=");
				FinalRDOString += UniversalTilingEnum->GetNameStringByValue((int64)OutResolvedSettings->Project.FinalUniversalTiling);
			}
		}
		else
		{
			FinalRDOString = FString(TEXT("Off"));
		}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettingsPrivate.h:73

Scope (from outer to inner):

file
class        class UTextureEncodingProjectSettings : public UDeveloperSettings

Source code excerpt:

	// sizes of textures for platforms with opaque tiling (i.e. desktop).
	UPROPERTY(config, EditAnywhere, Category = EncodeSpeedSettings, meta = (ConfigRestartRequired = true))
	ETextureUniversalTiling FinalUniversalTiling;

	// If true, Final encode speed enables rate-distortion optimization on supported encoders to
	// decrease *on disc* size of textures in compressed package files.
	// This rate-distortion tradeoff is controlled via "Lambda". The "LossyCompressionAmount" parameter on
	// textures is used to control it. Specific LossyCompressionAmount values correspond to
	// to RDO lambdas of:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/TextureEncodingSettings.h:64

Scope: file

Source code excerpt:

		int8 FastRDOLambda;
		ETextureEncodeEffort FinalEffortLevel;
		ETextureUniversalTiling FinalUniversalTiling;
		ETextureEncodeEffort FastEffortLevel;
		ETextureUniversalTiling FastUniversalTiling;
		ETextureEncodeSpeed CookUsesSpeed;
		ETextureEncodeSpeed EditorUsesSpeed;
	} Project;