diff --git a/Code/Framework/AzCore/AzCore/std/function/function_base.h b/Code/Framework/AzCore/AzCore/std/function/function_base.h index 32892a4c03..b39a5cf81b 100644 --- a/Code/Framework/AzCore/AzCore/std/function/function_base.h +++ b/Code/Framework/AzCore/AzCore/std/function/function_base.h @@ -10,6 +10,7 @@ #ifndef AZSTD_FUNCTION_BASE_HEADER #define AZSTD_FUNCTION_BASE_HEADER +#include #include #include #include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt index 233ead9dea..6227d74d7e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt @@ -66,6 +66,7 @@ ly_add_target( 3rdParty::PVRTexTool 3rdParty::squish-ccr 3rdParty::tiff + 3rdParty::ISPCTexComp 3rdParty::ilmbase Legacy::CryCommon AZ::AzFramework diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageObject.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageObject.h index 561dee5880..5796a0c84d 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageObject.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageObject.h @@ -70,7 +70,6 @@ namespace ImageProcessingAtom virtual AZ::u32 GetPixelCount(AZ::u32 mip) const = 0; virtual AZ::u32 GetWidth(AZ::u32 mip) const = 0; virtual AZ::u32 GetHeight(AZ::u32 mip) const = 0; - virtual bool IsCubemap() const = 0; virtual AZ::u32 GetMipCount() const = 0; //get pixel data buffer diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.cpp index bfe5e283b5..709bce4c54 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.cpp @@ -141,6 +141,11 @@ namespace ImageProcessingAtom ColorSpace CTSquisher::GetSupportedColorSpace([[maybe_unused]] EPixelFormat compressFormat) const { return ColorSpace::autoSelect; + } + + const char* CTSquisher::GetName() const + { + return "CTSquisher"; } EPixelFormat CTSquisher::GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.h index 77865a596e..1e4aaf3f31 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/CTSquisher.h @@ -27,6 +27,7 @@ namespace ImageProcessingAtom EPixelFormat GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const override; ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const final; + const char* GetName() const final; private: static CryTextureSquisher::ECodingPreset GetCompressPreset(EPixelFormat compressFmt, EPixelFormat uncompressFmt); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp index 99205edb01..2cd7ff0e9b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp @@ -10,22 +10,15 @@ #include #include #include - -// this is required for the AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR define -#include - -#if AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR #include -#endif namespace ImageProcessingAtom { - ICompressorPtr ICompressor::FindCompressor(EPixelFormat fmt, ColorSpace colorSpace, bool isCompressing) + ICompressorPtr ICompressor::FindCompressor(EPixelFormat fmt, [[maybe_unused]] ColorSpace colorSpace, bool isCompressing) { // The ISPC texture compressor is able to compress BC1, BC3, BC6H and BC7 formats, and all of the ASTC formats. // Note: The ISPC texture compressor is only able to compress images that are a multiple of the compressed format's blocksize. // Another limitation is that the compressor requires LDR source images to be in sRGB colorspace. -#if AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR if (ISPCCompressor::IsCompressedPixelFormatSupported(fmt)) { if ((isCompressing && ISPCCompressor::IsSourceColorSpaceSupported(colorSpace, fmt)) || (!isCompressing && ISPCCompressor::DoesSupportDecompress(fmt))) @@ -33,7 +26,6 @@ namespace ImageProcessingAtom return ICompressorPtr(new ISPCCompressor()); } } -#endif if (CTSquisher::IsCompressedPixelFormatSupported(fmt)) { diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.h index 4eb04590a5..dff71e59db 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.h @@ -48,6 +48,7 @@ namespace ImageProcessingAtom virtual IImageObjectPtr DecompressImage(IImageObjectPtr srcImage, EPixelFormat fmtDst) const = 0; virtual EPixelFormat GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const = 0; virtual ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const = 0; + virtual const char* GetName() const = 0; //find compressor for specified compressed pixel format. isCompressing to indicate if it's for compressing or decompressing static ICompressorPtr FindCompressor(EPixelFormat fmt, ColorSpace colorSpace, bool isCompressing); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.cpp index 0c3d6dca3d..73108d5502 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.cpp @@ -111,6 +111,11 @@ namespace ImageProcessingAtom { return ColorSpace::autoSelect; } + + const char* ETC2Compressor::GetName() const + { + return "ETC2Compressor"; + } IImageObjectPtr ETC2Compressor::CompressImage(IImageObjectPtr srcImage, EPixelFormat fmtDst, const CompressOption* compressOption) const diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.h index 7e5354a185..9ab5a164a5 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ETC2.h @@ -24,7 +24,8 @@ namespace ImageProcessingAtom IImageObjectPtr DecompressImage(IImageObjectPtr srcImage, EPixelFormat fmtDst) const override; EPixelFormat GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const override; - virtual ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const final; + ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const final; + const char* GetName() const final; }; } // namespace ImageProcessingAtom diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.cpp index be6eb9511d..5e96c7274d 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.cpp @@ -111,6 +111,11 @@ namespace ImageProcessingAtom return ColorSpace::autoSelect; } + const char* ISPCCompressor::GetName() const + { + return "ISPCCompressor"; + } + IImageObjectPtr ISPCCompressor::CompressImage(IImageObjectPtr sourceImage, EPixelFormat destinationFormat, const CompressOption* compressOption) const { // Used to find the profile setters, depending on the image quality diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.h index 8652b60b68..2ab0dfc833 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ISPCTextureCompressor.h @@ -28,7 +28,9 @@ namespace ImageProcessingAtom ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const final; IImageObjectPtr CompressImage(IImageObjectPtr sourceImage, EPixelFormat destinationFormat, const CompressOption* compressOption) const final; - IImageObjectPtr DecompressImage(IImageObjectPtr sourceImage, EPixelFormat destinationFormat) const final; + IImageObjectPtr DecompressImage(IImageObjectPtr sourceImage, EPixelFormat destinationFormat) const final; + const char* GetName() const final; + EPixelFormat GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const final; }; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp index 7e11a83cae..0002ff4678 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp @@ -107,6 +107,11 @@ namespace ImageProcessingAtom return ColorSpace::autoSelect; } + const char* PVRTCCompressor::GetName() const + { + return "PVRTCCompressor"; + } + bool PVRTCCompressor::DoesSupportDecompress([[maybe_unused]] EPixelFormat fmtDst) { return true; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.h index 86e31286b6..cedd6d6643 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.h @@ -25,5 +25,6 @@ namespace ImageProcessingAtom EPixelFormat GetSuggestedUncompressedFormat(EPixelFormat compressedfmt, EPixelFormat uncompressedfmt) const override; ColorSpace GetSupportedColorSpace(EPixelFormat compressFormat) const final; + const char* GetName() const final; }; } // namespace ImageProcessingAtom diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/ConvertPixelFormat.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/ConvertPixelFormat.cpp index 004f17c33d..8f851b46d1 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/ConvertPixelFormat.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/ConvertPixelFormat.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include @@ -97,9 +98,18 @@ namespace ImageProcessingAtom else { IImageObjectPtr dstImage = nullptr; + const PixelFormatInfo* compressedInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(compressedFmt); if (isSrcUncompressed) { + AZ::u64 startTime = AZStd::GetTimeUTCMilliSecond(); dstImage = compressor->CompressImage(Get(), fmtDst, &m_compressOption); + AZ::u64 endTime = AZStd::GetTimeUTCMilliSecond(); + [[maybe_unused]] double processTime = static_cast(endTime - startTime) / 1000.0; + if (dstImage) + { + AZ_TracePrintf("Image Processing", "Image [%dx%d] was compressed to [%s] format by [%s] in %.3f seconds\n", + Get()->GetWidth(0), Get()->GetHeight(0), compressedInfo->szName, compressor->GetName(), processTime); + } } else { @@ -107,11 +117,13 @@ namespace ImageProcessingAtom } Set(dstImage); - } - - if (Get() == nullptr) - { - AZ_Error("Image Processing", false, "The selected compressor failed to compress this image"); + + if (dstImage == nullptr) + { + AZ_Error("Image Processing", false, "Failed to use [%s] to %s [%s] format", compressor->GetName(), + isSrcUncompressed ? "compress" : "decompress", + compressedInfo->szName); + } } } } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 40d1429f4b..c688b0b20c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -74,7 +74,7 @@ namespace ImageProcessingAtom builderDescriptor.m_busId = azrtti_typeid(); builderDescriptor.m_createJobFunction = AZStd::bind(&ImageBuilderWorker::CreateJobs, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); builderDescriptor.m_processJobFunction = AZStd::bind(&ImageBuilderWorker::ProcessJob, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); - builderDescriptor.m_version = 23; // [ATOM-14022] + builderDescriptor.m_version = 24; // [SPEC-7821] builderDescriptor.m_analysisFingerprint = ImageProcessingAtom::BuilderSettingManager::Instance()->GetAnalysisFingerprint(); m_imageBuilder.BusConnect(builderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBusTraits::RegisterBuilderInformation, builderDescriptor); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/QtImageLoader.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/QtImageLoader.cpp index 3ac36b8b17..4124eebcd4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/QtImageLoader.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/QtImageLoader.cpp @@ -28,6 +28,7 @@ namespace ImageProcessingAtom QImage qimage(filename.c_str()); if (qimage.isNull()) { + AZ_Error("ImageProcessing", false, "Failed to load [%s] via QImage", filename.c_str()); return NULL; } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Android/ImageProcessing_Traits_Android.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Android/ImageProcessing_Traits_Android.h index 22d0061573..0bd7ba3732 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Android/ImageProcessing_Traits_Android.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Android/ImageProcessing_Traits_Android.h @@ -13,4 +13,3 @@ #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 0 #define AZ_TRAIT_IMAGEPROCESSING_USE_BASE10_BYTE_PREFIX 0 -#define AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Linux/ImageProcessing_Traits_Linux.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Linux/ImageProcessing_Traits_Linux.h index 19b7621f8a..43e8a2b3f9 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Linux/ImageProcessing_Traits_Linux.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Linux/ImageProcessing_Traits_Linux.h @@ -13,4 +13,3 @@ #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 1 #define AZ_TRAIT_IMAGEPROCESSING_USE_BASE10_BYTE_PREFIX 0 -#define AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h index a494f7ace7..2704fb0185 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h @@ -13,4 +13,3 @@ #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 1 #define AZ_TRAIT_IMAGEPROCESSING_USE_BASE10_BYTE_PREFIX 1 -#define AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/ImageProcessing_Traits_Windows.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/ImageProcessing_Traits_Windows.h index 3fdd1ddf66..e8d25c2dad 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/ImageProcessing_Traits_Windows.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/ImageProcessing_Traits_Windows.h @@ -13,4 +13,3 @@ #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 1 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 0 #define AZ_TRAIT_IMAGEPROCESSING_USE_BASE10_BYTE_PREFIX 0 -#define AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR 1 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows.cmake index ca8dad1013..5cd1fb5a22 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows.cmake @@ -6,11 +6,3 @@ # # -# windows requires the 3rd Party ISPCTexComp library. - -ly_associate_package(PACKAGE_NAME ISPCTexComp-2021.3-rev1-windows TARGETS ISPCTexComp PACKAGE_HASH 324fb051a549bc96571530e63c01e18a4c860db45317734d86276fe27a45f6dd) - -set(LY_BUILD_DEPENDENCIES - PUBLIC - 3rdParty::ISPCTexComp - ) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows_files.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows_files.cmake index bb3cd74557..f404a9ef60 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows_files.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,4 @@ set(FILES ImageProcessing_Traits_Platform.h ImageProcessing_Traits_Windows.h - ../../Compressors/ISPCTextureCompressor.cpp - ../../Compressors/ISPCTextureCompressor.h ) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h index a494f7ace7..2704fb0185 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h @@ -13,4 +13,3 @@ #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 1 #define AZ_TRAIT_IMAGEPROCESSING_USE_BASE10_BYTE_PREFIX 1 -#define AZ_TRAIT_IMAGEPROCESSING_USE_ISPC_TEXTURE_COMPRESSOR 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp index 3f28e89334..a1093ffc37 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp @@ -869,7 +869,7 @@ namespace ImageProcessingAtom return process; } - void ImageConvertProcess::CreateIBLCubemap(AZ::Uuid presetUUID, const char* fileNameSuffix, IImageObjectPtr cubemapImage) + void ImageConvertProcess::CreateIBLCubemap(AZ::Uuid presetUUID, const char* fileNameSuffix, IImageObjectPtr& cubemapImage) { const AZStd::string& platformId = m_input->m_platform; AZStd::string_view filePath; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.h index db34c46e2a..190e68ca31 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.h @@ -161,7 +161,7 @@ namespace ImageProcessingAtom bool FillCubemapMipmaps(); //IBL cubemap generation, this creates a separate ImageConvertProcess - void CreateIBLCubemap(AZ::Uuid presetUUID, const char* fileNameSuffix, IImageObjectPtr cubemapImage); + void CreateIBLCubemap(AZ::Uuid presetUUID, const char* fileNameSuffix, IImageObjectPtr& cubemapImage); //convert color space to linear with pixel format rgba32f bool ConvertToLinear(); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageObjectImpl.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageObjectImpl.h index c4cbd13fea..c8b8ced496 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageObjectImpl.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageObjectImpl.h @@ -36,10 +36,6 @@ namespace ImageProcessingAtom AZ::u32 GetWidth(AZ::u32 mip) const override; AZ::u32 GetHeight(AZ::u32 mip) const override; AZ::u32 GetMipCount() const override; - bool IsCubemap() const override - { - return false; - }; void GetImagePointer(AZ::u32 mip, AZ::u8*& pMem, AZ::u32& pitch) const override; AZ::u32 GetMipBufSize(AZ::u32 mip) const override; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/ImageProcessing_Test.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/ImageProcessing_Test.cpp index 20aa1e927d..fa1b092e6b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/ImageProcessing_Test.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/ImageProcessing_Test.cpp @@ -71,11 +71,6 @@ using namespace ImageProcessingAtom; namespace UnitTest { - namespace - { - static const char* s_gemFolder; - } - // Expose AZ::AssetManagerComponent::Reflect function for testing class MyAssetManagerComponent : public AZ::AssetManagerComponent @@ -125,6 +120,8 @@ namespace UnitTest AZStd::unique_ptr m_jsonSystemComponent; AZStd::vector> m_assetHandlers; AZStd::string m_gemFolder; + AZStd::string m_outputRootFolder; + AZStd::string m_outputFolder; void SetUp() override { @@ -172,7 +169,7 @@ namespace UnitTest AzQtComponents::PrepareQtPaths(); m_gemFolder = AZ::Test::GetEngineRootPath() + "/Gems/Atom/Asset/ImageProcessingAtom/"; - s_gemFolder = m_gemFolder.c_str(); + m_outputFolder = m_gemFolder + AZStd::string("Code/Tests/TestAssets/temp/"); m_defaultSettingFolder = m_gemFolder + AZStd::string("Config/"); m_testFileFolder = m_gemFolder + AZStd::string("Code/Tests/TestAssets/"); @@ -185,7 +182,7 @@ namespace UnitTest void TearDown() override { m_gemFolder = AZStd::string(); - s_gemFolder = ""; + m_outputFolder = AZStd::string(); m_defaultSettingFolder = AZStd::string(); m_testFileFolder = AZStd::string(); @@ -226,16 +223,16 @@ namespace UnitTest Image_512X288_RGB8_Tga, Image_1024X1024_RGB8_Tif, Image_UpperCase_Tga, - Image_512x512_Normal_Tga, + Image_512x512_Normal_Tga, // QImage doesn't support loading this file. Image_128x128_Transparent_Tga, Image_237x177_RGB_Jpg, Image_GreyScale_Png, - Image_BlackWhite_Png, Image_Alpha8_64x64_Mip7_Dds, Image_BGRA_64x64_Mip7_Dds, Image_Luminance8bpp_66x33_dds, Image_BGR_64x64_dds, - Image_Sunset_4096x2048_R16G16B16A16F_exr + Image_defaultprobe_cm_1536x256_64bits_tif, + Image_workshop_iblskyboxcm_exr }; //image file names for testing @@ -258,17 +255,29 @@ namespace UnitTest m_imagFileNameMap[Image_128x128_Transparent_Tga] = m_testFileFolder + "128x128_RGBA8.tga"; m_imagFileNameMap[Image_237x177_RGB_Jpg] = m_testFileFolder + "237x177_RGB.jpg"; m_imagFileNameMap[Image_GreyScale_Png] = m_testFileFolder + "greyscale.png"; - m_imagFileNameMap[Image_BlackWhite_Png] = m_testFileFolder + "BlackWhite.png"; m_imagFileNameMap[Image_Alpha8_64x64_Mip7_Dds] = m_testFileFolder + "Alpha8_64x64_Mip7.dds"; m_imagFileNameMap[Image_BGRA_64x64_Mip7_Dds] = m_testFileFolder + "BGRA_64x64_MIP7.dds"; m_imagFileNameMap[Image_Luminance8bpp_66x33_dds] = m_testFileFolder + "Luminance8bpp_66x33.dds"; m_imagFileNameMap[Image_BGR_64x64_dds] = m_testFileFolder + "RGBA_64x64.dds"; - m_imagFileNameMap[Image_Sunset_4096x2048_R16G16B16A16F_exr] = m_testFileFolder + "sunset_cm.exr"; + m_imagFileNameMap[Image_defaultprobe_cm_1536x256_64bits_tif] = m_testFileFolder + "defaultProbe_cm.tif"; + m_imagFileNameMap[Image_workshop_iblskyboxcm_exr] = m_testFileFolder + "workshop_iblskyboxcm.exr"; } public: + void SetOutputSubFolder(const char* subFolderName) + { + if (subFolderName) + { + m_outputFolder = m_outputRootFolder + "/" + subFolderName; + } + else + { + m_outputFolder = m_outputRootFolder; + } + } + //helper function to save an image object to a file through QtImage - static void SaveImageToFile([[maybe_unused]] const IImageObjectPtr imageObject, [[maybe_unused]] const AZStd::string imageName, [[maybe_unused]] AZ::u32 maxMipCnt = 100) + void SaveImageToFile([[maybe_unused]] const IImageObjectPtr imageObject, [[maybe_unused]] const AZStd::string imageName, [[maybe_unused]] AZ::u32 maxMipCnt = 100) { #ifndef DEBUG_OUTPUT_IMAGES return; @@ -278,12 +287,12 @@ namespace UnitTest return; } - //create the directory if it's not exist - AZStd::string outputDir = s_gemFolder + AZStd::string("Code/Tests/TestAssets/Output/"); - QDir dir(outputDir.data()); - if (!dir.exists()) + // create dir if it doesn't exist + QDir dir; + QDir outputDir(m_outputFolder.c_str()); + if (!outputDir.exists()) { - dir.mkpath("."); + dir.mkpath(m_outputFolder.c_str()); } //save origin file pixel format so we could use it to generate name later @@ -303,12 +312,13 @@ namespace UnitTest finalImage->GetImagePointer(mip, imageBuf, pitch); uint32 width = finalImage->GetWidth(mip); uint32 height = finalImage->GetHeight(mip); + uint32 originalSize = imageObject->GetMipBufSize(mip); //generate file name char filePath[2048]; - azsprintf(filePath, "%s%s_%s_mip%d_%dx%d.png", outputDir.data(), imageName.c_str() + azsprintf(filePath, "%s%s_%s_mip%d_%dx%d_%d.png", m_outputFolder.data(), imageName.c_str() , CPixelFormats::GetInstance().GetPixelFormatInfo(originPixelFormat)->szName - , mip, width, height); + , mip, width, height, originalSize); QImage qimage(imageBuf, width, height, pitch, QImage::Format_RGBA8888); qimage.save(filePath); @@ -385,7 +395,7 @@ namespace UnitTest } - static bool CompareDDSImage(const QString& imagePath1, const QString& imagePath2, QString& output) + bool CompareDDSImage(const QString& imagePath1, const QString& imagePath2, QString& output) { IImageObjectPtr image1, alphaImage1, image2, alphaImage2; @@ -530,15 +540,7 @@ namespace UnitTest TEST_F(ImageProcessingTest, TestCubemapLayouts) { { - IImageObjectPtr srcImage(LoadImageFromFile(m_imagFileNameMap[Image_Sunset_4096x2048_R16G16B16A16F_exr])); - ImageToProcess imageToProcess(srcImage); - imageToProcess.ConvertCubemapLayout(CubemapLayoutHorizontalCross); - ASSERT_TRUE(imageToProcess.Get()->GetWidth(0) * 3 == imageToProcess.Get()->GetHeight(0) * 4); - SaveImageToFile(imageToProcess.Get(), "LatLong", 1); - } - - { - IImageObjectPtr srcImage(LoadImageFromFile(m_testFileFolder + "defaultProbe_cm.tif")); + IImageObjectPtr srcImage(LoadImageFromFile(m_imagFileNameMap[Image_defaultprobe_cm_1536x256_64bits_tif])); ImageToProcess imageToProcess(srcImage); imageToProcess.ConvertCubemapLayout(CubemapLayoutVertical); @@ -635,12 +637,8 @@ namespace UnitTest ASSERT_TRUE(img != nullptr); ASSERT_TRUE(img->GetPixelFormat() == ePixelFormat_B8G8R8); - // Exr files - img = IImageObjectPtr(LoadImageFromFile(m_imagFileNameMap[Image_Sunset_4096x2048_R16G16B16A16F_exr])); - ASSERT_TRUE(img != nullptr); - img = IImageObjectPtr(LoadImageFromFile(m_testFileFolder + "abandoned_sanatorium_staircase_cm.exr")); - ASSERT_TRUE(img != nullptr); - img = IImageObjectPtr(LoadImageFromFile(m_testFileFolder + "road_in_tenerife_mountain_cm.exr")); + // Exr file + img = IImageObjectPtr(LoadImageFromFile(m_imagFileNameMap[Image_workshop_iblskyboxcm_exr])); ASSERT_TRUE(img != nullptr); } @@ -783,39 +781,36 @@ namespace UnitTest ASSERT_TRUE(dstImage3->CompareImage(dstImage1)); } - TEST_F(ImageProcessingTest, DISABLED_TestConvertPVRTC) - { - //source image - AZStd::string inputFile; - inputFile = "../AutomatedTesting/Objects/ParticleAssets/ShowRoom/showroom_pipe_blue_001_ddna.tif"; - - IImageObjectPtr srcImage(LoadImageFromFile(inputFile)); - ImageToProcess imageToProcess(srcImage); - - for (EPixelFormat pixelFormat = ePixelFormat_PVRTC2; pixelFormat <= ePixelFormat_ETC2a;) - { - imageToProcess.Set(srcImage); - imageToProcess.ConvertFormat(pixelFormat); - SaveImageToFile(imageToProcess.Get(), "Compressor", 1); - - //next format - pixelFormat = EPixelFormat(pixelFormat + 1); - } - } - - TEST_F(ImageProcessingTest, DISABLED_TestConvertFormat) + TEST_F(ImageProcessingTest, TestConvertFormatCompressed) { - EPixelFormat pixelFormat; IImageObjectPtr srcImage; //images to be tested - static const int imageCount = 5; + static const int imageCount = 4; ImageFeature images[imageCount] = { Image_20X16_RGBA8_Png, - Image_32X32_16bit_F_Tif, - Image_32X32_32bit_F_Tif, - Image_512x512_Normal_Tga, - Image_128x128_Transparent_Tga }; + Image_237x177_RGB_Jpg, + Image_128x128_Transparent_Tga, + Image_defaultprobe_cm_1536x256_64bits_tif}; + + // collect all compressed pixel formats + AZStd::vector compressedFormats; + for (uint32 i = 0; i < ePixelFormat_Count; i++) + { + EPixelFormat pixelFormat = (EPixelFormat)i; + auto formatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(pixelFormat); + if (formatInfo->bCompressed) + { + // exclude astc formats until we add astc compressor to all platforms + // exclude pvrtc formats (deprecating) + if (!IsASTCFormat(pixelFormat) + && pixelFormat != ePixelFormat_PVRTC2 && pixelFormat != ePixelFormat_PVRTC4 + && !IsETCFormat(pixelFormat)) // skip ETC since it's very slow + { + compressedFormats.push_back(pixelFormat); + } + } + } for (int imageIdx = 0; imageIdx < imageCount; imageIdx++) { @@ -827,42 +822,37 @@ namespace UnitTest ImageToProcess imageToProcess(srcImage); //test ConvertFormat functions against all the pixel formats - for (pixelFormat = ePixelFormat_R8G8B8A8; pixelFormat < ePixelFormat_Unknown;) + for (EPixelFormat pixelFormat : compressedFormats) { + // + if (!CPixelFormats::GetInstance().IsImageSizeValid(pixelFormat, srcImage->GetWidth(0), srcImage->GetHeight(0), false)) + { + continue; + } + + auto formatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(pixelFormat); imageToProcess.Set(srcImage); imageToProcess.ConvertFormat(pixelFormat); - ASSERT_TRUE(imageToProcess.Get()); - - //if the format is compressed and there is no compressor for it, it won't be converted to the expected format - if (ICompressor::FindCompressor(pixelFormat, ImageProcessingAtom::ColorSpace::autoSelect, true) == nullptr - && !CPixelFormats::GetInstance().IsPixelFormatUncompressed(pixelFormat)) - { - ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() != pixelFormat); - } - else + if (!imageToProcess.Get()) { - //validate the size and it may not working for some uncompressed format - if (!CPixelFormats::GetInstance().IsImageSizeValid( - pixelFormat, srcImage->GetWidth(0), srcImage->GetHeight(0), false)) - { - ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() != pixelFormat); - } - else - { - ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() == pixelFormat); - - //save the image to a file so we can check the visual result - SaveImageToFile(imageToProcess.Get(), imageName, 1); - - //convert back to an uncompressed format and expect it will be successful - imageToProcess.ConvertFormat(ePixelFormat_R8G8B8A8); - ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() == ePixelFormat_R8G8B8A8); - } + AZ_Warning("test", false, "unsupported format: %s", formatInfo->szName); + continue; } + ASSERT_TRUE(imageToProcess.Get()); + ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() == pixelFormat); + + // Get compressor name + ColorSpace sourceColorSpace = srcImage->HasImageFlags(EIF_SRGBRead) ? ColorSpace::sRGB : ColorSpace::linear; + ICompressorPtr compressor = ICompressor::FindCompressor(pixelFormat, sourceColorSpace, true); - //next pixel format - pixelFormat = EPixelFormat(pixelFormat + 1); + //save the image to a file so we can check the visual result + AZStd::string outputName = AZStd::string::format("%s_%s", imageName.c_str(), compressor->GetName()); + SaveImageToFile(imageToProcess.Get(), outputName, 1); + + //convert back to an uncompressed format and expect it will be successful + imageToProcess.ConvertFormat(ePixelFormat_R8G8B8A8); + ASSERT_TRUE(imageToProcess.Get()->GetPixelFormat() == ePixelFormat_R8G8B8A8); } } } @@ -932,22 +922,22 @@ namespace UnitTest #endif //AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS } - TEST_F(ImageProcessingTest, DISABLED_TestCubemap) + //test image conversion for builder + TEST_F(ImageProcessingTest, TestBuilderImageConvertor) { //load builder presets auto outcome = BuilderSettingManager::Instance()->LoadConfigFromFolder(m_defaultSettingFolder); ASSERT_TRUE(outcome.IsSuccess()); - const AZStd::string outputFolder = m_gemFolder + AZStd::string("Code/Tests/TestAssets/temp/"); AZStd::string inputFile; AZStd::vector outProducts; - inputFile = m_testFileFolder + "defaultProbe_cm.tif"; - - ImageConvertProcess* process = CreateImageConvertProcess(inputFile, outputFolder, "pc", outProducts); + inputFile = m_imagFileNameMap[Image_128x128_Transparent_Tga]; + ImageConvertProcess* process = CreateImageConvertProcess(inputFile, m_outputFolder, "pc", outProducts, m_context.get()); if (process != nullptr) { + //the process can be stopped if the job is canceled or the worker is shutting down int step = 0; while (!process->IsFinished()) { @@ -958,78 +948,49 @@ namespace UnitTest //get process result ASSERT_TRUE(process->IsSucceed()); - SaveImageToFile(process->GetOutputImage(), "cubemap", 100); - SaveImageToFile(process->GetOutputIBLSpecularCubemap(), "iblspecularcubemap", 100); - SaveImageToFile(process->GetOutputIBLDiffuseCubemap(), "ibldiffusecubemap", 100); - SaveImageToFile(process->GetOutputAlphaImage(), "alpha", 1); + SaveImageToFile(process->GetOutputImage(), "rgb", 10); + SaveImageToFile(process->GetOutputAlphaImage(), "alpha", 10); + process->GetAppendOutputProducts(outProducts); delete process; } } - //test image conversion for builder - TEST_F(ImageProcessingTest, TestBuilderImageConvertor) + TEST_F(ImageProcessingTest, TestIblSkyboxPreset) { //load builder presets auto outcome = BuilderSettingManager::Instance()->LoadConfigFromFolder(m_defaultSettingFolder); ASSERT_TRUE(outcome.IsSuccess()); - const AZStd::string outputFolder = m_gemFolder + AZStd::string("Code/Tests/TestAssets/temp/"); AZStd::string inputFile; AZStd::vector outProducts; - inputFile = m_imagFileNameMap[Image_128x128_Transparent_Tga]; - ImageConvertProcess* process = CreateImageConvertProcess(inputFile, outputFolder, "pc", outProducts, m_context.get()); + inputFile = m_imagFileNameMap[Image_workshop_iblskyboxcm_exr]; + ImageConvertProcess* process = CreateImageConvertProcess(inputFile, m_outputFolder, "pc", outProducts, m_context.get()); if (process != nullptr) { - //the process can be stopped if the job is canceled or the worker is shutting down - int step = 0; - while (!process->IsFinished()) - { - process->UpdateProcess(); - step++; - } + process->ProcessAll(); //get process result ASSERT_TRUE(process->IsSucceed()); - SaveImageToFile(process->GetOutputImage(), "rgb", 10); - SaveImageToFile(process->GetOutputAlphaImage(), "alpha", 10); + auto specularImage = process->GetOutputIBLSpecularCubemap(); + auto diffuseImage = process->GetOutputIBLDiffuseCubemap(); + ASSERT_TRUE(process->GetOutputImage()); + ASSERT_TRUE(specularImage); + ASSERT_TRUE(diffuseImage); - process->GetAppendOutputProducts(outProducts); + // output converted result if save image is enabled + SaveImageToFile(process->GetOutputImage(), "ibl_skybox", 10); + SaveImageToFile(specularImage, "ibl_specular", 10); + SaveImageToFile(diffuseImage, "ibl_diffuse", 10); delete process; } } - - //test image loading function for output dds files - TEST_F(ImageProcessingTest, DISABLED_TestLoadDdsImage) - { - IImageObjectPtr originImage, alphaImage; - AZStd::string inputFolder = "../AutomatedTesting/Cache/pc/engineassets/texturemsg/"; - AZStd::string inputFile; - - inputFile = "E:/Javelin_NWLYDev/dev/Cache/Assets/pc/assets/textures/blend_maps/moss/jav_moss_ddn.dds"; - - IImageObjectPtr newImage = IImageObjectPtr(DdsLoader::LoadImageFromFileLegacy(inputFile)); - if (newImage->HasImageFlags(EIF_AttachedAlpha)) - { - if (newImage->HasImageFlags(EIF_Splitted)) - { - alphaImage = IImageObjectPtr(DdsLoader::LoadImageFromFileLegacy(inputFile + ".a")); - } - else - { - alphaImage = IImageObjectPtr(DdsLoader::LoadAttachedImageFromDdsFileLegacy(inputFile, newImage)); - } - } - - SaveImageToFile(newImage, "jav_moss_ddn", 10); - } - TEST_F(ImageProcessingTest, DISABLED_CompareOutputImage) { AZStd::string curretTextureFolder = "../TestAssets/TextureAssets/assets_new/textures"; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/.gitignore b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/.gitignore new file mode 100644 index 0000000000..de16d18e9c --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/.gitignore @@ -0,0 +1 @@ +[Tt]emp/** diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/BlackWhite.png b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/BlackWhite.png deleted file mode 100644 index dfe856790a..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/BlackWhite.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:969c6597a6346c5ff8ae24b4ae143bacbeed2944dd139ddef9b440483dbe4c02 -size 8866921 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/LatLong_cm.png b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/LatLong_cm.png deleted file mode 100644 index 729868e8c0..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/LatLong_cm.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef6c54d5fa8dd3906d07eb4d3a4d664e82d957103e4bfbcaa951e3722348300d -size 749794 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/Lenstexture_dirtyglass.tif b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/Lenstexture_dirtyglass.tif deleted file mode 100644 index 090991ec7a..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/Lenstexture_dirtyglass.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:265ae231486dc6d5d61aa2416b0010ea743722f7238660faeed9edacd46e8a6b -size 6303186 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/abandoned_sanatorium_staircase_cm.exr b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/abandoned_sanatorium_staircase_cm.exr deleted file mode 100644 index f4612e45dc..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/abandoned_sanatorium_staircase_cm.exr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a559d4b21606d663bc9c7f9d8086646770f5e383c2214e6d3be0b192abbc6888 -size 7736382 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/red.png b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/red.png deleted file mode 100644 index 800faddee4..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/red.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37d146db3de179add861ee86d2316ef1dd413cdb0b02448b3b95bf0023f44bae -size 613 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/road_in_tenerife_mountain_cm.exr b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/road_in_tenerife_mountain_cm.exr deleted file mode 100644 index 358f4a3fcb..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/road_in_tenerife_mountain_cm.exr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95ec8e752ba10edb8242a9bb8cc78e5b85fe2861268cf95e06942e2a10ef243c -size 7484335 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/sunset_cm.exr b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/sunset_cm.exr deleted file mode 100644 index d1179b96de..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/sunset_cm.exr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da49114be7305fad10121f92cdf6f153ebb3bc302edc662f2ed75cd45306ab7f -size 50364729 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/temp/128x128_RGBA8.tga.streamingimage b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/temp/128x128_RGBA8.tga.streamingimage deleted file mode 100644 index 6826f2a76e..0000000000 Binary files a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/temp/128x128_RGBA8.tga.streamingimage and /dev/null differ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/workshop_iblskyboxcm.exr b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/workshop_iblskyboxcm.exr new file mode 100644 index 0000000000..72937bd6d0 --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/workshop_iblskyboxcm.exr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:010165af78bdafe61dad187b250598fa670325428271f5bcf9bd4d839f4cc1c0 +size 20114684 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake index e8bc033f08..55ccdf1d89 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake @@ -129,6 +129,8 @@ set(FILES Source/Compressors/CryTextureSquisher/ColorBlockRGBA4x4s.h Source/Compressors/CryTextureSquisher/ColorBlockRGBA4x4c.h Source/Compressors/CryTextureSquisher/ColorTypes.h + Source/Compressors/ISPCTextureCompressor.cpp + Source/Compressors/ISPCTextureCompressor.h Source/Thumbnail/ImageThumbnail.cpp Source/Thumbnail/ImageThumbnail.h Source/Thumbnail/ImageThumbnailSystemComponent.cpp diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 7df364121b..ba63ef5d64 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -9,7 +9,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) @@ -45,5 +44,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-li ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-linux TARGETS SPIRVCross PACKAGE_HASH 7889ee5460a688e9b910c0168b31445c0079d363affa07b25d4c8aeb608a0b80) ly_associate_package(PACKAGE_NAME azslc-1.7.23-rev2-linux TARGETS azslc PACKAGE_HASH 1ba84d8321a566d35a1e9aa7400211ba8e6d1c11c08e4be3c93e6e74b8f7aef1) ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-linux TARGETS zlib PACKAGE_HASH 6418e93b9f4e6188f3b62cbd3a7822e1c4398a716e786d1522b809a727d08ba9) +ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-linux TARGETS squish-ccr PACKAGE_HASH 85fecafbddc6a41a27c5f59ed4a5dfb123a94cb4666782cf26e63c0a4724c530) +ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-linux TARGETS ISPCTexComp PACKAGE_HASH 065fd12abe4247dde247330313763cf816c3375c221da030bdec35024947f259) diff --git a/cmake/3rdParty/Platform/Linux/squish-ccr_linux.cmake b/cmake/3rdParty/Platform/Linux/squish-ccr_linux.cmake deleted file mode 100644 index 80a0776765..0000000000 --- a/cmake/3rdParty/Platform/Linux/squish-ccr_linux.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Linux/Release/libsquish-ccr.a) \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 353956a495..be89612c1b 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -9,7 +9,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) @@ -43,3 +42,6 @@ ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-mac ly_associate_package(PACKAGE_NAME qt-5.15.2-rev5-mac TARGETS Qt PACKAGE_HASH 9d25918351898b308ded3e9e571fff6f26311b2071aeafd00dd5b249fdf53f7e) ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-mac TARGETS libsamplerate PACKAGE_HASH b912af40c0ac197af9c43d85004395ba92a6a859a24b7eacd920fed5854a97fe) ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-mac TARGETS zlib PACKAGE_HASH 7fd8a77b3598423d9d6be5f8c60d52aecf346ab4224f563a5282db283aa0da02) +ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-mac TARGETS squish-ccr PACKAGE_HASH 155bfbfa17c19a9cd2ef025de14c5db598f4290045d5b0d83ab58cb345089a77) +ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-mac TARGETS ISPCTexComp PACKAGE_HASH 8a4e93277b8face6ea2fd57c6d017bdb55643ed3d6387110bc5f6b3b884dd169) + diff --git a/cmake/3rdParty/Platform/Mac/squish-ccr_mac.cmake b/cmake/3rdParty/Platform/Mac/squish-ccr_mac.cmake deleted file mode 100644 index 740e630570..0000000000 --- a/cmake/3rdParty/Platform/Mac/squish-ccr_mac.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Mac/Release/libsquish-ccr.a) \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 2aded62bcd..2655b7247f 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -9,7 +9,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) @@ -51,3 +50,5 @@ ly_associate_package(PACKAGE_NAME civetweb-1.8-rev1-windows ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-windows TARGETS OpenSSL PACKAGE_HASH 9af1c50343f89146b4053101a7aeb20513319a3fe2f007e356d7ce25f9241040) ly_associate_package(PACKAGE_NAME Crashpad-0.8.0-rev1-windows TARGETS Crashpad PACKAGE_HASH d162aa3070147bc0130a44caab02c5fe58606910252caf7f90472bd48d4e31e2) ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-windows TARGETS zlib PACKAGE_HASH 6fb46a0ef8c8614cde3517b50fca47f2a6d1fd059b21f3b8ff13e635ca7f2fa6) +ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-windows TARGETS squish-ccr PACKAGE_HASH 5c3d9fa491e488ccaf802304ad23b932268a2b2846e383f088779962af2bfa84) +ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-windows TARGETS ISPCTexComp PACKAGE_HASH b6fa6ea28a2808a9a5524c72c37789c525925e435770f2d94eb2d387360fa2d0) diff --git a/cmake/3rdParty/Platform/Windows/squish-ccr_windows.cmake b/cmake/3rdParty/Platform/Windows/squish-ccr_windows.cmake deleted file mode 100644 index fb94cb6969..0000000000 --- a/cmake/3rdParty/Platform/Windows/squish-ccr_windows.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Windows/Release/squish-ccr.lib) \ No newline at end of file