cook.ASTCTextureCompressor
cook.ASTCTextureCompressor
#Overview
name: cook.ASTCTextureCompressor
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: IntelISPC, 1: Arm
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of cook.ASTCTextureCompressor is to control which ASTC (Adaptive Scalable Texture Compression) texture compressor is used during the cooking process in Unreal Engine 5. It determines whether the Intel ISPC or ARM compressor is employed for ASTC texture compression.
This setting variable is primarily used by the texture compression and platform-specific modules in Unreal Engine. Based on the callsites, it appears to be utilized by the following subsystems or modules:
- TextureFormatASTC
- AndroidTargetPlatformSettings
- CookerSettings
- IOSTargetPlatform
- TargetPlatform
The value of this variable is set through a console variable, which allows it to be changed at runtime or through configuration files. It is defined with two possible values: 0 for IntelISPC and 1 for ARM compressor.
This variable interacts with other variables and settings related to texture compression, such as GASTCHDRProfile and cook.AllowASTCHDRProfile. It also influences platform-specific features and behaviors, particularly for Android and iOS target platforms.
Developers should be aware of the following when using this variable:
- The choice of compressor can affect texture quality, compression time, and platform compatibility.
- Changing this setting may impact the support for certain platform-specific features, such as NormalmapLAEncodingMode.
- The selected compressor influences whether ASTC HDR (High Dynamic Range) compression is available.
Best practices when using this variable include:
- Consider the target platforms (e.g., Android, iOS) when choosing the compressor, as it may affect compatibility and performance.
- Test the resulting texture quality and compression times with both compressors to determine the best option for your project.
- Be aware of how this setting interacts with other texture compression settings, especially when targeting multiple platforms.
- Document the chosen setting in your project to ensure consistency across the development team and build processes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/TextureFormatASTC/Private/TextureFormatASTC.cpp:37
Scope: file
Source code excerpt:
int32 GASTCCompressor = 1;
static FAutoConsoleVariableRef CVarASTCCompressor(
TEXT("cook.ASTCTextureCompressor"),
GASTCCompressor,
TEXT("0: IntelISPC, 1: Arm"),
ECVF_Default | ECVF_ReadOnly
);
#if PLATFORM_WINDOWS || PLATFORM_LINUX || PLATFORM_MAC
#Loc: <Workspace>/Engine/Source/Developer/Android/AndroidTargetPlatformSettings/Private/AndroidTargetPlatformSettings.cpp:80
Scope (from outer to inner):
file
function bool FAndroidTargetPlatformSettings::SupportsFeature
Source code excerpt:
case ETargetPlatformFeatures::NormalmapLAEncodingMode:
{
static IConsoleVariable* CompressorCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.ASTCTextureCompressor"));
const bool bUsesARMCompressor = (CompressorCVar ? (CompressorCVar->GetInt() != 0) : false);
return SupportsTextureFormatCategory(EAndroidTextureFormatCategory::ASTC) && bUsesARMCompressor;
}
default:
break;
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/CookerSettings.cpp:27
Scope (from outer to inner):
file
function UCookerSettings::UCookerSettings
Source code excerpt:
DefaultASTCQualityBySize = 3; // 6x6
{
static IConsoleVariable* ASTCTextureCompressorCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.ASTCTextureCompressor"));
DefaultASTCCompressor = (ASTCTextureCompressorCVar && ASTCTextureCompressorCVar->GetInt() != 0) ? ETextureFormatASTCCompressor::Arm : ETextureFormatASTCCompressor::IntelISPC;
}
}
void UCookerSettings::PostInitProperties()
{
#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:499
Scope (from outer to inner):
file
function bool FIOSTargetPlatform::SupportsFeature
Source code excerpt:
case ETargetPlatformFeatures::NormalmapLAEncodingMode:
{
static IConsoleVariable* CompressorCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.ASTCTextureCompressor"));
const bool bUsesARMCompressor = (CompressorCVar ? (CompressorCVar->GetInt() != 0) : false);
return bUsesARMCompressor;
}
case ETargetPlatformFeatures::ShowAsPlatformGroup:
return false;
#Loc: <Workspace>/Engine/Source/Developer/TargetPlatform/Private/TargetPlatformBase.cpp:110
Scope (from outer to inner):
file
function bool FTargetPlatformBase::UsesASTCHDR
Source code excerpt:
bool FTargetPlatformBase::UsesASTCHDR() const
{
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.ASTCTextureCompressor"));
const bool bUsesARMCompressor = (CVar ? (CVar->GetInt() != 0) : false);
return (bUsesARMCompressor && GASTCHDRProfile != 0);
}
void FTargetPlatformBase::GetRayTracingShaderFormats(TArray<FName>& OutFormats) const
#Loc: <Workspace>/Engine/Source/Developer/TargetPlatform/Private/TargetPlatformSettingsBase.cpp:91
Scope (from outer to inner):
file
function bool FTargetPlatformSettingsBase::UsesASTCHDR
Source code excerpt:
bool FTargetPlatformSettingsBase::UsesASTCHDR() const
{
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.ASTCTextureCompressor"));
const bool bUsesARMCompressor = (CVar ? (CVar->GetInt() != 0) : false);
static IConsoleVariable* CVarASTCHDR = IConsoleManager::Get().FindConsoleVariable(TEXT("cook.AllowASTCHDRProfile"));
const bool bUsesASTCHDR = (CVarASTCHDR ? (CVarASTCHDR->GetInt() != 0) : false);
return (bUsesARMCompressor && bUsesASTCHDR);