Added preset for converting gsi images
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"Type": "JsonSerialization",
|
||||
"Version": 1,
|
||||
"ClassName": "MultiplatformPresetSettings",
|
||||
"ClassData": {
|
||||
"DefaultPreset": {
|
||||
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
|
||||
"Name": "GSI",
|
||||
"PixelFormat": "R8G8B8A8",
|
||||
"UncompressedAutoPick": true,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"PlatformsPresets": {
|
||||
"android": {
|
||||
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
|
||||
"Name": "GSI",
|
||||
"PixelFormat": "R8G8B8A8",
|
||||
"UncompressedAutoPick": true,
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
|
||||
"Name": "GSI",
|
||||
"PixelFormat": "R8G8B8A8",
|
||||
"UncompressedAutoPick": true,
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"mac": {
|
||||
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
|
||||
"Name": "GSI",
|
||||
"PixelFormat": "R8G8B8A8",
|
||||
"UncompressedAutoPick": true,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"provo": {
|
||||
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
|
||||
"Name": "GSI",
|
||||
"PixelFormat": "R8G8B8A8",
|
||||
"UncompressedAutoPick": true,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"Type": "JsonSerialization",
|
||||
"Version": 1,
|
||||
"ClassName": "MultiplatformPresetSettings",
|
||||
"ClassData": {
|
||||
"DefaultPreset": {
|
||||
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
|
||||
"Name": "GSI16",
|
||||
"PixelFormat": "R16",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"PlatformsPresets": {
|
||||
"android": {
|
||||
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
|
||||
"Name": "GSI16",
|
||||
"PixelFormat": "R16",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
|
||||
"Name": "GSI16",
|
||||
"PixelFormat": "R16",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"mac": {
|
||||
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
|
||||
"Name": "GSI16",
|
||||
"PixelFormat": "R16",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"provo": {
|
||||
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
|
||||
"Name": "GSI16",
|
||||
"PixelFormat": "R16",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"Type": "JsonSerialization",
|
||||
"Version": 1,
|
||||
"ClassName": "MultiplatformPresetSettings",
|
||||
"ClassData": {
|
||||
"DefaultPreset": {
|
||||
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
|
||||
"Name": "GSI32",
|
||||
"PixelFormat": "R32",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"PlatformsPresets": {
|
||||
"android": {
|
||||
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
|
||||
"Name": "GSI32",
|
||||
"PixelFormat": "R32",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
|
||||
"Name": "GSI32",
|
||||
"PixelFormat": "R32",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"mac": {
|
||||
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
|
||||
"Name": "GSI32",
|
||||
"PixelFormat": "R32",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"provo": {
|
||||
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
|
||||
"Name": "GSI32",
|
||||
"PixelFormat": "R32",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"Type": "JsonSerialization",
|
||||
"Version": 1,
|
||||
"ClassName": "MultiplatformPresetSettings",
|
||||
"ClassData": {
|
||||
"DefaultPreset": {
|
||||
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
|
||||
"Name": "GSI8",
|
||||
"PixelFormat": "R8",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"PlatformsPresets": {
|
||||
"android": {
|
||||
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
|
||||
"Name": "GSI8",
|
||||
"PixelFormat": "R8",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
|
||||
"Name": "GSI8",
|
||||
"PixelFormat": "R8",
|
||||
"MaxTextureSize": 2048,
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"mac": {
|
||||
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
|
||||
"Name": "GSI8",
|
||||
"PixelFormat": "R8",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
},
|
||||
"provo": {
|
||||
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
|
||||
"Name": "GSI8",
|
||||
"PixelFormat": "R8",
|
||||
"DiscardAlpha": true,
|
||||
"IsPowerOf2": true,
|
||||
"MipMapSetting": {
|
||||
"MipGenType": "Box"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,11 @@
|
||||
// decal
|
||||
"_decal": [ "Decal_AlbedoWithOpacity" ],
|
||||
// ui
|
||||
"_ui": [ "UserInterface_Compressed","UserInterface_Lossless" ]
|
||||
"_ui": [ "UserInterface_Compressed","UserInterface_Lossless" ],
|
||||
"_gsi": [ "GSI" ],
|
||||
"_gsi8": [ "GSI8" ],
|
||||
"_gsi16": [ "GSI16" ],
|
||||
"_gsi32": [ "GSI32" ]
|
||||
},
|
||||
"DefaultPreset": "Albedo",
|
||||
"DefaultPresetAlpha": "AlbedoWithGenericAlpha"
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace ImageProcessingAtom
|
||||
->Field("NumberResidentMips", &PresetSettings::m_numResidentMips)
|
||||
->Field("Swizzle", &PresetSettings::m_swizzle)
|
||||
->Field("CubemapSettings", &PresetSettings::m_cubemapSetting)
|
||||
->Field("MipMapSetting", &PresetSettings::m_mipmapSetting);
|
||||
->Field("MipMapSetting", &PresetSettings::m_mipmapSetting)
|
||||
->Field("UncompressedAutoPick", &PresetSettings::m_uncompressedAutoPick)
|
||||
;
|
||||
|
||||
serialize->Enum<RGBWeight>()
|
||||
->Value("Uniform", RGBWeight::uniform)
|
||||
@@ -200,7 +202,9 @@ namespace ImageProcessingAtom
|
||||
m_glossFromNormals == other.m_glossFromNormals &&
|
||||
m_swizzle == other.m_swizzle &&
|
||||
m_isMipRenormalize == other.m_isMipRenormalize &&
|
||||
m_numResidentMips == other.m_numResidentMips;
|
||||
m_numResidentMips == other.m_numResidentMips &&
|
||||
m_uncompressedAutoPick == other.m_uncompressedAutoPick
|
||||
;
|
||||
}
|
||||
|
||||
void PresetSettings::DeepCopyMembers(const PresetSettings& other)
|
||||
@@ -237,6 +241,7 @@ namespace ImageProcessingAtom
|
||||
m_swizzle = other.m_swizzle;
|
||||
m_isMipRenormalize = other.m_isMipRenormalize;
|
||||
m_numResidentMips = other.m_numResidentMips;
|
||||
m_uncompressedAutoPick = other.m_uncompressedAutoPick;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,10 @@ namespace ImageProcessingAtom
|
||||
//"swizzle". need to be 4 character and each character need to be one of "rgba01"
|
||||
AZStd::string m_swizzle;
|
||||
|
||||
//! Convert to an uncompressed pixel format that automatically picks a preferred pixel
|
||||
//! format based on the source input
|
||||
bool m_uncompressedAutoPick = false;
|
||||
|
||||
protected:
|
||||
void DeepCopyMembers(const PresetSettings& other);
|
||||
};
|
||||
|
||||
@@ -535,7 +535,18 @@ namespace ImageProcessingAtom
|
||||
m_image->GetCompressOption().rgbWeight = m_input->m_presetSetting.GetColorWeight();
|
||||
m_image->GetCompressOption().discardAlpha = m_input->m_presetSetting.m_discardAlpha;
|
||||
|
||||
m_image->ConvertFormat(m_input->m_presetSetting.m_pixelFormat);
|
||||
// If the m_uncompressedAutoPick flag is set, then let the converter pick
|
||||
// a pixel format that best matches the source input format
|
||||
if (m_input->m_presetSetting.m_uncompressedAutoPick)
|
||||
{
|
||||
EPixelFormat sourceInputFormat = m_input->m_inputImage->GetPixelFormat();
|
||||
m_image->ConvertFormat(sourceInputFormat);
|
||||
}
|
||||
// Otherwise, convert to the pixel format specified by the preset that was chosen
|
||||
else
|
||||
{
|
||||
m_image->ConvertFormat(m_input->m_presetSetting.m_pixelFormat);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user