Przeglądaj źródła

Merge remote-tracking branch 'upstream/stabilization/2106' into cgalvan/gitflow_210708_atomsampleviewer

Signed-off-by: Chris Galvan <[email protected]>
Chris Galvan 4 lat temu
rodzic
commit
d19f3f5223

+ 1 - 1
Gem/Code/Source/AreaLightExampleComponent.cpp

@@ -815,7 +815,7 @@ namespace AtomSampleViewer
             case Quad:
             {
                 AZ::Transform transform = AZ::Transform::CreateIdentity();
-                transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], m_config.m_rotations[2])));
+                transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], -m_config.m_rotations[2])));
                 transform.SetTranslation(lightPos);
                 transform *= AZ::Transform::CreateFromQuaternion(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(AZ::Constants::Pi * 0.5f, 0.0f, 0.0f)));
                 m_auxGeom->DrawQuad(m_config.m_quadSize[0], m_config.m_quadSize[1], AZ::Matrix3x4::CreateFromTransform(transform), nitsColor, drawStyle);

+ 21 - 4
Gem/Code/Source/Automation/ScriptManager.cpp

@@ -1164,9 +1164,9 @@ namespace AtomSampleViewer
 
     void ScriptManager::Script_CapturePassAttachment(AZ::ScriptDataContext& dc)
     {
-        if (dc.GetNumArguments() != 3)
+        if (dc.GetNumArguments() != 3 && dc.GetNumArguments() != 4)
         {
-            ReportScriptError("CapturePassAttachment needs three arguments");
+            ReportScriptError("CapturePassAttachment needs three or four arguments");
             return;
         }
 
@@ -1182,6 +1182,12 @@ namespace AtomSampleViewer
             return;
         }
 
+        if (dc.GetNumArguments() == 4 && !dc.IsString(3))
+        {
+            ReportScriptError("CapturePassAttachment's forth argument must be a string 'Input' or 'Output'");
+            return;
+        }
+
         const char* stringValue = nullptr;
 
         AZStd::vector<AZStd::string> passHierarchy;
@@ -1194,6 +1200,17 @@ namespace AtomSampleViewer
         dc.ReadArg(2, stringValue);
         outputFilePath = AZStd::string(stringValue);
 
+        AZ::RPI::PassAttachmentReadbackOption readbackOption = AZ::RPI::PassAttachmentReadbackOption::Output;
+        if (dc.GetNumArguments() == 4)
+        {
+            AZStd::string option;
+            dc.ReadArg(3, option);
+            if (option == "Input")
+            {
+                readbackOption = AZ::RPI::PassAttachmentReadbackOption::Input;
+            }
+        }
+
         // read pass hierarchy
         AZ::ScriptDataContext stringtable;
         dc.InspectTable(0, stringtable);
@@ -1220,12 +1237,12 @@ namespace AtomSampleViewer
             }
         }
 
-        auto operation = [passHierarchy, slot, outputFilePath]()
+        auto operation = [passHierarchy, slot, outputFilePath, readbackOption]()
         {
             // Note this will pause the script until the capture is complete
             if (PrepareForScreenCapture(outputFilePath))
             {
-                AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath);
+                AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption);
             }
         };
 

+ 2 - 1
Gem/Code/Source/TonemappingExampleComponent.cpp

@@ -316,7 +316,8 @@ namespace AtomSampleViewer
     {
         AZStd::string filePath = m_imguiFrameCaptureSaver.GetSaveFilePath();
         AZStd::string slot = "Output";
-        AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath);
+        AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath,
+            AZ::RPI::PassAttachmentReadbackOption::Output);
     }
 
     RPI::ColorSpaceId TonemappingExampleComponent::GetColorSpaceIdForIndex(uint8_t colorSpaceIndex) const

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ac464f29ef56ece9a0c949437240a58e9995d07e363806fc6e81af7eb1ebadbd
-size 33823
+oid sha256:994b7fcf71cca98290441401f43522cb29c381d65702ac8509e298ae3ac4a4d1
+size 32479

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c509bdc0bbada54db4df598a8910481f8effb21a3dd97afa26aba38e43129ac9
-size 17038
+oid sha256:afaea6525026e6675dbac2cfd392b46d5c49e793eb8a46de7394b2f086b08a3c
+size 26667

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_approx_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:fa6600f5591d81a7d5ae4f8f60060c3522cec32d08df4bd57d04207ac046f481
-size 22333
+oid sha256:6e8024dc7d3702ae4ab3c4ae5ff0b2382ef79789ae716c6ea68c4c2bd847c639
+size 33102

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:30476cd28e92da1807ea5293cd02f7862e683210e0313c5109f258b1f51138d7
-size 40583
+oid sha256:512fef3561863ba1e62bd3cadcea8a70996eb194530483c564979125bac3349e
+size 40436

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:34f37e668238066c98a58d593596527e2c2dd07554630245bdd1bd5b9fa949d6
-size 24119
+oid sha256:9fd3c5d3ca7145698d4ff8b750ecf909f7dfe76ab2d1b369c63e7303e65493c3
+size 35240

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_approx_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b01239967fb2238c9699d2e5bd85bd617ddbc9d9bdd6c5597083cb06faf705a0
-size 43015
+oid sha256:5f7a586cd5886cfb8a20f976865792257554c708b8146712e7e9f13a57ad97e0
+size 42886

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:32cd6cadf769f9ff807b46df673b2d85ec6b3ad4b05b050a0efee1d70456669b
-size 33097
+oid sha256:374f70f2ea84466e8c6e30ff99bb9e4309211f9e1789dd90fed4d10a8aed3124
+size 44139

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b5d7984fb15edd2068aeacc62f8bf9cb43d53241cb99cb7fdfcb67cf2688a2a8
-size 27833
+oid sha256:d8bed9219855223755d203c861fa656ce6d3c9bb6c3849f542e777dcdaeeb161
+size 38163

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_double_sided_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c8f9c901d676b8b3eda665ebbc7d071c6354de7db2c0bf51f490d166b448a3c8
-size 32751
+oid sha256:d1d3c3ce1be26bdab9f6cc3121dea7420ae9b394a0a44d66af306c0dfd722c87
+size 42997

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5e0755c8d7f6ef3555e141729c95b4da38349c46059b2907dd3271665cbf48d1
-size 24243
+oid sha256:f48b4157a0ffef8551c392c1cd3d26b391f0d0d7b9e9f07f992acb26d6dbf569
+size 34895

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_metal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ba16209ad6108b065ab5489066fed446a55e8513acabcb45062f1ea1a489cc05
-size 19188
+oid sha256:1c883fd3f2c539b05d3e4133b6a4eed802510cb7d31194fb7507a6aee86f99aa
+size 28806

+ 2 - 2
Scripts/ExpectedScreenshots/AreaLights/quad_vary_rough_nonmetal.png

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:20e059806e6c8371f4732c6795586fba711581e982cc54f3da65bdef00acd8cc
-size 22167
+oid sha256:cd61f117a479e349990317815c7a58547cf7966991c2e3a08951815101ae5bb8
+size 32943