TextureFormatPriority_ASTC

TextureFormatPriority_ASTC

#Overview

name: TextureFormatPriority_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.

#Summary

#Usage in the C++ source code

The purpose of TextureFormatPriority_ASTC is to set the priority for the ASTC (Adaptive Scalable Texture Compression) texture format when launching on an Android device or packaging using Android_Multi. This setting is part of the texture compression and rendering system in Unreal Engine 5.

This setting variable is primarily used by the Android target platform module, specifically within the AndroidTargetPlatformControls and AndroidRuntimeSettings classes. It’s part of the Android-specific runtime settings and is used to determine the preferred texture format when multiple options are available.

The value of this variable is set in the Android Runtime Settings, which can be configured through the Unreal Engine editor or directly in the configuration files. It’s defined as a UPROPERTY with GlobalConfig, meaning it can be accessed and modified project-wide.

TextureFormatPriority_ASTC interacts with other texture format priority variables like TextureFormatPriority_ETC2 and TextureFormatPriority_DXT. These variables collectively determine the order of preference for texture compression formats on Android devices.

Developers should be aware that this variable affects the selection of texture formats for Android devices. A higher priority value (default is 0.9) means ASTC will be preferred over other formats if the device supports it. This can impact texture quality, performance, and memory usage on target devices.

Best practices when using this variable include:

  1. Consider the target devices’ capabilities when adjusting this value.
  2. Balance it with other texture format priorities to ensure optimal performance across a range of devices.
  3. Test thoroughly on various Android devices to ensure the chosen priorities result in the best compromise between visual quality and performance.
  4. Be mindful that changes to this value may require repackaging of the game for the changes to take effect.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
class        class FAndroid_ASTCTargetPlatformControls : public FAndroidTargetPlatformControls
function     virtual float GetVariantPriority

Source code excerpt:

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

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

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

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	/** 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)
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "Project SDK Override", Meta = (DisplayName = "SDK API Level (specific version, 'latest', or 'matchndk' - see tooltip)"))
	FString SDKAPILevelOverride;

	// Which NDK to compile with (a specific version or (without quotes) 'latest' for latest version on disk). Note that choosing android-21 or later won't run on pre-5.0 devices.

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

Scope (from outer to inner):

file
function     UAndroidRuntimeSettings::UAndroidRuntimeSettings

Source code excerpt:

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

void UAndroidRuntimeSettings::PostReloadConfig(FProperty* PropertyThatWasLoaded)