bMultiTargetFormat_ASTC

bMultiTargetFormat_ASTC

#Overview

name: bMultiTargetFormat_ASTC

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. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bMultiTargetFormat_ASTC is to control the inclusion of ASTC (Adaptive Scalable Texture Compression) textures when packaging with the Android (Multi) variant in Unreal Engine 5.

This setting variable is primarily used by the Android runtime settings subsystem, which is part of the Android platform-specific module in Unreal Engine. It’s specifically related to texture compression and packaging for Android devices.

The value of this variable is set in the AndroidRuntimeSettings class constructor, where it’s initialized to true by default. It can be modified through the Unreal Engine editor’s project settings interface, as indicated by the UPROPERTY macro with the EditAnywhere and GlobalConfig specifiers.

This variable interacts with other texture format variables, specifically bMultiTargetFormat_ETC2 and bMultiTargetFormat_DXT. These variables collectively determine which texture formats are included when packaging for Android devices using the Multi variant.

Developers must be aware that this setting affects the size and performance of their Android builds. Including ASTC textures can improve visual quality on supported devices but may increase package size.

Best practices when using this variable include:

  1. Consider the target devices’ capabilities when deciding whether to include ASTC textures.
  2. Balance the inclusion of different texture formats (ASTC, ETC2, DXT) based on your target devices and performance requirements.
  3. Be aware that at least one texture format must be enabled among ASTC, ETC2, and DXT for Android_Multi packaging.
  4. Use in conjunction with TextureFormatPriority_ASTC to fine-tune texture format selection on devices supporting multiple formats.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	/** Include ASTC textures when packaging with the Android (Multi) variant. */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = MultiTextureFormats, meta = (DisplayName = "Include ASTC textures"))
	bool bMultiTargetFormat_ASTC;

	/** Priority for the ETC2 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.2. */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = TextureFormatPriorities, meta = (DisplayName = "ETC2 texture format priority"))
	float TextureFormatPriority_ETC2;

	/** 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. */

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

Scope (from outer to inner):

file
function     UAndroidRuntimeSettings::UAndroidRuntimeSettings

Source code excerpt:

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

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

Scope (from outer to inner):

file
function     void UAndroidRuntimeSettings::PostEditChangeProperty

Source code excerpt:


		// Ensure we have at least one format for Android_Multi
		if (!bMultiTargetFormat_ETC2 && !bMultiTargetFormat_DXT && !bMultiTargetFormat_ASTC)
		{
			bMultiTargetFormat_ETC2 = true;
			UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bMultiTargetFormat_ETC2)), GetDefaultConfigFilename());
		}

		// Notify the AndroidTargetPlatform module if it's loaded

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:2743

						Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bMultiTargetFormat_ETC2", out bETC2Enabled);
						Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bMultiTargetFormat_DXT", out bDXTEnabled);
						Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bMultiTargetFormat_ASTC", out bASTCEnabled);
						break;
					case "_ETC2":
						bETC2Enabled = true;
						break;
					case "_DXT":
						bDXTEnabled = true;