CookUsesSpeed
CookUsesSpeed
#Overview
name: CookUsesSpeed
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 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of CookUsesSpeed is to determine the encoding speed for textures during the cooking process in Unreal Engine 5. This setting variable is part of the texture encoding system, which is responsible for compressing and optimizing textures for use in the game or application.
Based on the callsites, the CookUsesSpeed variable is primarily used in the Engine module, specifically within the texture encoding subsystem. It is referenced in the TextureEncodingSettings.cpp and TextureEncodingSettingsPrivate.h files.
The value of this variable is set in the UTextureEncodingProjectSettings class constructor, which initializes it to ETextureEncodeSpeed::Final by default. It can be modified through the project settings, as indicated by the UPROPERTY macro with the “config” and “EditAnywhere” specifiers.
CookUsesSpeed interacts with other variables in the texture encoding system, such as EditorUsesSpeed. These two variables work together to determine the appropriate encoding speed for different scenarios (cooking vs. editor usage).
Developers should be aware that changing this variable can affect the cooking process’s performance and the resulting texture quality. The ETextureEncodeSpeed enum likely provides options for balancing between speed and quality.
Best practices when using this variable include:
- Consider the project’s requirements for texture quality and build time when selecting the appropriate encode speed.
- Be consistent with the encoding speed settings across the project to ensure uniform texture quality.
- Test the impact of different encode speeds on both cooking time and final texture quality to find the optimal balance for your project.
- Remember that changes to this setting require a restart of the editor, as indicated by the “ConfigRestartRequired” meta tag.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3462, section: [/Script/Engine.TextureEncodingProjectSettings]
- INI Section:
/Script/Engine.TextureEncodingProjectSettings
- Raw value:
Final
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:20
Scope (from outer to inner):
file
function UTextureEncodingProjectSettings::UTextureEncodingProjectSettings
Source code excerpt:
FastEffortLevel(ETextureEncodeEffort::Normal),
FastUniversalTiling(ETextureUniversalTiling::Disabled),
CookUsesSpeed(ETextureEncodeSpeed::Final),
EditorUsesSpeed(ETextureEncodeSpeed::FinalIfAvailable)
{
}
UTextureEncodingUserSettings::UTextureEncodingUserSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:84
Scope (from outer to inner):
file
function static void ConstructResolvedSettings
Source code excerpt:
OutResolvedSettings->Project.FastEffortLevel = ProjectSettings->FastEffortLevel;
OutResolvedSettings->Project.FastUniversalTiling = ProjectSettings->FastUniversalTiling;
OutResolvedSettings->Project.CookUsesSpeed = ProjectSettings->CookUsesSpeed;
OutResolvedSettings->Project.EditorUsesSpeed = ProjectSettings->EditorUsesSpeed;
// Determine what encode speed to use
{
const UEnum* EncodeSpeedEnum = StaticEnum<ETextureEncodeSpeed>();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettings.cpp:126
Scope (from outer to inner):
file
function static void ConstructResolvedSettings
Source code excerpt:
else
{
OutResolvedSettings->EncodeSpeed = OutResolvedSettings->Project.CookUsesSpeed;
UE_LOG(LogTextureEncodingSettings, Display, TEXT("Texture Encode Speed: %s (cook)."), *EncodeSpeedEnum->GetNameStringByValue((int64)OutResolvedSettings->EncodeSpeed));
}
}
// Log encode speeds
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureEncodingSettingsPrivate.h:115
Scope (from outer to inner):
file
class class UTextureEncodingProjectSettings : public UDeveloperSettings
Source code excerpt:
// Which encode speed non interactive editor sessions will use (i.e. commandlets)
UPROPERTY(config, EditAnywhere, Category = EncodeSpeeds, meta = (ConfigRestartRequired = true))
ETextureEncodeSpeed CookUsesSpeed;
// Which encode speed everything else uses.
UPROPERTY(config, EditAnywhere, Category = EncodeSpeeds, meta = (ConfigRestartRequired = true))
ETextureEncodeSpeed EditorUsesSpeed;
};
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/TextureEncodingSettings.h:67
Scope: file
Source code excerpt:
ETextureEncodeEffort FastEffortLevel;
ETextureUniversalTiling FastUniversalTiling;
ETextureEncodeSpeed CookUsesSpeed;
ETextureEncodeSpeed EditorUsesSpeed;
} Project;
// The resolved EncodeSpeed to use for this instance, taking in to account overrides.
ETextureEncodeSpeed EncodeSpeed;