Skip to content

Commit 587b66c

Browse files
authored
Merge pull request #167 from aws-lumberyard-dev/cgalvan/gitflow_210712_main
Merged stabilization/2106 to main
2 parents 3a0c02c + 85552dc commit 587b66c

20 files changed

+76
-61
lines changed

Gem/Code/Source/AreaLightExampleComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ namespace AtomSampleViewer
815815
case Quad:
816816
{
817817
AZ::Transform transform = AZ::Transform::CreateIdentity();
818-
transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], m_config.m_rotations[2])));
818+
transform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(m_config.m_rotations[0], -m_config.m_rotations[1], -m_config.m_rotations[2])));
819819
transform.SetTranslation(lightPos);
820820
transform *= AZ::Transform::CreateFromQuaternion(AZ::ConvertEulerRadiansToQuaternion(AZ::Vector3(AZ::Constants::Pi * 0.5f, 0.0f, 0.0f)));
821821
m_auxGeom->DrawQuad(m_config.m_quadSize[0], m_config.m_quadSize[1], AZ::Matrix3x4::CreateFromTransform(transform), nitsColor, drawStyle);

Gem/Code/Source/Automation/ScriptManager.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,9 +1163,9 @@ namespace AtomSampleViewer
11631163

11641164
void ScriptManager::Script_CapturePassAttachment(AZ::ScriptDataContext& dc)
11651165
{
1166-
if (dc.GetNumArguments() != 3)
1166+
if (dc.GetNumArguments() != 3 && dc.GetNumArguments() != 4)
11671167
{
1168-
ReportScriptError("CapturePassAttachment needs three arguments");
1168+
ReportScriptError("CapturePassAttachment needs three or four arguments");
11691169
return;
11701170
}
11711171

@@ -1181,6 +1181,12 @@ namespace AtomSampleViewer
11811181
return;
11821182
}
11831183

1184+
if (dc.GetNumArguments() == 4 && !dc.IsString(3))
1185+
{
1186+
ReportScriptError("CapturePassAttachment's forth argument must be a string 'Input' or 'Output'");
1187+
return;
1188+
}
1189+
11841190
const char* stringValue = nullptr;
11851191

11861192
AZStd::vector<AZStd::string> passHierarchy;
@@ -1193,6 +1199,17 @@ namespace AtomSampleViewer
11931199
dc.ReadArg(2, stringValue);
11941200
outputFilePath = AZStd::string(stringValue);
11951201

1202+
AZ::RPI::PassAttachmentReadbackOption readbackOption = AZ::RPI::PassAttachmentReadbackOption::Output;
1203+
if (dc.GetNumArguments() == 4)
1204+
{
1205+
AZStd::string option;
1206+
dc.ReadArg(3, option);
1207+
if (option == "Input")
1208+
{
1209+
readbackOption = AZ::RPI::PassAttachmentReadbackOption::Input;
1210+
}
1211+
}
1212+
11961213
// read pass hierarchy
11971214
AZ::ScriptDataContext stringtable;
11981215
dc.InspectTable(0, stringtable);
@@ -1219,12 +1236,12 @@ namespace AtomSampleViewer
12191236
}
12201237
}
12211238

1222-
auto operation = [passHierarchy, slot, outputFilePath]()
1239+
auto operation = [passHierarchy, slot, outputFilePath, readbackOption]()
12231240
{
12241241
// Note this will pause the script until the capture is complete
12251242
if (PrepareForScreenCapture(outputFilePath))
12261243
{
1227-
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath);
1244+
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption);
12281245
}
12291246
};
12301247

Gem/Code/Source/TonemappingExampleComponent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ namespace AtomSampleViewer
315315
{
316316
AZStd::string filePath = m_imguiFrameCaptureSaver.GetSaveFilePath();
317317
AZStd::string slot = "Output";
318-
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath);
318+
AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, m_capturePassHierarchy, slot, filePath,
319+
AZ::RPI::PassAttachmentReadbackOption::Output);
319320
}
320321

321322
RPI::ColorSpaceId TonemappingExampleComponent::GetColorSpaceIdForIndex(uint8_t colorSpaceIndex) const
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)