TextureFormatPriority_DXT

TextureFormatPriority_DXT

#Overview

name: TextureFormatPriority_DXT

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of TextureFormatPriority_DXT is to set the priority for the DXT texture format when launching on an Android device or packaging using Android_Multi. It is used in the rendering system, specifically for texture compression and format selection on Android platforms.

This setting variable is primarily used in the Android target platform module of Unreal Engine. It’s referenced in the AndroidTargetPlatformControls and AndroidRuntimeSettings classes, which are part of the Android-specific subsystem for building and deploying games to Android devices.

The value of this variable is set in the AndroidRuntimeSettings class, which is part of the AndroidRuntimeSettings module. It’s defined as a UPROPERTY with GlobalConfig, meaning its value can be modified through project settings and saved in the engine’s configuration files.

TextureFormatPriority_DXT interacts with other texture format priority variables, such as TextureFormatPriority_ASTC and TextureFormatPriority_ETC2. These variables work together to determine which texture format will be used on the target Android device based on their priorities and the device’s capabilities.

Developers must be aware that this variable affects the selection of texture formats for Android devices. A higher priority value increases the likelihood of the DXT format being chosen when it’s supported by the device. The default value is 0.6, which positions it between ETC2 (0.2) and ASTC (0.9) in terms of priority.

Best practices when using this variable include:

  1. Consider the target Android devices’ capabilities when adjusting this value.
  2. Balance it with other texture format priorities to optimize for quality and performance.
  3. Test on various Android devices to ensure the desired texture format is being selected.
  4. Be mindful that changing this value may affect the final package size and runtime performance of the game on Android devices.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/Android/AndroidTargetPlatformControls/Private/AndroidTargetPlatformControls.h:178

Scope (from outer to inner):

file
class        class FAndroid_DXTTargetPlatformControls : public FAndroidTargetPlatformControls
function     virtual float GetVariantPriority

Source code excerpt:

	{
		float Priority;
		return (GConfig->GetFloat(TEXT("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings"), TEXT("TextureFormatPriority_DXT"), Priority, GEngineIni) ?
			Priority : 0.6f) * 10.0f + (IsClientOnly() ? 0.25f : 0.5f);
	}

#if WITH_ENGINE
	virtual void GetTextureFormats(const UTexture* Texture, TArray< TArray<FName> >& OutFormats) const override;
#endif

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Classes/AndroidRuntimeSettings.h:673

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	/** Priority for the DXT texture format when launching on device or packaging using Android_Multi. The highest priority format supported by the device will be used. Default value is 0.6. */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = TextureFormatPriorities, meta = (DisplayName = "DXT texture format priority"))
	float TextureFormatPriority_DXT;

	/** Priority for the ASTC texture format when launching on device or packaging using Android_Multi. The highest priority format supported by the device will be used. Default value is 0.9. */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = TextureFormatPriorities, meta = (DisplayName = "ASTC texture format priority"))
	float TextureFormatPriority_ASTC;

	// Which SDK to package and compile Java with (a specific version or (without quotes) 'latest' for latest version on disk, or 'matchndk' to match the NDK API Level)

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:43

Scope (from outer to inner):

file
function     UAndroidRuntimeSettings::UAndroidRuntimeSettings

Source code excerpt:

	, bMultiTargetFormat_ASTC(true)
	, TextureFormatPriority_ETC2(0.2f)
	, TextureFormatPriority_DXT(0.6f)
	, TextureFormatPriority_ASTC(0.9f)
	, bStreamLandscapeMeshLODs(false)
{
	bBuildForES31 = bBuildForES31 || !bSupportsVulkan;
}