#include <TextureSettings.h>
|
static StringOutcome | GetPlatformSpecificTextureSetting (const PlatformName &platformName, const TextureSettings &baseTextureSettings, TextureSettings &textureSettingsOut, AZ::SerializeContext *serializeContext=nullptr) |
|
static void | Reflect (AZ::ReflectContext *context) |
|
static StringOutcome | LoadTextureSetting (const AZStd::string &filepath, TextureSettings &textureSettingPtrOut, AZ::SerializeContext *serializeContext=nullptr) |
|
static StringOutcome | WriteTextureSetting (const AZStd::string &filepath, TextureSettings &textureSetting, AZ::SerializeContext *serializeContext=nullptr) |
|
static MultiplatformTextureSettings | GenerateDefaultMultiplatformTextureSettings (const AZStd::string &imageFilepath) |
|
static const MultiplatformTextureSettings | GetMultiplatformTextureSetting (const AZStd::string &filepath, bool &canOverridePreset, AZ::SerializeContext *serializeContext=nullptr) |
|
static const MultiplatformTextureSettings | GetMultiplatformTextureSetting (const TextureSettings &textureSettings, AZ::SerializeContext *serializeContext=nullptr) |
|
|
AZ::Uuid | m_presetId |
|
PresetName | m_preset |
|
unsigned int | m_sizeReduceLevel |
|
bool | m_suppressEngineReduce |
|
bool | m_enableMipmap |
|
bool | m_maintainAlphaCoverage |
|
AZStd::vector< AZ::u32 > | m_mipAlphaAdjust |
|
MipGenEvalType | m_mipGenEval |
|
MipGenType | m_mipGenType |
|
AZStd::set< AZStd::string > | m_tags |
|
|
static const char * | ExtensionName |
|
static const size_t | s_MaxMipMaps = 6 |
|
TextureSettings is the configuration for processing one image. It contains a reference of preset and other parameters. Some parameters are come from preset but overwrite them. The texture settings may be different for each platform, so the different is saved as data patch per platform. When automatically generate a new texture settings for an image file, use BuilderSettingManager::GetSuggestedPreset function to find the best preset may fit this image, then use ApplyPreset to propagate values from preset settings to texture settings. TextureSettings is intended to be editable for user to modify its value through texture editor tool.
◆ ApplyPreset()
void ImageProcessingAtom::TextureSettings::ApplyPreset |
( |
PresetName | presetName | ) |
|
Apply value of some preset settings to this texture settings
◆ ApplySettings()
StringOutcome ImageProcessingAtom::TextureSettings::ApplySettings |
( |
const TextureSettings & | settings, |
|
|
const PlatformName & | overridePlatform = PlatformName(), |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
Applies texture settings to the instance (including overrides). Common settings are applied, unless specific platform is specified.
- Parameters
-
Reference | to the settings which will be applied. |
Optional. | Applies settings as a platform override if a platform is specified. |
Optional. | Serialize context. Will use global context if none is provided. |
- Returns
- Status outcome result.
◆ ComputeMIPAlphaOffset()
float ImageProcessingAtom::TextureSettings::ComputeMIPAlphaOffset |
( |
AZ::u32 | mip | ) |
const |
Returns an alpha offset value for certain mip. The alpha offset is interpolated from m_mipAlphaAdjust[] and used for TransferAlphaCoverage only. Check the comment of m_maintainAlphaCoverage for more detail on how it may work.
◆ Equals()
bool ImageProcessingAtom::TextureSettings::Equals |
( |
const TextureSettings & | other, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
Performs a comprehensive comparison between two TextureSettings instances.
- Parameters
-
Reference | to the settings which will be compared. |
Optional. | Serialize context. Will use global context if none is provided. |
- Returns
- True, is both instances are equivalent.
◆ GetMultiplatformTextureSetting() [1/2]
static const MultiplatformTextureSettings ImageProcessingAtom::TextureSettings::GetMultiplatformTextureSetting |
( |
const AZStd::string & | filepath, |
|
|
bool & | canOverridePreset, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
|
static |
Generates a TextureSetting instance of a particular image file for each supported platform.
- Parameters
-
filepath | - A path to the texture file. |
canOverridePreset | - Returns whether the preset can be overriden. Will return false if the preset was selecting from a settings file created by the user. |
serializeContext | - Optional. Serialize context used for reflection/serialization |
- Returns
- - The collection of TextureSetting instances. If error occurs, a default MultiplatformTextureSettings is returned (see GenerateDefaultMultiplatformTextureSettings()).
◆ GetMultiplatformTextureSetting() [2/2]
static const MultiplatformTextureSettings ImageProcessingAtom::TextureSettings::GetMultiplatformTextureSetting |
( |
const TextureSettings & | textureSettings, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
|
static |
Generates a TextureSetting instance of a particular image file for each supported platform.
- Parameters
-
textureSettings | - A reference to an already-loaded texture settings. |
serializeContext | - Optional. Serialize context used for reflection/serialization |
- Returns
- - The collection of TextureSetting instances. If error occurs, a default MultiplatformTextureSettings is returned (see GenerateDefaultMultiplatformTextureSettings()).
◆ GetPlatformSpecificTextureSetting()
static StringOutcome ImageProcessingAtom::TextureSettings::GetPlatformSpecificTextureSetting |
( |
const PlatformName & | platformName, |
|
|
const TextureSettings & | baseTextureSettings, |
|
|
TextureSettings & | textureSettingsOut, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
|
static |
Gets platform-specific texture settings obtained from the base settings version of a pre-loaded TextureSettings instance.
- Parameters
-
Name | of platform to get the settings from. |
Base | TextureSettings which we will get overrides from. |
Output | TextureSettings which will contain the result of the function. |
Optional. | Serialize context. Will use global context if none is provided. |
- Returns
- Status outcome result.
◆ LoadTextureSetting()
static StringOutcome ImageProcessingAtom::TextureSettings::LoadTextureSetting |
( |
const AZStd::string & | filepath, |
|
|
TextureSettings & | textureSettingPtrOut, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
|
static |
Loads base texture settings obtained from ".assetinfo" file
- Parameters
-
FilePath | absolute/relative path of the ".assetinfo" file. |
Output | TextureSettings which contain the result of the function, it may contains platform-specific overrides. |
Optional. | Serialize context. Will use global context if none is provided. |
- Returns
- Status outcome result.
◆ WriteTextureSetting()
static StringOutcome ImageProcessingAtom::TextureSettings::WriteTextureSetting |
( |
const AZStd::string & | filepath, |
|
|
TextureSettings & | textureSetting, |
|
|
AZ::SerializeContext * | serializeContext = nullptr ) |
|
static |
Writes base texture settings to a ".assetinfo" file (modern setting)
- Parameters
-
FilePath | absolute/relative path of the ".assetinfo" file. |
TextureSetting | to be written on the disk, it may contains platform-specific overrides. |
Optional. | Serialize context. Will use global context if none is provided. |
- Returns
- Status outcome result.
The documentation for this class was generated from the following file:
- Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.h