FinalEffortLevel

FinalEffortLevel

#Overview

name: FinalEffortLevel

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 FinalEffortLevel is to specify the level of effort for texture encoding in Unreal Engine 5’s texture compression system. It is used to control the balance between encoding quality and processing time for the final build of a project.

This setting variable is primarily used in the texture encoding subsystem of Unreal Engine 5. 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.

FinalEffortLevel interacts with several other variables related to texture encoding, such as:

Developers should be aware that:

  1. This variable affects the final build quality and processing time of texture assets.
  2. It is part of a set of encoding settings that can be different for fast (development) and final (release) builds.
  3. Changes to this setting may require a restart of the engine to take effect, as indicated by the “ConfigRestartRequired” meta tag.

Best practices when using this variable include:

  1. Carefully balancing encoding quality with build times for your project’s needs.
  2. Testing different effort levels to find the optimal setting for your specific textures and target platforms.
  3. Considering the implications on build times and final asset quality when adjusting this setting.
  4. Coordinating changes to this setting with the team, as it affects the entire project’s texture encoding process.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
function     void FTextureEditorViewportClient::Draw

Source code excerpt:

			FResolvedTextureEncodingSettings const& EncodeSettings = FResolvedTextureEncodingSettings::Get();
			bool bEncodingDiffers = (EncodeSettings.Project.bFastUsesRDO != EncodeSettings.Project.bFinalUsesRDO ||
				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");

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

Scope (from outer to inner):

file
function     void FTextureEditorViewportClient::Draw

Source code excerpt:

					}
				}
				if (EncodeSettings.Project.FastEffortLevel != EncodeSettings.Project.FinalEffortLevel)
				{
					if (bNeedComma)
					{
						DrawComma();
					}
					const FText EffortText = NSLOCTEXT("TextureEditor", "EffortDifference", "Encode Effort");

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

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;

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

Scope (from outer to inner):

file
function     UTextureEncodingProjectSettings::UTextureEncodingProjectSettings

Source code excerpt:

	bFinalUsesRDO(false),
	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),

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

Scope (from outer to inner):

file
function     static void ConstructResolvedSettings

Source code excerpt:

	OutResolvedSettings->Project.FinalRDOLambda = ProjectSettings->FinalRDOLambda;
	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;

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

Scope (from outer to inner):

file
function     static void ConstructResolvedSettings

Source code excerpt:

		UE_LOG(LogTextureEncodingSettings, Display, TEXT("Oodle Texture Encode Speed settings: Fast: RDO %s Lambda=%d, Effort=%s Final: RDO %s Lambda=%d, Effort=%s"), \
			*FastRDOString, OutResolvedSettings->Project.bFastUsesRDO ? OutResolvedSettings->Project.FastRDOLambda : 0, *(EncodeEffortEnum->GetNameStringByValue((int64)OutResolvedSettings->Project.FastEffortLevel)), \
			*FinalRDOString, OutResolvedSettings->Project.bFinalUsesRDO ? OutResolvedSettings->Project.FinalRDOLambda : 0, *(EncodeEffortEnum->GetNameStringByValue((int64)OutResolvedSettings->Project.FinalEffortLevel)));
	}

	UE_LOG(LogTextureEncodingSettings, Display, TEXT("Shared linear texture encoding: %s"), OutResolvedSettings->Project.bSharedLinearTextureEncoding ? TEXT("Enabled") : TEXT("Disabled"));
}

static void TryToResolveSettings(ReadyMask InReadyMask, UDeveloperSettings* InSettings, FResolvedTextureEncodingSettings** OutResolvedSettings)

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

Scope (from outer to inner):

file
class        class UTextureEncodingProjectSettings : public UDeveloperSettings

Source code excerpt:

	// Specifies how much time to take trying for better encoding results.
	UPROPERTY(config, EditAnywhere, Category = EncodeSpeedSettings, meta = (ConfigRestartRequired = true))
	ETextureEncodeEffort FinalEffortLevel;	

	// Specifies how to assume textures are laid out on disc. This only applies to Oodle with RDO
	// enabled. 256 KB is a good middle ground. Enabling this will decrease the on-disc
	// sizes of textures for platforms with exposed texture tiling (i.e. consoles), but will slightly increase
	// sizes of textures for platforms with opaque tiling (i.e. desktop).
	UPROPERTY(config, EditAnywhere, Category = EncodeSpeedSettings, meta = (ConfigRestartRequired = true))

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

Scope: file

Source code excerpt:

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