TextureFormatPriority_ETC2
TextureFormatPriority_ETC2
#Overview
name: TextureFormatPriority_ETC2
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_ETC2 is to set the priority for the ETC2 texture format when launching on an Android device or packaging using Android_Multi. It is part of the texture format prioritization system for Android platforms in Unreal Engine 5.
This setting variable is primarily used by the Android target platform module and the Android runtime settings system. It’s specifically referenced in the AndroidTargetPlatformControls and AndroidRuntimeSettings classes.
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 is initialized with a default value of 0.2f in the UAndroidRuntimeSettings constructor.
TextureFormatPriority_ETC2 interacts with other texture format priority variables, such as TextureFormatPriority_DXT and TextureFormatPriority_ASTC. These variables collectively determine which texture format will be used based on device support and priority settings.
Developers should be aware that this variable affects the selection of texture formats when deploying to Android devices. A higher priority value increases the likelihood of the ETC2 format being chosen over other supported formats.
Best practices when using this variable include:
- Adjusting the priority based on your target devices’ capabilities and your game’s performance requirements.
- Considering the trade-offs between different texture formats in terms of quality, compression, and device support.
- Testing the impact of different priority settings on various Android devices to ensure optimal performance and visual quality.
- Keeping in mind that the highest priority format supported by the device will be used, so balancing priorities across all texture formats is important.
- Remembering that changes to this setting may require repackaging of the game to take effect.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3068, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
- INI Section:
/Script/AndroidRuntimeSettings.AndroidRuntimeSettings
- Raw value:
0.2
- Is Array:
False
#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:229
Scope (from outer to inner):
file
class class FAndroid_ETC2TargetPlatformControls : public FAndroidTargetPlatformControls
function virtual float GetVariantPriority
Source code excerpt:
{
float Priority;
return (GConfig->GetFloat(TEXT("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings"), TEXT("TextureFormatPriority_ETC2"), Priority, GEngineIni) ?
Priority : 0.2f) * 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:669
Scope (from outer to inner):
file
class class UAndroidRuntimeSettings : public UObject
Source code excerpt:
/** 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. */
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. */
#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:42
Scope (from outer to inner):
file
function UAndroidRuntimeSettings::UAndroidRuntimeSettings
Source code excerpt:
, bMultiTargetFormat_DXT(true)
, bMultiTargetFormat_ASTC(true)
, TextureFormatPriority_ETC2(0.2f)
, TextureFormatPriority_DXT(0.6f)
, TextureFormatPriority_ASTC(0.9f)
, bStreamLandscapeMeshLODs(false)
{
bBuildForES31 = bBuildForES31 || !bSupportsVulkan;
}