bEnableAsyncTextureCompilation
bEnableAsyncTextureCompilation
#Overview
name: bEnableAsyncTextureCompilation
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 bEnableAsyncTextureCompilation is to enable asynchronous texture compilation in Unreal Engine 5. This setting is designed to improve performance during Play-in-Editor (PIE) and map load times when texture compilation is required.
This setting variable is primarily used by the texture compilation system within Unreal Engine’s editor. It’s part of the UEditorExperimentalSettings class, which suggests it’s an experimental feature for the editor.
The value of this variable is set in the UEditorExperimentalSettings constructor, where it’s initialized to false by default. It can be modified through the editor’s project settings interface, as indicated by the UPROPERTY macro with the EditAnywhere and config specifiers.
This variable interacts with other asynchronous compilation settings in the UEditorExperimentalSettings class, such as bEnableAsyncStaticMeshCompilation and bEnableAsyncSkinnedAssetCompilation. It’s also used in conjunction with console variables related to asynchronous compilation in the TextureCompiler.cpp file.
Developers should be aware that this is an experimental feature, and enabling it may have implications on texture compilation behavior and performance. It’s important to test thoroughly when enabling this feature to ensure it doesn’t introduce any unexpected issues in your project.
Best practices when using this variable include:
- Only enable it if you’re experiencing performance issues during PIE or map loading due to texture compilation.
- Monitor the impact on texture quality and loading times after enabling this feature.
- Be prepared to disable it if you encounter any unexpected behavior or issues with texture compilation.
- Consider enabling this feature in conjunction with other async compilation settings for a more comprehensive performance improvement.
- Keep in mind that as an experimental feature, it may change or be removed in future engine versions, so avoid relying on it for critical functionality.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:156, section: [/Script/UnrealEd.EditorExperimentalSettings]
- INI Section:
/Script/UnrealEd.EditorExperimentalSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:10
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
#include "EditorExperimentalSettings.generated.h"
/**
* Implements Editor settings for experimental features.
*/
UCLASS(config=EditorPerProjectUserSettings, MinimalAPI)
class UEditorExperimentalSettings
: public UObject
{
GENERATED_UCLASS_BODY()
public:
/** Enable async texture compilation to improve PIE and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async texture compilation and loading"))
bool bEnableAsyncTextureCompilation;
/** Enable async static mesh compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
bool bEnableAsyncStaticMeshCompilation;
/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
bool bEnableAsyncSkeletalMeshCompilation;
/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
bool bEnableAsyncSkinnedAssetCompilation;
/** Enable async sound compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
bool bEnableAsyncSoundWaveCompilation;
/** Allows the editor to run on HDR monitors on Windows 10 */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
bool bHDREditor;
/** The brightness of the slate UI on HDR monitors */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
float HDREditorNITLevel;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:171
Scope (from outer to inner):
file
function UEditorExperimentalSettings::UEditorExperimentalSettings
Source code excerpt:
static TAutoConsoleVariable<int32> CVarEditorHDRSupport(
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
: Super(ObjectInitializer)
, bEnableAsyncTextureCompilation(false)
, bEnableAsyncStaticMeshCompilation(false)
, bEnableAsyncSkeletalMeshCompilation(true) // This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
, bEnableAsyncSkinnedAssetCompilation(false)
, bEnableAsyncSoundWaveCompilation(false)
, bHDREditor(false)
, HDREditorNITLevel(160.0f)
, bUseOpenCLForConvexHullDecomp(false)
, bAllowPotentiallyUnsafePropertyEditing(false)
, bPackedLevelActor(true)
, bLevelInstance(true)
{
}
void UEditorExperimentalSettings::PostInitProperties()
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
if (!bEnableAsyncSkeletalMeshCompilation)
{
UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
bEnableAsyncSkinnedAssetCompilation = false;
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureCompiler.cpp:58
Scope (from outer to inner):
file
namespace TextureCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
}
static void EnsureInitializedCVars()
{
static bool bIsInitialized = false;
if (!bIsInitialized)
{
bIsInitialized = true;
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("texture"),
CVarAsyncTextureStandard.AsyncCompilation,
CVarAsyncTextureStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncTextureCompilation));
}
}
}
FTextureCompilingManager::FTextureCompilingManager()
: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
TextureCompilingManagerImpl::EnsureInitializedCVars();
}
FName FTextureCompilingManager::GetStaticAssetTypeName()
{
return TEXT("UE-Texture");
}
bool FTextureCompilingManager::IsCompilingTexture(UTexture* InTexture) const
{
check(IsInGameThread());
if (!InTexture)
{
return false;
}
const TWeakObjectPtr<UTexture> InWeakTexturePtr = InTexture;
uint32 Hash = GetTypeHash(InWeakTexturePtr);