Kaynağa Gözat

Doc & formatting tweaks + ImageBuilderComponent version bump

In response to reviewer feedback for PR #7687

Signed-off-by: Roald Frederickx <[email protected]>
Roald Frederickx 3 yıl önce
ebeveyn
işleme
b6e3a07b9d

+ 1 - 1
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp

@@ -74,7 +74,7 @@ namespace ImageProcessingAtom
         builderDescriptor.m_busId = azrtti_typeid<ImageBuilderWorker>();
         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 = 27;   // [ATOM-16958]
+        builderDescriptor.m_version = 28; // Added averageColor field
         builderDescriptor.m_analysisFingerprint = ImageProcessingAtom::BuilderSettingManager::Instance()->GetAnalysisFingerprint();
         m_imageBuilder.BusConnect(builderDescriptor.m_busId);
         AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBusTraits::RegisterBuilderInformation, builderDescriptor);

+ 3 - 3
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp

@@ -534,17 +534,17 @@ namespace ImageProcessingAtom
     // Set (alpha-weighted) average color computed from given mip
     bool ImageConvertProcess::SetAverageColor(AZ::u32 mip)
     {
-        // This function only works with pixel format rgba32f
+        // We only work with pixel format rgba32f
         const EPixelFormat srcPixelFormat = m_image->Get()->GetPixelFormat();
         if (srcPixelFormat != ePixelFormat_R32G32B32A32F)
         {
-            AZ_Assert(false, "%s only works with pixel format rgba32f", __FUNCTION__);
+            AZ_Assert(false, "I only work with pixel format rgba32f");
             return false;
         }
         // ...and we require a linear (non-sRGB) color space
         if (m_image->Get()->HasImageFlags(EIF_SRGBRead))
         {
-            AZ_Assert(false, "%s only works with a linear (non-sRGB) color space", __FUNCTION__);
+            AZ_Assert(false, "I only work with a linear (non-sRGB) color space");
             return false;
         }
 

+ 1 - 1
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageObjectImpl.h

@@ -152,7 +152,7 @@ namespace ImageProcessingAtom
 
         AZ::Color         m_colMinARGB;             // ARGB will be added the properties of the DDS file
         AZ::Color         m_colMaxARGB;             // ARGB will be added the properties of the DDS file
-        AZ::Color         m_averageColor;           // Gets computed in ImageConvert together with the MIPs
+        AZ::Color         m_averageColor;
         float        m_averageBrightness;           // will be added to the properties of the DDS file
         AZ::u32       m_imageFlags;                  //
         AZ::u32       m_numPersistentMips;           // number of mipmaps won't be splitted

+ 6 - 5
Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp

@@ -1022,14 +1022,15 @@ namespace AZ
             rayTracingFeatureProcessor->SetMesh(m_objectId, m_model->GetModelAsset()->GetId(), subMeshes);
         }
 
-        void ModelDataInstance::SetIrradianceData(RayTracingFeatureProcessor::SubMesh& subMesh,
-                const Data::Instance<RPI::Material> material, const Data::Instance<RPI::Image> baseColorImage)
+        void ModelDataInstance::SetIrradianceData(
+            RayTracingFeatureProcessor::SubMesh& subMesh,
+            const Data::Instance<RPI::Material> material,
+            const Data::Instance<RPI::Image> baseColorImage)
         {
             RPI::MaterialPropertyIndex propertyIndex;
 
-            // Default to manual color, so we work properly with legacy materials that don't contain
-            // the irradianceColorSource enum, but have their old irradiance.color transformed to
-            // irradiance.manualColor through the 'versionUpdates' rules:
+            // Default to manual color, in case the material type doesn't have the concept of
+            // manual vs. automatic irradiance color.
             AZ::Name irradianceColorSource = AZ::Name("Manual");
             propertyIndex = material->FindPropertyIndex(AZ::Name("irradiance.irradianceColorSource"));
             if (propertyIndex.IsValid())

+ 1 - 1
Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp

@@ -30,7 +30,7 @@ namespace AZ
                     ;
 
                 serializeContext->Class<StreamingImageAsset, ImageAsset>()
-                    ->Version(2)
+                    ->Version(2) // Added m_averageColor field
                     ->Field("m_mipLevelToChainIndex", &StreamingImageAsset::m_mipLevelToChainIndex)
                     ->Field("m_mipChains", &StreamingImageAsset::m_mipChains)
                     ->Field("m_flags", &StreamingImageAsset::m_flags)