From b039c41162c32d9f7cc40007d17059294bbf96c9 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 11 Apr 2022 13:01:00 -0700 Subject: [PATCH 01/81] removing WARP suite Signed-off-by: Scott Murray --- .../CopyQueue/screenshot_warp_CopyQueue.png | 3 - .../screenshot_warp_DualSourceBlending.png | 3 - .../screenshot_warp_InputAssembly.png | 3 - .../MSAA/screenshot_warp_MSAA.png | 3 - .../screenshot_warp_MultiRenderTarget.png | 3 - .../screenshot_warp_MultiThread.png | 3 - .../Stencil/screenshot_warp_Stencil.png | 3 - .../Texture/screenshot_warp_Texture.png | 3 - .../Texture3d/screenshot_warp_Texture3d.png | 3 - .../TextureMap/screenshot_warp_TextureMap.png | 3 - Scripts/_AutomatedReviewWARPTestSuite_.bv.lua | 44 ------------ .../test_AtomSampleViewer_warp_suite.py | 68 ------------------- Standalone/PythonTests/CMakeLists.txt | 14 ---- 13 files changed, 156 deletions(-) delete mode 100644 Scripts/ExpectedScreenshots/CopyQueue/screenshot_warp_CopyQueue.png delete mode 100644 Scripts/ExpectedScreenshots/DualSourceBlending/screenshot_warp_DualSourceBlending.png delete mode 100644 Scripts/ExpectedScreenshots/InputAssembly/screenshot_warp_InputAssembly.png delete mode 100644 Scripts/ExpectedScreenshots/MSAA/screenshot_warp_MSAA.png delete mode 100644 Scripts/ExpectedScreenshots/MultiRenderTarget/screenshot_warp_MultiRenderTarget.png delete mode 100644 Scripts/ExpectedScreenshots/MultiThread/screenshot_warp_MultiThread.png delete mode 100644 Scripts/ExpectedScreenshots/Stencil/screenshot_warp_Stencil.png delete mode 100644 Scripts/ExpectedScreenshots/Texture/screenshot_warp_Texture.png delete mode 100644 Scripts/ExpectedScreenshots/Texture3d/screenshot_warp_Texture3d.png delete mode 100644 Scripts/ExpectedScreenshots/TextureMap/screenshot_warp_TextureMap.png delete mode 100644 Scripts/_AutomatedReviewWARPTestSuite_.bv.lua delete mode 100644 Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py diff --git a/Scripts/ExpectedScreenshots/CopyQueue/screenshot_warp_CopyQueue.png b/Scripts/ExpectedScreenshots/CopyQueue/screenshot_warp_CopyQueue.png deleted file mode 100644 index 8cc0fdf1..00000000 --- a/Scripts/ExpectedScreenshots/CopyQueue/screenshot_warp_CopyQueue.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a3a4c8e8a4c75255c1dfd3883bababc4c66a937a969875654d48bf7c24965ef6 -size 153992 diff --git a/Scripts/ExpectedScreenshots/DualSourceBlending/screenshot_warp_DualSourceBlending.png b/Scripts/ExpectedScreenshots/DualSourceBlending/screenshot_warp_DualSourceBlending.png deleted file mode 100644 index 3e5b0ee0..00000000 --- a/Scripts/ExpectedScreenshots/DualSourceBlending/screenshot_warp_DualSourceBlending.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ee638681b2e241b9095f609bcbbb4421b687e9f47ab086ed4de4336e7383510c -size 57777 diff --git a/Scripts/ExpectedScreenshots/InputAssembly/screenshot_warp_InputAssembly.png b/Scripts/ExpectedScreenshots/InputAssembly/screenshot_warp_InputAssembly.png deleted file mode 100644 index 0df1f111..00000000 --- a/Scripts/ExpectedScreenshots/InputAssembly/screenshot_warp_InputAssembly.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5989f6696b89b6002109d1592eaa5ee662be67fa5f7ceea09dae8e072a6c53b3 -size 14303 diff --git a/Scripts/ExpectedScreenshots/MSAA/screenshot_warp_MSAA.png b/Scripts/ExpectedScreenshots/MSAA/screenshot_warp_MSAA.png deleted file mode 100644 index 4f3ce12a..00000000 --- a/Scripts/ExpectedScreenshots/MSAA/screenshot_warp_MSAA.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15fd8aacf9bf996a9806993db18660598cac96bbc998c9c9ec93e05f2cab10b0 -size 69762 diff --git a/Scripts/ExpectedScreenshots/MultiRenderTarget/screenshot_warp_MultiRenderTarget.png b/Scripts/ExpectedScreenshots/MultiRenderTarget/screenshot_warp_MultiRenderTarget.png deleted file mode 100644 index 0cccb645..00000000 --- a/Scripts/ExpectedScreenshots/MultiRenderTarget/screenshot_warp_MultiRenderTarget.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da4b7f9929d0a18fbb377e38ee6fef1b1cefe3d6fdb37a5b7abee5157aeb0b4a -size 12903 diff --git a/Scripts/ExpectedScreenshots/MultiThread/screenshot_warp_MultiThread.png b/Scripts/ExpectedScreenshots/MultiThread/screenshot_warp_MultiThread.png deleted file mode 100644 index b643555b..00000000 --- a/Scripts/ExpectedScreenshots/MultiThread/screenshot_warp_MultiThread.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6f176ea11df0ec1a4ac6cb77185495cab0c4d52b1ae0fb428d44f0e7a38c93d7 -size 20462 diff --git a/Scripts/ExpectedScreenshots/Stencil/screenshot_warp_Stencil.png b/Scripts/ExpectedScreenshots/Stencil/screenshot_warp_Stencil.png deleted file mode 100644 index 5af12687..00000000 --- a/Scripts/ExpectedScreenshots/Stencil/screenshot_warp_Stencil.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8021146b3426e89d3dc0df5f1bb2342122e0685b8940d56cdabec24deef0192 -size 23976 diff --git a/Scripts/ExpectedScreenshots/Texture/screenshot_warp_Texture.png b/Scripts/ExpectedScreenshots/Texture/screenshot_warp_Texture.png deleted file mode 100644 index 323a89fb..00000000 --- a/Scripts/ExpectedScreenshots/Texture/screenshot_warp_Texture.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5c8bf66d9950c4a41bee22acd2b3032424364e95d719353a8fe9fe391a2763fe -size 332746 diff --git a/Scripts/ExpectedScreenshots/Texture3d/screenshot_warp_Texture3d.png b/Scripts/ExpectedScreenshots/Texture3d/screenshot_warp_Texture3d.png deleted file mode 100644 index dda77d34..00000000 --- a/Scripts/ExpectedScreenshots/Texture3d/screenshot_warp_Texture3d.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b8af351afcf2dd632bbdae6286b9dd83fb20fd41199125c0999469d8a481269 -size 203335 diff --git a/Scripts/ExpectedScreenshots/TextureMap/screenshot_warp_TextureMap.png b/Scripts/ExpectedScreenshots/TextureMap/screenshot_warp_TextureMap.png deleted file mode 100644 index 2c9e8aa1..00000000 --- a/Scripts/ExpectedScreenshots/TextureMap/screenshot_warp_TextureMap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:71f66003a2079ffa56548c8ad63f44be9375790e2ce5093a53cb347c564b2465 -size 14519 diff --git a/Scripts/_AutomatedReviewWARPTestSuite_.bv.lua b/Scripts/_AutomatedReviewWARPTestSuite_.bv.lua deleted file mode 100644 index 5711b317..00000000 --- a/Scripts/_AutomatedReviewWARPTestSuite_.bv.lua +++ /dev/null @@ -1,44 +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 --- --- --- ----------------------------------------------------------------------------------------------------- - --- Test suite "Main" tests for the automated review process using WARP software rasterizer. --- These tests do not require GPU nodes. They will run only on AtomSampleViewer repository. --- They are intended to run simply with the most basic RHI tests focused on deterministic outcomes --- screen compares expect to be run under WARP use either dxcpl to force WARP or command line --- argument: -forceAdapter="Microsoft Basic Render Driver" - --- We need to lock the frame time to get deterministic timing of the screenshots for consistency between runs -LockFrameTime(1/10) - -function SimpleScreenshotTest(sample, threshold) - local sampleSplit = {} - for str in string.gmatch(sample, "([^/]+)") do - table.insert(sampleSplit, str) - end - g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. sampleSplit[#sampleSplit] .. '/') - Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) - OpenSample(sample) - ResizeViewport(800, 800) - SelectImageComparisonToleranceLevel(threshold) - IdleFrames(15) - CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_warp_' .. sampleSplit[#sampleSplit] .. '.png') - OpenSample(nil) -end - -SimpleScreenshotTest('RHI/CopyQueue', 'Level A') -SimpleScreenshotTest('RHI/DualSourceBlending', 'Level A') -SimpleScreenshotTest('RHI/InputAssembly', 'Level E') -SimpleScreenshotTest('RHI/MSAA', 'Level A') -SimpleScreenshotTest('RHI/MultiRenderTarget', 'Level A') -SimpleScreenshotTest('RHI/MultiThread', 'Level A') -SimpleScreenshotTest('RHI/Stencil', 'Level A') -SimpleScreenshotTest('RHI/Texture', 'Level A') -SimpleScreenshotTest('RHI/TextureMap', 'Level D') diff --git a/Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py b/Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py deleted file mode 100644 index 26dbca5e..00000000 --- a/Standalone/PythonTests/Automated/test_AtomSampleViewer_warp_suite.py +++ /dev/null @@ -1,68 +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 -""" -import logging -import os -import subprocess - -import pytest - -import ly_test_tools.environment.process_utils as process_utils -import ly_test_tools.launchers.platforms.base - -logger = logging.getLogger(__name__) - - -class AtomSampleViewerException(Exception): - """Custom Exception class for AtomSampleViewer tests.""" - pass - - -@pytest.mark.parametrize('launcher_platform', ['windows']) -@pytest.mark.parametrize("project", ["AtomSampleViewer"]) -@pytest.mark.parametrize('rhi', ['dx12']) -@pytest.mark.usefixtures("clean_atomsampleviewer_logs", "atomsampleviewer_log_monitor") -class TestAutomationWarpSuite: - - def test_AutomatedReviewWARPTestSuite(self, request, workspace, launcher_platform, rhi, project, atomsampleviewer_log_monitor): - # Script call setup. - test_script = '_AutomatedReviewWARPTestSuite_.bv.lua' - test_script_path = os.path.join(workspace.paths.project(), 'Scripts', test_script) - if not os.path.exists(test_script_path): - raise AtomSampleViewerException(f'Test script does not exist in path: {test_script_path}') - cmd = os.path.join(workspace.paths.build_directory(), - 'AtomSampleViewerStandalone.exe ' - '-forceAdapter="Microsoft Basic Render Driver" ' - f'--project-path={workspace.paths.project()} ' - f'--rhi {rhi} ' - f'--runtestsuite scripts/{test_script} ' - '--exitontestend') - - def teardown(): - process_utils.kill_processes_named(['AssetProcessor', 'AtomSampleViewerStandalone'], ignore_extensions=True) - request.addfinalizer(teardown) - - # Execute test. - process_utils.safe_check_call(cmd, stderr=subprocess.STDOUT, encoding='UTF-8', shell=True) - try: - unexpected_lines = ["Script: Screenshot check failed. Diff score", # "Diff score" ensures legit failure. - "Trace::Error", - "Trace::Assert", - "Traceback (most recent call last):"] - atomsampleviewer_log_monitor.monitor_log_for_lines( - unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=50) - except ly_test_tools.log.log_monitor.LogMonitorException as e: - expected_screenshots_path = os.path.join( - workspace.paths.project(), "Scripts", "ExpectedScreenshots") - test_screenshots_path = os.path.join( - workspace.paths.project(), "user", "Scripts", "Screenshots") - raise AtomSampleViewerException( - f"Got error: {e}\n" - f"Screenshot comparison check failed using Render Hardware Interface (RHI): '{rhi}'\n" - "Please review logs and screenshots at:\n" - f"Log file: {atomsampleviewer_log_monitor.file_to_monitor}\n" - f"Expected screenshots: {expected_screenshots_path}\n" - f"Test screenshots: {test_screenshots_path}\n") diff --git a/Standalone/PythonTests/CMakeLists.txt b/Standalone/PythonTests/CMakeLists.txt index 49b61673..cafa73d9 100644 --- a/Standalone/PythonTests/CMakeLists.txt +++ b/Standalone/PythonTests/CMakeLists.txt @@ -25,20 +25,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED) AtomSampleViewer.GameLauncher AtomSampleViewer.Assets ) - ly_add_pytest( - NAME AtomSampleViewer::PythonWARPTests - PATH ${CMAKE_CURRENT_LIST_DIR}/Automated/test_AtomSampleViewer_warp_suite.py - TEST_REQUIRES gpu - TEST_SUITE main - TEST_SERIAL - TIMEOUT 300 - RUNTIME_DEPENDENCIES - AssetProcessor - AssetProcessorBatch - AtomSampleViewerStandalone - AtomSampleViewer.GameLauncher - AtomSampleViewer.Assets - ) ly_add_pytest( NAME AtomSampleViewer::PeriodicPerformanceBenchmarks PATH ${CMAKE_CURRENT_LIST_DIR}/Automated/benchmark_runner_periodic_suite.py From 5f44742d68bc4f8189de30265568ddc755cf06f5 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:06:08 -0700 Subject: [PATCH 02/81] Update screenshot after fix Hermanubis_thickness's image building preset (#412) Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../ExpectedScreenshots/StandardPBR/102_detailmaps_all.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png b/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png index d58060c8..550b373f 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab386cc18beb113ae945a5aa7b206401cb6f41cc40830a7a167f81cbf687b427 -size 2024844 +oid sha256:0634b525cf9652c4f5efc13851eefd002620156dfbcb26476f98370dcaff0596 +size 2149598 From 5670a37908b45e250360c02588d3b2c1b4668226 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 12 Apr 2022 10:27:02 -0700 Subject: [PATCH 03/81] fix reference to removed warp lua script Signed-off-by: Scott Murray --- atomsampleviewer_asset_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/atomsampleviewer_asset_files.cmake b/atomsampleviewer_asset_files.cmake index 814408ac..a7ff7f18 100644 --- a/atomsampleviewer_asset_files.cmake +++ b/atomsampleviewer_asset_files.cmake @@ -45,7 +45,6 @@ set(FILES Scripts/ShadowTest.bv.lua Scripts/StreamingImageTest.bv.lua Scripts/TransparentTest.bv.lua - Scripts/_AutomatedReviewWARPTestSuite_.bv.lua Scripts/_FullTestSuite_.bv.lua Shaders/DebugVertexNormals.azsl Shaders/DebugVertexNormals.materialtype From 1342656a0d11152544d713a511860b06cf193275 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:52:29 -0700 Subject: [PATCH 04/81] Restored old lattice size limits for AssetLoadTest and DynamicMaterialTest to avoid crashes. Testing: I was able to run AssetLoadTest, increase size to 25x25x25, exit the sample, load DynamicMaterialTest, increase size to 25x25x25, and exit, in the same session without crashing. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/AssetLoadTestComponent.cpp | 10 +++++++++ .../Source/DynamicMaterialTestComponent.cpp | 5 +++++ .../Source/EntityLatticeTestComponent.cpp | 21 +++++++++++-------- Gem/Code/Source/EntityLatticeTestComponent.h | 4 +++- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Gem/Code/Source/AssetLoadTestComponent.cpp b/Gem/Code/Source/AssetLoadTestComponent.cpp index a5c1e78e..6c13df91 100644 --- a/Gem/Code/Source/AssetLoadTestComponent.cpp +++ b/Gem/Code/Source/AssetLoadTestComponent.cpp @@ -94,6 +94,16 @@ namespace AtomSampleViewer m_modelBrowser.ResetPinnedAssetsToDefault(); } + + // 25 was the original max before some changes that increased ENTITY_LATTEST_TEST_COMPONENT_MAX to 100. + // AssetLoadTest was crashing (out of descriptors) at 50x50x42 so we put the limit back to 25^3. + // Note that limiting to 40^3 will avoid the crash, but the sample doesn't work well at that scale, the UI + // doesn't even show up because of a combination of low frame rate, the reload timers, and the time it takes + // to load the models, and the fact that the UI is hidden while the models are loading. + // So it would be good if we could work on increasing this limit. + // (It would also be good if we could improve the design of this sample to make the UI persistent and more + // responsive while the assets keep reloading). + Base::SetLatticeMaxDimension(25); Base::Activate(); } diff --git a/Gem/Code/Source/DynamicMaterialTestComponent.cpp b/Gem/Code/Source/DynamicMaterialTestComponent.cpp index 216c23b3..71267ad3 100644 --- a/Gem/Code/Source/DynamicMaterialTestComponent.cpp +++ b/Gem/Code/Source/DynamicMaterialTestComponent.cpp @@ -52,6 +52,11 @@ namespace AtomSampleViewer TickBus::Handler::BusConnect(); m_imguiSidebar.Activate(); InitMaterialConfigs(); + + // This was the original max before some changes that increased ENTITY_LATTEST_TEST_COMPONENT_MAX to 100. + // DynamicMaterialTest was crashing (out of descriptors) at 50x50x9 so we put the limit back to 25^3 until that's addressed. + Base::SetLatticeMaxDimension(25); + Base::Activate(); m_currentTime = 0.0f; diff --git a/Gem/Code/Source/EntityLatticeTestComponent.cpp b/Gem/Code/Source/EntityLatticeTestComponent.cpp index 17c2e666..ce889f1b 100644 --- a/Gem/Code/Source/EntityLatticeTestComponent.cpp +++ b/Gem/Code/Source/EntityLatticeTestComponent.cpp @@ -26,7 +26,6 @@ namespace AtomSampleViewer using namespace AZ; using namespace RPI; - constexpr int32_t s_latticeSizeMax = ENTITY_LATTEST_TEST_COMPONENT_MAX; constexpr float s_spacingMax = 100.0f; constexpr float s_spacingMin = 0.5f; constexpr float s_entityScaleMax = 10.0f; @@ -104,12 +103,17 @@ namespace AtomSampleViewer { return m_worldAabb; } + + void EntityLatticeTestComponent::SetLatticeMaxDimension(uint32_t max) + { + m_latticeSizeMax = max; + } void EntityLatticeTestComponent::SetLatticeDimensions(uint32_t width, uint32_t depth, uint32_t height) { - m_latticeWidth = AZ::GetClamp(width, 1, s_latticeSizeMax); - m_latticeHeight = AZ::GetClamp(height, 1, s_latticeSizeMax); - m_latticeDepth = AZ::GetClamp(depth, 1, s_latticeSizeMax); + m_latticeWidth = AZ::GetClamp(width, 1, m_latticeSizeMax); + m_latticeHeight = AZ::GetClamp(height, 1, m_latticeSizeMax); + m_latticeDepth = AZ::GetClamp(depth, 1, m_latticeSizeMax); } void EntityLatticeTestComponent::SetLatticeSpacing( float spaceX, float spaceY, float spaceZ) @@ -128,23 +132,23 @@ namespace AtomSampleViewer { m_defaultIbl.SetExposure(exposure); } - + void EntityLatticeTestComponent::RenderImGuiLatticeControls() { bool latticeChanged = false; ImGui::Text("Lattice Width"); - latticeChanged |= ScriptableImGui::SliderInt("##LatticeWidth", &m_latticeWidth, 1, s_latticeSizeMax); + latticeChanged |= ScriptableImGui::SliderInt("##LatticeWidth", &m_latticeWidth, 1, m_latticeSizeMax); ImGui::Spacing(); ImGui::Text("Lattice Height"); - latticeChanged |= ScriptableImGui::SliderInt("##LatticeHeight", &m_latticeHeight, 1, s_latticeSizeMax); + latticeChanged |= ScriptableImGui::SliderInt("##LatticeHeight", &m_latticeHeight, 1, m_latticeSizeMax); ImGui::Spacing(); ImGui::Text("Lattice Depth"); - latticeChanged |= ScriptableImGui::SliderInt("##LatticeDepth", &m_latticeDepth, 1, s_latticeSizeMax); + latticeChanged |= ScriptableImGui::SliderInt("##LatticeDepth", &m_latticeDepth, 1, m_latticeSizeMax); ImGui::Spacing(); ImGui::Separator(); @@ -170,7 +174,6 @@ namespace AtomSampleViewer ImGui::Text("Entity Scale"); latticeChanged |= ScriptableImGui::SliderFloat("##EntityScale", &m_entityScale, 0.01, s_entityScaleMax); - if (latticeChanged) { RebuildLattice(); diff --git a/Gem/Code/Source/EntityLatticeTestComponent.h b/Gem/Code/Source/EntityLatticeTestComponent.h index 6e84d9bf..a139bc12 100644 --- a/Gem/Code/Source/EntityLatticeTestComponent.h +++ b/Gem/Code/Source/EntityLatticeTestComponent.h @@ -45,7 +45,8 @@ namespace AtomSampleViewer //! Destroys and rebuilds the lattice. virtual void RebuildLattice(); - + + void SetLatticeMaxDimension(uint32_t max); void SetLatticeDimensions(uint32_t width, uint32_t depth, uint32_t height); void SetLatticeSpacing(float spaceX, float spaceY, float spaceZ); void SetLatticeEntityScale(float scale); @@ -78,6 +79,7 @@ namespace AtomSampleViewer int32_t m_latticeWidth = ENTITY_LATTICE_TEST_COMPONENT_WIDTH; int32_t m_latticeHeight = ENTITY_LATTICE_TEST_COMPONENT_HEIGHT; int32_t m_latticeDepth = ENTITY_LATTICE_TEST_COMPONENT_DEPTH; + int32_t m_latticeSizeMax = ENTITY_LATTEST_TEST_COMPONENT_MAX; float m_spacingX = 5.0f; float m_spacingY = 5.0f; From 595ad6ff2facebc5ea2d879ab8f762811b3d7376 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Fri, 15 Apr 2022 08:59:13 +0100 Subject: [PATCH 05/81] Add Eye material sample and test Signed-off-by: Santi Paprika --- .../Source/EyeMaterialExampleComponent.cpp | 313 ++++++++++++++++++ Gem/Code/Source/EyeMaterialExampleComponent.h | 107 ++++++ Gem/Code/Source/SampleComponentManager.cpp | 2 + .../atomsampleviewergem_private_files.cmake | 2 + Materials/Eye/001_EyeBasic.material | 20 ++ Materials/Eye/Textures/eyeIrisBW.png | 3 + Materials/Eye/Textures/eyeSclera.png | 3 + Materials/Eye/Textures/proceduralBump.png | 3 + Objects/eye.fbx | 3 + .../EyeMaterial/screenshot_eye.png | 3 + Scripts/EyeMaterialTest.bv.lua | 9 + Scripts/_FullTestSuite_.bv.lua | 1 + atomsampleviewer_asset_files.cmake | 1 + 13 files changed, 470 insertions(+) create mode 100644 Gem/Code/Source/EyeMaterialExampleComponent.cpp create mode 100644 Gem/Code/Source/EyeMaterialExampleComponent.h create mode 100644 Materials/Eye/001_EyeBasic.material create mode 100644 Materials/Eye/Textures/eyeIrisBW.png create mode 100644 Materials/Eye/Textures/eyeSclera.png create mode 100644 Materials/Eye/Textures/proceduralBump.png create mode 100644 Objects/eye.fbx create mode 100644 Scripts/ExpectedScreenshots/EyeMaterial/screenshot_eye.png create mode 100644 Scripts/EyeMaterialTest.bv.lua diff --git a/Gem/Code/Source/EyeMaterialExampleComponent.cpp b/Gem/Code/Source/EyeMaterialExampleComponent.cpp new file mode 100644 index 00000000..a1fb0cc4 --- /dev/null +++ b/Gem/Code/Source/EyeMaterialExampleComponent.cpp @@ -0,0 +1,313 @@ +/* + * 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 + * + */ + +#include + +#include +#include +#include + +#include + +#include + + +namespace AtomSampleViewer +{ + static const char* MeshPath = "objects/eye.azmodel"; + static const char* MaterialPath = "materials/eye/001_EyeBasic.azmaterial"; + static const float DefaultCameraHeading = 40.0f; + static const float DefaultCameraDistance = 2.0f; + + static const char* IrisColorName = "iris.baseColor.color"; + static const char* IrisColorFactorName = "iris.baseColor.factor"; + static const char* IrisRoughnessName = "iris.roughness.factor"; + + static const char* ScleraColorName = "sclera.baseColor.color"; + static const char* ScleraColorFactorName = "sclera.baseColor.factor"; + static const char* ScleraRoughnessName = "sclera.roughness.factor"; + static const char* ScleraNormalFactorName = "sclera.normal.factor"; + + static const char* IrisDepthName = "eye.irisDepth"; + static const char* IrisRadiusName = "eye.irisRadius"; + static const char* InnerEyeIORName = "eye.innerEyeIOR"; + static const char* LimbusSizeName = "eye.limbusSize"; + + static const char* SpecularFactorName = "specularF0.factor"; + + static const char* SSSEnableName = "subsurfaceScattering.enableSubsurfaceScattering"; + static const char* SSSColorName = "subsurfaceScattering.scatterColor"; + static const char* SSSFactorName = "subsurfaceScattering.subsurfaceScatterFactor"; + + void EyeMaterialExampleComponent::Reflect(AZ::ReflectContext* context) + { + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class()->Version(0); + } + } + + EyeMaterialExampleComponent::EyeMaterialExampleComponent() + { + } + + void EyeMaterialExampleComponent::Activate() + { + Prepare(); + + m_eyeTransform = AZ::Transform::CreateIdentity(); + LoadMesh(m_eyeTransform); + + InitializeMaterialProperties(); + + AZ::TickBus::Handler::BusConnect(); + } + + void EyeMaterialExampleComponent::Deactivate() + { + AZ::Debug::CameraControllerRequestBus::Event( + GetCameraEntityId(), + &AZ::Debug::CameraControllerRequestBus::Events::Disable); + + m_defaultIbl.Reset(); + + GetMeshFeatureProcessor()->ReleaseMesh(m_meshHandle); + + AZ::TickBus::Handler::BusDisconnect(); + } + + void EyeMaterialExampleComponent::OnTick(float deltaTime, AZ::ScriptTimePoint scriptTime) + { + AZ_UNUSED(deltaTime); + AZ_UNUSED(scriptTime); + + DrawSidebar(); + } + + void EyeMaterialExampleComponent::LoadMesh(AZ::Transform transform) + { + m_materialInstance = AZ::RPI::Material::Create(m_materialAsset); + m_meshHandle = GetMeshFeatureProcessor()->AcquireMesh(AZ::Render::MeshHandleDescriptor{ m_modelAsset }, m_materialInstance); + GetMeshFeatureProcessor()->SetTransform(m_meshHandle, transform); + } + + void EyeMaterialExampleComponent::Prepare() + { + // Camera + AZ::Debug::CameraControllerRequestBus::Event( + GetCameraEntityId(), + &AZ::Debug::CameraControllerRequestBus::Events::Enable, + azrtti_typeid()); + AZ::Debug::ArcBallControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::ArcBallControllerRequestBus::Events::SetDistance, DefaultCameraDistance); + AZ::Debug::ArcBallControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::ArcBallControllerRequestBus::Events::SetHeading, DefaultCameraHeading); + + // Lighting + m_defaultIbl.Init(m_scene); + // Model + m_modelAsset = AZ::RPI::AssetUtils::GetAssetByProductPath(MeshPath, AZ::RPI::AssetUtils::TraceLevel::Assert); + // Material + m_materialAsset = AZ::RPI::AssetUtils::GetAssetByProductPath(MaterialPath, AZ::RPI::AssetUtils::TraceLevel::Assert); + } + + + void EyeMaterialExampleComponent::InitializeMaterialProperties() + { + // Get material indices of properties + m_irisColorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(IrisColorName)); + m_irisColorFactorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(IrisColorFactorName)); + m_irisRoughnessIndex = m_materialInstance->FindPropertyIndex(AZ::Name(IrisRoughnessName)); + + m_scleraColorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(ScleraColorName)); + m_scleraColorFactorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(ScleraColorFactorName)); + m_scleraRoughnessIndex = m_materialInstance->FindPropertyIndex(AZ::Name(ScleraRoughnessName)); + m_scleraNormalFactorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(ScleraNormalFactorName)); + + m_irisDepthIndex = m_materialInstance->FindPropertyIndex(AZ::Name(IrisDepthName)); + m_irisRadiusIndex = m_materialInstance->FindPropertyIndex(AZ::Name(IrisRadiusName)); + m_innerEyeIORIndex = m_materialInstance->FindPropertyIndex(AZ::Name(InnerEyeIORName)); + m_limbusSizeIndex = m_materialInstance->FindPropertyIndex(AZ::Name(LimbusSizeName)); + + m_specularFactorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(SpecularFactorName)); + + m_SSSEnableIndex = m_materialInstance->FindPropertyIndex(AZ::Name(SSSEnableName)); + m_SSSColorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(SSSColorName)); + m_SSSFactorIndex = m_materialInstance->FindPropertyIndex(AZ::Name(SSSFactorName)); + + // Assign material property values to the GUI variables so that ImGui displays them properly + m_materialInstance->GetPropertyValue(m_irisColorIndex).GetValue().GetAsVector3().StoreToFloat3(m_irisColor); + m_irisColorFactor = m_materialInstance->GetPropertyValue(m_irisColorFactorIndex).GetValue(); + m_irisRoughness = m_materialInstance->GetPropertyValue(m_irisRoughnessIndex).GetValue(); + + m_materialInstance->GetPropertyValue(m_scleraColorIndex).GetValue().GetAsVector3().StoreToFloat3(m_scleraColor); + m_scleraColorFactor = m_materialInstance->GetPropertyValue(m_scleraColorFactorIndex).GetValue(); + m_scleraRoughness = m_materialInstance->GetPropertyValue(m_scleraRoughnessIndex).GetValue(); + m_scleraNormalFactor = m_materialInstance->GetPropertyValue(m_scleraNormalFactorIndex).GetValue(); + + m_irisDepth = m_materialInstance->GetPropertyValue(m_irisDepthIndex).GetValue(); + m_irisRadius = m_materialInstance->GetPropertyValue(m_irisRadiusIndex).GetValue(); + m_innerEyeIOR = m_materialInstance->GetPropertyValue(m_innerEyeIORIndex).GetValue(); + m_limbusSize = m_materialInstance->GetPropertyValue(m_limbusSizeIndex).GetValue(); + + m_specularFactor = m_materialInstance->GetPropertyValue(m_specularFactorIndex).GetValue(); + + m_SSSEnable = m_materialInstance->GetPropertyValue(m_SSSEnableIndex).GetValue(); + m_materialInstance->GetPropertyValue(m_SSSColorIndex).GetValue().GetAsVector3().StoreToFloat3(m_SSSColor); + m_SSSFactor = m_materialInstance->GetPropertyValue(m_SSSFactorIndex).GetValue(); + } + + void EyeMaterialExampleComponent::DrawSidebar() + { + using namespace AZ::Render; + + if (m_imguiSidebar.Begin()) + { + ImGui::Spacing(); + + DrawSidebarMaterialProperties(); + + ImGui::Separator(); + + if (ScriptableImGui::Button("Material Details...")) + { + m_imguiMaterialDetails.SetMaterial(m_materialInstance); + m_imguiMaterialDetails.OpenDialog(); + } + + m_imguiSidebar.End(); + } + m_imguiMaterialDetails.Tick(); + } + + void EyeMaterialExampleComponent::DrawSidebarMaterialProperties() + { + bool eyeSettingsChanged = false; + if (ImGui::CollapsingHeader("Iris", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::ColorEdit3("Color##irisColor", m_irisColor, ImGuiColorEditFlags_None)) + { + m_materialInstance->SetPropertyValue(m_irisColorIndex, AZ::Color(m_irisColor[0], m_irisColor[1], m_irisColor[2], 1.0)); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Color Factor##irisColorFactor", &m_irisColorFactor, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_irisColorFactorIndex, m_irisColorFactor); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Roughness##irisRoughness", &m_irisRoughness, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_irisRoughnessIndex, m_irisRoughness); + eyeSettingsChanged = true; + } + ImGui::Unindent(); + } + if (ImGui::CollapsingHeader("Sclera", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::ColorEdit3("Color##scleraColor", m_scleraColor, ImGuiColorEditFlags_None)) + { + m_materialInstance->SetPropertyValue(m_scleraColorIndex, AZ::Color(m_scleraColor[0], m_scleraColor[1], m_scleraColor[2], 1.0)); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Color Factor##scleraColorFactor", &m_scleraColorFactor, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_scleraColorFactorIndex, m_scleraColorFactor); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Roughness##scleraRoughness", &m_scleraRoughness, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_scleraRoughnessIndex, m_scleraRoughness); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Normal Factor", &m_scleraNormalFactor, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_scleraNormalFactorIndex, m_scleraNormalFactor); + eyeSettingsChanged = true; + } + ImGui::Unindent(); + } + if (ImGui::CollapsingHeader("General Eye Properties", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::SliderFloat("Iris Depth", &m_irisDepth, 0.f, 0.5f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_irisDepthIndex, m_irisDepth); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Inner Radius", &m_irisRadius, 0.f, 0.5f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_irisRadiusIndex, m_irisRadius); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Inner IOR", &m_innerEyeIOR, 1.f, 2.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_innerEyeIORIndex, m_innerEyeIOR); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Limbus Size", &m_limbusSize, 0.f, 0.5f, "%.3f", ImGuiSliderFlags_Logarithmic)) + { + m_materialInstance->SetPropertyValue(m_limbusSizeIndex, m_limbusSize); + eyeSettingsChanged = true; + } + ImGui::Unindent(); + } + if (ImGui::CollapsingHeader("Specular F0", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::SliderFloat("Factor##specularF0Factor", &m_specularFactor, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_specularFactorIndex, m_specularFactor); + eyeSettingsChanged = true; + } + ImGui::Unindent(); + } + if (ImGui::CollapsingHeader("Subsurface Scattering", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::Checkbox("Enable##enableSSS", &m_SSSEnable)) + { + m_materialInstance->SetPropertyValue(m_SSSEnableIndex, m_SSSEnable); + eyeSettingsChanged = true; + } + if (ScriptableImGui::ColorEdit3("Color##SSSColor", m_SSSColor, ImGuiColorEditFlags_None)) + { + m_materialInstance->SetPropertyValue(m_SSSColorIndex, AZ::Color(m_SSSColor[0], m_SSSColor[1], m_SSSColor[2], 1.0)); + eyeSettingsChanged = true; + } + if (ScriptableImGui::SliderFloat("Factor##SSSColorFactor", &m_SSSFactor, 0.f, 1.f, "%.3f")) + { + m_materialInstance->SetPropertyValue(m_SSSFactorIndex, m_SSSFactor); + eyeSettingsChanged = true; + } + ImGui::Unindent(); + } + + bool transformChanged = false; + + if (ImGui::CollapsingHeader("Eye Orientation", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Indent(); + if (ScriptableImGui::SliderFloat3("Rotation", m_rotationEuler, -180.0, 180.0)) { + transformChanged = true; + m_eyeTransform.SetRotation(AZ::Quaternion::CreateFromEulerAnglesDegrees(AZ::Vector3(m_rotationEuler[0], m_rotationEuler[1], m_rotationEuler[2]))); + } + + ImGui::Unindent(); + } + + if (eyeSettingsChanged) + { + m_materialInstance->Compile(); + } + + if (transformChanged) + { + GetMeshFeatureProcessor()->SetTransform(m_meshHandle, m_eyeTransform); + } + } +} diff --git a/Gem/Code/Source/EyeMaterialExampleComponent.h b/Gem/Code/Source/EyeMaterialExampleComponent.h new file mode 100644 index 00000000..1f94d358 --- /dev/null +++ b/Gem/Code/Source/EyeMaterialExampleComponent.h @@ -0,0 +1,107 @@ +/* + * 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 + * + */ + +#pragma once + +#include +#include +#include + +#include +#include + +namespace AtomSampleViewer +{ + //! Test sample for the Eye material type + class EyeMaterialExampleComponent final + : public CommonSampleComponentBase + , public AZ::TickBus::Handler + { + public: + AZ_COMPONENT(EyeMaterialExampleComponent, "{591B14E7-72CC-4583-B8D8-5A81EEAE85E7}", CommonSampleComponentBase); + + static void Reflect(AZ::ReflectContext* context); + + EyeMaterialExampleComponent(); + ~EyeMaterialExampleComponent() override = default; + + void Activate() override; + void Deactivate() override; + + private: + + AZ_DISABLE_COPY_MOVE(EyeMaterialExampleComponent); + + // AZ::TickBus::Handler overrides... + void OnTick(float deltaTime, AZ::ScriptTimePoint scriptTime) override; + + void Prepare(); + void LoadMesh(AZ::Transform transform); + + void InitializeMaterialProperties(); + + void DrawSidebar(); + void DrawSidebarMaterialProperties(); + + AZ::Data::Asset m_modelAsset; + AZ::Data::Asset m_materialAsset; + AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle; + AZ::Data::Instance m_materialInstance; + Utils::DefaultIBL m_defaultIbl; + + AZ::Transform m_eyeTransform; + + // Property Index + AZ::RPI::MaterialPropertyIndex m_irisColorIndex; + AZ::RPI::MaterialPropertyIndex m_irisColorFactorIndex; + AZ::RPI::MaterialPropertyIndex m_irisRoughnessIndex; + + AZ::RPI::MaterialPropertyIndex m_scleraColorIndex; + AZ::RPI::MaterialPropertyIndex m_scleraColorFactorIndex; + AZ::RPI::MaterialPropertyIndex m_scleraRoughnessIndex; + AZ::RPI::MaterialPropertyIndex m_scleraNormalFactorIndex; + + AZ::RPI::MaterialPropertyIndex m_irisDepthIndex; + AZ::RPI::MaterialPropertyIndex m_irisRadiusIndex; + AZ::RPI::MaterialPropertyIndex m_innerEyeIORIndex; + AZ::RPI::MaterialPropertyIndex m_limbusSizeIndex; + + AZ::RPI::MaterialPropertyIndex m_specularFactorIndex; + + AZ::RPI::MaterialPropertyIndex m_SSSEnableIndex; + AZ::RPI::MaterialPropertyIndex m_SSSColorIndex; + AZ::RPI::MaterialPropertyIndex m_SSSFactorIndex; + + // GUI + float m_irisColor[3]; + float m_irisColorFactor; + float m_irisRoughness; + + float m_scleraColor[3]; + float m_scleraColorFactor; + float m_scleraRoughness; + float m_scleraNormalFactor; + + float m_irisDepth; + float m_irisRadius; + float m_innerEyeIOR; + float m_limbusSize; + + float m_specularFactor; + + bool m_SSSEnable; + float m_SSSColor[3]; + float m_SSSFactor; + + float m_rotationEuler[3]; + + ImGuiSidebar m_imguiSidebar; + ImGuiMaterialDetails m_imguiMaterialDetails; + + }; +} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 56e545e9..415b2b9b 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -299,6 +300,7 @@ namespace AtomSampleViewer NewFeaturesSample("DepthOfField"), NewFeaturesSample("DiffuseGI", []() {return Utils::GetRHIDevice()->GetFeatures().m_rayTracing; }), NewFeaturesSample("Exposure"), + NewFeaturesSample("EyeMaterial"), NewFeaturesSample("LightCulling"), NewFeaturesSample("Parallax"), NewFeaturesSample("Shadow"), diff --git a/Gem/Code/atomsampleviewergem_private_files.cmake b/Gem/Code/atomsampleviewergem_private_files.cmake index 3599452d..f8be2522 100644 --- a/Gem/Code/atomsampleviewergem_private_files.cmake +++ b/Gem/Code/atomsampleviewergem_private_files.cmake @@ -127,6 +127,8 @@ set(FILES Source/EntityUtilityFunctions.h Source/ExposureExampleComponent.cpp Source/ExposureExampleComponent.h + Source/EyeMaterialExampleComponent.h + Source/EyeMaterialExampleComponent.cpp Source/LightCullingExampleComponent.cpp Source/LightCullingExampleComponent.h Source/MaterialHotReloadTestComponent.cpp diff --git a/Materials/Eye/001_EyeBasic.material b/Materials/Eye/001_EyeBasic.material new file mode 100644 index 00000000..c56cfc69 --- /dev/null +++ b/Materials/Eye/001_EyeBasic.material @@ -0,0 +1,20 @@ +{ + "materialType": "Materials/Types/Eye.materialtype", + "materialTypeVersion": 1, + "propertyValues": { + "eye.innerEyeIOR": 1.2000000476837158, + "eye.irisDepth": 0.46000000834465027, + "iris.baseColor.color": [ + 0.503395140171051, + 0.7551079392433167, + 0.7341268062591553, + 1.0 + ], + "iris.baseColor.textureMap": "Materials/Eye/Textures/eyeIrisBW.png", + "iris.roughness.factor": 0.05999999865889549, + "sclera.baseColor.textureMap": "Materials/Eye/Textures/eyeSclera.png", + "sclera.normal.factor": 0.2800000011920929, + "sclera.normal.textureMap": "Materials/Eye/Textures/proceduralBump.png", + "sclera.roughness.factor": 0.17000000178813934 + } +} \ No newline at end of file diff --git a/Materials/Eye/Textures/eyeIrisBW.png b/Materials/Eye/Textures/eyeIrisBW.png new file mode 100644 index 00000000..96143d72 --- /dev/null +++ b/Materials/Eye/Textures/eyeIrisBW.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dbd3712383c1cd3ebfcbafca86617a31cedcdb8a7ad31d6675aa5b7fc3ec68f +size 338525 diff --git a/Materials/Eye/Textures/eyeSclera.png b/Materials/Eye/Textures/eyeSclera.png new file mode 100644 index 00000000..fab48878 --- /dev/null +++ b/Materials/Eye/Textures/eyeSclera.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a4e7e9024981c04eeb9918441a3dea9f2e9823220db750c8bd2bfaed6af9ef4 +size 975570 diff --git a/Materials/Eye/Textures/proceduralBump.png b/Materials/Eye/Textures/proceduralBump.png new file mode 100644 index 00000000..ee6c5f0d --- /dev/null +++ b/Materials/Eye/Textures/proceduralBump.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5862abeaa44c25f41420e8009a15cc97e13a8467703290e0b813fd9d2db97ed6 +size 2003143 diff --git a/Objects/eye.fbx b/Objects/eye.fbx new file mode 100644 index 00000000..69f1ecf5 --- /dev/null +++ b/Objects/eye.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d175ec311c84a29b7229e06c315c54dfdcfe2189898a1fa0dc6f936aaf4db494 +size 128492 diff --git a/Scripts/ExpectedScreenshots/EyeMaterial/screenshot_eye.png b/Scripts/ExpectedScreenshots/EyeMaterial/screenshot_eye.png new file mode 100644 index 00000000..30939738 --- /dev/null +++ b/Scripts/ExpectedScreenshots/EyeMaterial/screenshot_eye.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53d5181d52bbf9e7eb921429b4c791839a34e1d3f6ceb4330997e6f3a04605b7 +size 402760 diff --git a/Scripts/EyeMaterialTest.bv.lua b/Scripts/EyeMaterialTest.bv.lua new file mode 100644 index 00000000..1b454c8d --- /dev/null +++ b/Scripts/EyeMaterialTest.bv.lua @@ -0,0 +1,9 @@ +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/EyeMaterial/') +Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) + +OpenSample('Features/EyeMaterial') +ResizeViewport(1600, 900) +SelectImageComparisonToleranceLevel("Level F") + +-- Test with default values +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_eye.png') diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index c53d4062..d40f1365 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -46,6 +46,7 @@ tests= { RunScriptWrapper('scripts/decals.bv.luac'), RunScriptWrapper('scripts/dynamicdraw.bv.luac'), RunScriptWrapper('scripts/dynamicmaterialtest.bv.luac'), + RunScriptWrapper('scripts/EyeMaterialTest.bv.luac'), RunScriptWrapper('scripts/materialscreenshottests.bv.luac'), RunScriptWrapper('scripts/materialhotreloadtest.bv.luac'), RunScriptWrapper('scripts/msaa_rpi_test.bv.luac'), diff --git a/atomsampleviewer_asset_files.cmake b/atomsampleviewer_asset_files.cmake index a7ff7f18..26550928 100644 --- a/atomsampleviewer_asset_files.cmake +++ b/atomsampleviewer_asset_files.cmake @@ -28,6 +28,7 @@ set(FILES Scripts/AreaLightTest.bv.lua Scripts/CheckerboardTest.bv.lua Scripts/CullingAndLod.bv.lua + Scripts/EyeMaterialTest.bv.lua Scripts/Decals.bv.lua Scripts/DiffuseGITest.bv.lua Scripts/DynamicDraw.bv.lua From 3f1af19ae353d5094c45840d13947807357cc664 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 21 Apr 2022 00:02:03 -0700 Subject: [PATCH 06/81] Added new screenshot tests that focus on exposing depth-test artifacts in parallax surfaces. I added a new setting to the Parallax sample that allows turning off all lights, so the surface is rendered black. This allows us to use a much tighter threshold on the screenshot comparison, since an entirely black unlit surface will not exhibit the sensitive platform differences we are used to seeing on parallax materials. This should ensure any depth-test calculation noise, which show up as gray firefly pixels, will cause the test threshold to fail. I included many screenshots because the noise seems to be platform - and/or driver-dependent, so having more screenshots increases the chances of detecting failures. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../ParallaxMappingExampleComponent.cpp | 41 +++++++----- .../Source/ParallaxMappingExampleComponent.h | 9 ++- .../ParallaxDepthArtifacts/screenshot_1.png | 3 + .../ParallaxDepthArtifacts/screenshot_2.png | 3 + .../ParallaxDepthArtifacts/screenshot_3.png | 3 + .../ParallaxDepthArtifacts/screenshot_4.png | 3 + .../ParallaxDepthArtifacts/screenshot_5.png | 3 + .../ParallaxDepthArtifacts/screenshot_6.png | 3 + Scripts/ParallaxDepthArtifacts.bv.lua | 65 +++++++++++++++++++ 9 files changed, 117 insertions(+), 16 deletions(-) create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_1.png create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_2.png create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_3.png create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_4.png create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_5.png create mode 100644 Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_6.png create mode 100644 Scripts/ParallaxDepthArtifacts.bv.lua diff --git a/Gem/Code/Source/ParallaxMappingExampleComponent.cpp b/Gem/Code/Source/ParallaxMappingExampleComponent.cpp index 1d382e1c..ffd33123 100644 --- a/Gem/Code/Source/ParallaxMappingExampleComponent.cpp +++ b/Gem/Code/Source/ParallaxMappingExampleComponent.cpp @@ -205,24 +205,34 @@ namespace AtomSampleViewer auto transform = AZ::Transform::CreateLookAt( location, AZ::Vector3::CreateZero()); + + using Lux = AZ::Render::PhotometricColor; + using Candela = AZ::Render::PhotometricColor; - if (m_lightType) - { - AZ::Render::PhotometricColor directionalLightColor(AZ::Color::CreateZero()); - AZ::Render::PhotometricColor diskLightColor(AZ::Color::CreateOne() * 500.f); - m_directionalLightFeatureProcessor->SetRgbIntensity(m_directionalLightHandle, directionalLightColor); - m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, diskLightColor); - } - else + Lux directionalLightColor{AZ::Color::CreateZero()}; + Candela diskLightColor{AZ::Color::CreateZero()}; + + switch (static_cast(m_lightType)) { - AZ::Render::PhotometricColor directionalLightColor(AZ::Color::CreateOne() * 5.f); - AZ::Render::PhotometricColor diskLightColor(AZ::Color::CreateZero()); - m_directionalLightFeatureProcessor->SetRgbIntensity(m_directionalLightHandle, directionalLightColor); - m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, diskLightColor); + case LightSelection::Directional: + directionalLightColor = Lux{AZ::Color::CreateOne() * 5.f}; + break; + case LightSelection::Spot: + diskLightColor = Candela{AZ::Color::CreateOne() * 500.f}; + break; + case LightSelection::None: + // Keep initial 0 values + break; + default: + AZ_Assert(false, "Unhandled case"); + break; } - + + m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, diskLightColor); m_diskLightFeatureProcessor->SetPosition(m_diskLightHandle, location); m_diskLightFeatureProcessor->SetDirection(m_diskLightHandle, transform.GetBasis(1)); + + m_directionalLightFeatureProcessor->SetRgbIntensity(m_directionalLightHandle, directionalLightColor); m_directionalLightFeatureProcessor->SetDirection(m_directionalLightHandle, transform.GetBasis(1)); // Camera Configuration @@ -305,8 +315,9 @@ namespace AtomSampleViewer ImGui::Text("Lighting"); ImGui::Indent(); { - ScriptableImGui::RadioButton("Directional Light", &m_lightType, 0); - ScriptableImGui::RadioButton("Spot Light", &m_lightType, 1); + ScriptableImGui::RadioButton("No Light", &m_lightType, 0); + ScriptableImGui::RadioButton("Directional Light", &m_lightType, 1); + ScriptableImGui::RadioButton("Spot Light", &m_lightType, 2); ScriptableImGui::Checkbox("Auto Rotation", &m_lightAutoRotate); ScriptableImGui::SliderAngle("Direction", &m_lightRotationAngle, 0, 360); } diff --git a/Gem/Code/Source/ParallaxMappingExampleComponent.h b/Gem/Code/Source/ParallaxMappingExampleComponent.h index 0bdd892e..08e6500f 100644 --- a/Gem/Code/Source/ParallaxMappingExampleComponent.h +++ b/Gem/Code/Source/ParallaxMappingExampleComponent.h @@ -66,7 +66,14 @@ namespace AtomSampleViewer float m_lightRotationAngle = 0.f; // in radian bool m_lightAutoRotate = true; - int m_lightType = 0; // 0: diectionalLight, 1: diskLight + + enum class LightSelection : int + { + None, + Directional, + Spot + }; + int m_lightType = static_cast(LightSelection::Directional); //Assets AZ::Data::Asset m_planeAsset; diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_1.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_1.png new file mode 100644 index 00000000..38bd18e5 --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:649410344b69ce478d45939b6c6762d1aa4ff6df79c7ef4b617d40eee2100bf9 +size 2687 diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_2.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_2.png new file mode 100644 index 00000000..53a54b8c --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc30248a3e98dba397eedb36d153cf80c16d3683cff49a2f9d2f1e15cfde2f6f +size 2704 diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_3.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_3.png new file mode 100644 index 00000000..8f5a9168 --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:616cac57e0c140585775c8aa34ee856a56e48ce15ebc98d40e23670fb2ed4a0e +size 2676 diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_4.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_4.png new file mode 100644 index 00000000..cc1a4b09 --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d45bd0bfa87ad9a9959556c5bd04e282ef4beb2036dda0a19ab59de2d051444 +size 2657 diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_5.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_5.png new file mode 100644 index 00000000..a8ae7157 --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dd397a5191ac14b4adfc5919e62a5954dbfca7020fde2629d432d3c6c60838b +size 2631 diff --git a/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_6.png b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_6.png new file mode 100644 index 00000000..eb41283c --- /dev/null +++ b/Scripts/ExpectedScreenshots/ParallaxDepthArtifacts/screenshot_6.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71208d13cb03bbca75c0c3a0f3b08c170b4c569354542790f45239187bf6e3cc +size 2729 diff --git a/Scripts/ParallaxDepthArtifacts.bv.lua b/Scripts/ParallaxDepthArtifacts.bv.lua new file mode 100644 index 00000000..07024746 --- /dev/null +++ b/Scripts/ParallaxDepthArtifacts.bv.lua @@ -0,0 +1,65 @@ +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ParallaxDepthArtifacts/') +Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) + +OpenSample('Features/Parallax') +ResizeViewport(512, 512) + +-- Several times there have bugs that appeared, related to inconsistent depth calculations causing unwanted clipping of pixels on parallax surfaces. +-- We attempt to detect this by putting the camera at several angles that have been observed to reveal these artifacts in the past. +-- All lights are turned off to avoid the sensitive platform differences we are used to seeing on parallax materials, which allows us to use a much +-- tighter tolerance level than other parallax test cases, so that even small amounts of artifacts will be detected and fail the test. These +-- artifacts were showing up as gray firefly pixels on the otherwise black parallax surface. +-- Many camera angles are used because the noise seems to be platform- and/or driver-dependent, so having more angles increases the chances of detecting failures. + +SelectImageComparisonToleranceLevel("Level B") + +SetImguiValue('Lighting/Auto Rotation', false) +SetImguiValue('Lighting/Direction', DegToRad(110)) +SetImguiValue('Parallax Setting/Heightmap Scale', 0.1) +SetImguiValue('Parallax Setting/Enable Pdo', true) +SetImguiValue('Lighting/No Light', true) + +ArcBallCameraController_SetDistance(3.000000) + +ArcBallCameraController_SetHeading(DegToRad(-38.356312)) +ArcBallCameraController_SetPitch(DegToRad(-2.705635)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_1.png') + +ArcBallCameraController_SetHeading(DegToRad(-66.861877)) +ArcBallCameraController_SetPitch(DegToRad(-4.933800)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_2.png') + +ArcBallCameraController_SetHeading(DegToRad(30.230936)) +ArcBallCameraController_SetPitch(DegToRad(-3.819724)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_3.png') + +ArcBallCameraController_SetHeading(DegToRad(-140.709763)) +ArcBallCameraController_SetPitch(DegToRad(-3.501410)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_4.png') + +ArcBallCameraController_SetHeading(DegToRad(135.264740)) +ArcBallCameraController_SetPitch(DegToRad(-2.387333)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_5.png') + +ArcBallCameraController_SetHeading(DegToRad(20.355005)) +ArcBallCameraController_SetPitch(DegToRad(-4.456343)) +IdleFrames(1) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_6.png') + +OpenSample(nil) \ No newline at end of file From 753a738996bf0f6082d62c77a351cf6c56fafe7d Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Thu, 21 Apr 2022 11:35:20 -0500 Subject: [PATCH 07/81] Mark Linux as supporting viewport resize for the ASV scripting interface (#411) * Mark Linux as supporting viewport resize for the ASV scripting interface Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Mark AtomSampleViewerStandalone as supported on linux Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Platform/Linux/Utils_Linux.cpp | 2 +- Standalone/Platform/Linux/atomsampleviewer_traits_linux.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/Platform/Linux/Utils_Linux.cpp b/Gem/Code/Source/Platform/Linux/Utils_Linux.cpp index 2d39ae6b..a6d9659f 100644 --- a/Gem/Code/Source/Platform/Linux/Utils_Linux.cpp +++ b/Gem/Code/Source/Platform/Linux/Utils_Linux.cpp @@ -15,7 +15,7 @@ namespace AtomSampleViewer { bool SupportsResizeClientArea() { - return false; + return true; } bool RunDiffTool(const AZStd::string& filePathA, const AZStd::string& filePathB) diff --git a/Standalone/Platform/Linux/atomsampleviewer_traits_linux.cmake b/Standalone/Platform/Linux/atomsampleviewer_traits_linux.cmake index ef9191e1..b2624096 100644 --- a/Standalone/Platform/Linux/atomsampleviewer_traits_linux.cmake +++ b/Standalone/Platform/Linux/atomsampleviewer_traits_linux.cmake @@ -6,4 +6,4 @@ # # -set(ATOMSAMPLEVIEWER_TRAIT_BUILD_SUPPORTS_STANDALONE FALSE) +set(ATOMSAMPLEVIEWER_TRAIT_BUILD_SUPPORTS_STANDALONE TRUE) From b60969ab9314e578b719d4e7fd071fc4c80e4456 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:55:39 -0700 Subject: [PATCH 08/81] Added the new ParallaxDepthArtifacts test script to the full test suite. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/_FullTestSuite_.bv.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index c53d4062..3584ef68 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -55,6 +55,7 @@ tests= { RunScriptWrapper('scripts/transparenttest.bv.luac'), RunScriptWrapper('scripts/streamingimagetest.bv.luac'), RunScriptWrapper('scripts/parallaxtest.bv.luac'), + RunScriptWrapper('scripts/parallaxdepthartifacts.bv.luac'), RunScriptWrapper('scripts/checkerboardtest.bv.luac'), RunScriptWrapper('scripts/scenereloadsoaktest.bv.luac'), RunScriptWrapper('scripts/diffusegitest.bv.luac'), From 3494fe1ebb359c3c06b764be1b047e6036b84d55 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:08:11 -0700 Subject: [PATCH 09/81] Made sure any IBL is cleared when closing a sample. There were some cases where the IBL from one sample could persist when opening another sample, for example when going directly from the Mesh sample to the Parallax sample. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/CommonSampleComponentBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gem/Code/Source/CommonSampleComponentBase.cpp b/Gem/Code/Source/CommonSampleComponentBase.cpp index 7322b687..4c9dcd3f 100644 --- a/Gem/Code/Source/CommonSampleComponentBase.cpp +++ b/Gem/Code/Source/CommonSampleComponentBase.cpp @@ -121,6 +121,7 @@ namespace AtomSampleViewer { AZ::Render::SkyBoxFeatureProcessorInterface* skyboxFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId(m_entityContextId); AZ::Render::DirectionalLightFeatureProcessorInterface* directionalLightFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId(m_entityContextId); + AZ::Render::ImageBasedLightFeatureProcessorInterface* iblFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId(m_entityContextId); for (AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle& handle : m_lightHandles) { @@ -137,6 +138,8 @@ namespace AtomSampleViewer skyboxFeatureProcessor->Enable(false); + iblFeatureProcessor->Reset(); + AZ::TransformNotificationBus::MultiHandler::BusDisconnect(); AZ::EntityBus::MultiHandler::BusDisconnect(); } From 0fadfb8839db0e5770d496b8692c3bb5c76e2e64 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 21 Apr 2022 12:30:25 -0700 Subject: [PATCH 10/81] Remove GridMate from AtomSampleViewer Signed-off-by: puvvadar --- Standalone/Platform/Common/AtomSampleViewerApplication.cpp | 7 ------- Standalone/Platform/Mac/main_mac.mm | 3 --- Standalone/Platform/iOS/main_ios.mm | 3 --- 3 files changed, 13 deletions(-) diff --git a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp index b8e9ee06..ff3d738a 100644 --- a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp +++ b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp @@ -342,15 +342,8 @@ namespace AtomSampleViewer customRunCode(); } - //GridMate allocator is created in StartCommon - const GridMate::GridMateDesc desc; - GridMate::IGridMate* gridMate = GridMate::GridMateCreate(desc); - AZ_Assert(gridMate, "Failed to create gridmate!"); - app.RunMainLoop(); - GridMate::GridMateDestroy(gridMate); - app.Stop(); return app.GetExitCode(); diff --git a/Standalone/Platform/Mac/main_mac.mm b/Standalone/Platform/Mac/main_mac.mm index 443924b9..4a078559 100644 --- a/Standalone/Platform/Mac/main_mac.mm +++ b/Standalone/Platform/Mac/main_mac.mm @@ -10,9 +10,6 @@ #include -#include -#include - #include "MacO3DEApplication.h" #include #include diff --git a/Standalone/Platform/iOS/main_ios.mm b/Standalone/Platform/iOS/main_ios.mm index 4e2d1ef2..d4d9eec7 100644 --- a/Standalone/Platform/iOS/main_ios.mm +++ b/Standalone/Platform/iOS/main_ios.mm @@ -10,9 +10,6 @@ #include -#include -#include - #import #include From 004e4cd8f29607cc391f63d74b8cdd8e71870c35 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 21 Apr 2022 13:35:03 -0700 Subject: [PATCH 11/81] Remove another GridMate include Signed-off-by: puvvadar --- Standalone/Platform/Common/AtomSampleViewerApplication.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp index ff3d738a..c0f459b2 100644 --- a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp +++ b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp @@ -27,7 +27,6 @@ #include #include #include -#include namespace AtomSampleViewer { From d59213a86b661849b5d0b26fb39671cbdb5a7f8c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:55:17 -0700 Subject: [PATCH 12/81] Increased screenshot tolerance for some benign failing tests. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/MaterialScreenshotTests.bv.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/MaterialScreenshotTests.bv.lua b/Scripts/MaterialScreenshotTests.bv.lua index 5e8b3ebb..c8a83539 100644 --- a/Scripts/MaterialScreenshotTests.bv.lua +++ b/Scripts/MaterialScreenshotTests.bv.lua @@ -149,10 +149,10 @@ GenerateMaterialScreenshot('Level L', '100_UvTiling_Parallax_B', { uniqueSuffix= GenerateMaterialScreenshot('Level H', '100_UvTiling_Roughness') GenerateMaterialScreenshot('Level F', '100_UvTiling_SpecularF0') -GenerateMaterialScreenshot('Level E', '101_DetailMaps_BaseNoDetailMaps', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) +GenerateMaterialScreenshot('Level F', '101_DetailMaps_BaseNoDetailMaps', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) GenerateMaterialScreenshot('Level H', '102_DetailMaps_All', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) -GenerateMaterialScreenshot('Level F', '103_DetailMaps_BaseColor', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) -GenerateMaterialScreenshot('Level F', '103_DetailMaps_BaseColorWithMask', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) +GenerateMaterialScreenshot('Level G', '103_DetailMaps_BaseColor', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) +GenerateMaterialScreenshot('Level G', '103_DetailMaps_BaseColorWithMask', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) GenerateMaterialScreenshot('Level H', '104_DetailMaps_Normal', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) GenerateMaterialScreenshot('Level H', '104_DetailMaps_NormalWithMask', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) GenerateMaterialScreenshot('Level H', '105_DetailMaps_BlendMaskUsingDetailUVs', {model=g_modelHermanubis, lighting="Blouberg Sunrise 1 (Alt)", cameraHeading=175.0, cameraPitch=5.0, cameraDistance=0.75, cameraZ=0.5}) From 4c252ec9ec87f9da59c93b150820c5f8b9c4831c Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Mon, 25 Apr 2022 16:00:40 -0700 Subject: [PATCH 13/81] Updated method names in calls to the ReflectionProbeFeatureProcessor Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- Gem/Code/Source/MultiSceneExampleComponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gem/Code/Source/MultiSceneExampleComponent.cpp b/Gem/Code/Source/MultiSceneExampleComponent.cpp index 71f8f216..16e59768 100644 --- a/Gem/Code/Source/MultiSceneExampleComponent.cpp +++ b/Gem/Code/Source/MultiSceneExampleComponent.cpp @@ -263,8 +263,8 @@ namespace AtomSampleViewer { const Vector3 probePosition{ -5.0f, 0.0f, 1.5f }; const Transform probeTransform = Transform::CreateTranslation(probePosition); - m_reflectionProbeHandle = m_reflectionProbeFeatureProcessor->AddProbe(probeTransform, true); - m_reflectionProbeFeatureProcessor->ShowProbeVisualization(m_reflectionProbeHandle, true); + m_reflectionProbeHandle = m_reflectionProbeFeatureProcessor->AddReflectionProbe(probeTransform, true); + m_reflectionProbeFeatureProcessor->ShowVisualization(m_reflectionProbeHandle, true); } // Enable Depth of Field @@ -311,7 +311,7 @@ namespace AtomSampleViewer m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle); // Release the probe - m_reflectionProbeFeatureProcessor->RemoveProbe(m_reflectionProbeHandle); + m_reflectionProbeFeatureProcessor->RemoveReflectionProbe(m_reflectionProbeHandle); m_reflectionProbeHandle = nullptr; // Release all meshes From 1c8e8da6d7868de97327b3963b0b8d9bfbcd9c22 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 25 Apr 2022 16:57:00 -0700 Subject: [PATCH 14/81] Fixed code comment Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/ParallaxDepthArtifacts.bv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/ParallaxDepthArtifacts.bv.lua b/Scripts/ParallaxDepthArtifacts.bv.lua index 07024746..fb9dd98f 100644 --- a/Scripts/ParallaxDepthArtifacts.bv.lua +++ b/Scripts/ParallaxDepthArtifacts.bv.lua @@ -15,7 +15,7 @@ Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Parallax') ResizeViewport(512, 512) --- Several times there have bugs that appeared, related to inconsistent depth calculations causing unwanted clipping of pixels on parallax surfaces. +-- There have been several bugs related to inconsistent depth calculations causing unwanted clipping of pixels on parallax surfaces. -- We attempt to detect this by putting the camera at several angles that have been observed to reveal these artifacts in the past. -- All lights are turned off to avoid the sensitive platform differences we are used to seeing on parallax materials, which allows us to use a much -- tighter tolerance level than other parallax test cases, so that even small amounts of artifacts will be detected and fail the test. These From b837d5b8bfe970f1451f71e482ff68b96b30fd21 Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Wed, 27 Apr 2022 15:58:50 -0700 Subject: [PATCH 15/81] Make ProceduralSkinnedMeshUtils use model buffers directly for skinned meshes (#356) * Cherry-picking dc1133a Signed-off-by: Tommy Walton * Fix missing namespace and remove pragma optimize Signed-off-by: amzn-tommy * Fix size_t cast issues Signed-off-by: amzn-tommy * Add working support for multiple sub-meshes to ProceduralSkinnedMeshUtils Signed-off-by: Tommy Walton * Fix merge error while cherry-picking Signed-off-by: Tommy Walton --- Gem/Code/Source/ProceduralSkinnedMesh.cpp | 65 ++++- Gem/Code/Source/ProceduralSkinnedMesh.h | 18 +- .../Source/ProceduralSkinnedMeshUtils.cpp | 224 +++++++++++------- Gem/Code/Source/ProceduralSkinnedMeshUtils.h | 4 +- Gem/Code/Source/SampleComponentManager.cpp | 1 + .../Source/SkinnedMeshExampleComponent.cpp | 10 +- 6 files changed, 218 insertions(+), 104 deletions(-) diff --git a/Gem/Code/Source/ProceduralSkinnedMesh.cpp b/Gem/Code/Source/ProceduralSkinnedMesh.cpp index 30ccbeae..e414a95e 100644 --- a/Gem/Code/Source/ProceduralSkinnedMesh.cpp +++ b/Gem/Code/Source/ProceduralSkinnedMesh.cpp @@ -21,6 +21,7 @@ namespace AtomSampleViewer m_vertexCount = m_segmentCount * m_verticesPerSegment; m_boneCount = AZ::GetMax(1u, static_cast(skinnedMeshConfig.m_boneCount)); m_influencesPerVertex = AZ::GetMax(0u, AZ::GetMin(static_cast(skinnedMeshConfig.m_influencesPerVertex), AZ::GetMin(m_boneCount, maxInfluencesPerVertex))); + m_subMeshCount = skinnedMeshConfig.m_subMeshCount; // For now, use a conservative AABB. A better AABB will be added with ATOM-3624 m_aabb.AddPoint(AZ::Vector3(-m_height - m_radius, -m_height - m_radius, -m_height - m_radius)); @@ -85,6 +86,22 @@ namespace AtomSampleViewer } } + uint32_t ProceduralSkinnedMesh::GetInfluencesPerVertex() const + { + return m_influencesPerVertex; + } + + uint32_t ProceduralSkinnedMesh::GetSubMeshCount() const + { + return m_subMeshCount; + } + + float ProceduralSkinnedMesh::GetSubMeshYOffset() const + { + constexpr float spaceBetweenSubmeshes = .01f; + return m_radius * 2.0f + spaceBetweenSubmeshes; + } + void ProceduralSkinnedMesh::CalculateVertexBuffers() { // There are 6 indices per-side, and one fewer side than vertices per side since the first/last vertex in the segment have the same position (but different uvs) @@ -117,8 +134,9 @@ namespace AtomSampleViewer m_normals.resize(m_vertexCount); m_tangents.resize(m_vertexCount); m_bitangents.resize(m_vertexCount); - m_blendIndices.resize(m_vertexCount); - m_blendWeights.resize(m_vertexCount); + // We pack 16 bit joint id's into 32 bit uints, so use half the number of joints for the uint count + m_blendIndices.resize(m_vertexCount * m_influencesPerVertex / 2); + m_blendWeights.resize(m_vertexCount * m_influencesPerVertex); m_uvs.resize(m_vertexCount); for (uint32_t vertexIndex = 0; vertexIndex < m_vertexCount; ++vertexIndex) @@ -143,9 +161,31 @@ namespace AtomSampleViewer m_bitangents[vertexIndex][1] = 0.0f; m_bitangents[vertexIndex][2] = -1.0f; - // Blend indices/weights are the same for each vertex in the segment - m_blendIndices[vertexIndex] = m_segmentBlendIndices[segmentIndex]; - m_blendWeights[vertexIndex] = m_segmentBlendWeights[segmentIndex]; + for (size_t i = 0; i < m_influencesPerVertex; ++i) + { + // m_blendIndices has two id's packed into a single uint32 + size_t packedIndex = vertexIndex * m_influencesPerVertex / 2 + i / 2; + // m_blendWeights has an individual weight per influence + size_t unpackedIndex = vertexIndex * m_influencesPerVertex + i; + // Blend indices/weights are the same for each vertex in the segment, + // so copy the source data from the segment. Both id's and weights are unpacked + size_t sourceIndex = segmentIndex * m_influencesPerVertex + i; + + // Pack the segment blend indices, two per 32-bit uint + if (i % 2 == 0) + { + // Put the first/even ids in the most significant bits + m_blendIndices[packedIndex] = m_segmentBlendIndices[sourceIndex] << 16; + } + else + { + // Put the next/odd ids in the least significant bits + m_blendIndices[packedIndex] |= m_segmentBlendIndices[sourceIndex]; + } + + // Copy the weights + m_blendWeights[unpackedIndex] = m_segmentBlendWeights[sourceIndex]; + } // The uvs wrap around the cylinder exactly once m_uvs[vertexIndex][0] = static_cast(indexWithinTheCurrentSegment) / static_cast(m_verticesPerSegment - 1); @@ -182,9 +222,10 @@ namespace AtomSampleViewer void ProceduralSkinnedMesh::CalculateSegments() { m_segmentHeights.resize(m_segmentCount); - m_segmentBlendIndices.resize(m_segmentCount); - m_segmentBlendWeights.resize(m_segmentCount); m_segmentHeightOffsets.resize(m_segmentCount); + // All vertices in a given segment will share the same skin influences + m_segmentBlendIndices.resize(m_segmentCount * m_influencesPerVertex); + m_segmentBlendWeights.resize(m_segmentCount * m_influencesPerVertex); for (uint32_t segmentIndex = 0; segmentIndex < m_segmentCount; ++segmentIndex) { @@ -285,8 +326,14 @@ namespace AtomSampleViewer } } - m_segmentBlendIndices[segmentIndex] = currentBlendIndices; - m_segmentBlendWeights[segmentIndex] = currentBlendWeights; + // Now copy the resulting influences into the larger buffer + for (size_t i = 0; i < m_influencesPerVertex; ++i) + { + size_t destinationIndex = segmentIndex * m_influencesPerVertex + i; + m_segmentBlendIndices[destinationIndex] = currentBlendIndices[i]; + m_segmentBlendWeights[destinationIndex] = currentBlendWeights[i]; + } + m_segmentHeightOffsets[segmentIndex] = currentSegmentHeight - heightOffset; } } diff --git a/Gem/Code/Source/ProceduralSkinnedMesh.h b/Gem/Code/Source/ProceduralSkinnedMesh.h index 37627ca2..f3c45e1c 100644 --- a/Gem/Code/Source/ProceduralSkinnedMesh.h +++ b/Gem/Code/Source/ProceduralSkinnedMesh.h @@ -19,8 +19,9 @@ namespace AtomSampleViewer { int m_segmentCount = 8; int m_verticesPerSegment = 8; - int m_boneCount = 1; - int m_influencesPerVertex = 1; + int m_boneCount = 4; + int m_influencesPerVertex = 4; + int m_subMeshCount = 2; }; //! Class for creating SkinnedMeshInputBuffers with arbitrary bone/vertex counts @@ -31,6 +32,10 @@ namespace AtomSampleViewer void Resize(SkinnedMeshConfig& skinnedMeshConfig); void UpdateAnimation(float time, bool useOutOfSyncBoneAnimation = false); + uint32_t GetInfluencesPerVertex() const; + uint32_t GetSubMeshCount() const; + float GetSubMeshYOffset() const; + static const uint32_t MaxInfluencesPerVertex = 4; // Mesh data that's used for rendering @@ -40,8 +45,8 @@ namespace AtomSampleViewer AZStd::vector< AZStd::array> m_normals; AZStd::vector< AZStd::array> m_tangents; AZStd::vector< AZStd::array> m_bitangents; - AZStd::vector< AZStd::array> m_blendIndices; - AZStd::vector< AZStd::array> m_blendWeights; + AZStd::vector m_blendIndices; + AZStd::vector m_blendWeights; AZStd::vector> m_uvs; AZStd::vector m_boneMatrices; @@ -53,8 +58,8 @@ namespace AtomSampleViewer // Extra values that are used while generating per-vertex data AZStd::vector m_boneHeights; AZStd::vector m_segmentHeights; - AZStd::vector> m_segmentBlendIndices; - AZStd::vector> m_segmentBlendWeights; + AZStd::vector m_segmentBlendIndices; + AZStd::vector m_segmentBlendWeights; AZStd::vector m_segmentHeightOffsets; uint32_t m_boneCount = 0; @@ -62,6 +67,7 @@ namespace AtomSampleViewer uint32_t m_verticesPerSegment = 0; uint32_t m_segmentCount = 0; uint32_t m_influencesPerVertex = 0; + uint32_t m_subMeshCount = 0; float m_height = 1.0f; float m_radius = 0.1f; }; diff --git a/Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp b/Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp index 9a06a098..bc79899d 100644 --- a/Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp +++ b/Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace @@ -23,7 +24,7 @@ namespace namespace AtomSampleViewer { static AZ::Data::Asset CreateBufferAsset( - const void* data, const size_t elementCount, AZ::RHI::Format format) + const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor) { AZ::RPI::BufferAssetCreator creator; @@ -31,9 +32,6 @@ namespace AtomSampleViewer assetId.m_guid = AZ::Uuid::CreateRandom(); creator.Begin(assetId); - AZ::RHI::BufferViewDescriptor bufferViewDescriptor = - AZ::RHI::BufferViewDescriptor::CreateTyped(0, static_cast(elementCount), format); - AZ::RHI::BufferDescriptor bufferDescriptor; bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead; bufferDescriptor.m_byteCount = bufferViewDescriptor.m_elementSize * bufferViewDescriptor.m_elementCount; @@ -50,7 +48,45 @@ namespace AtomSampleViewer return bufferAsset; } - AZ::Data::Instance CreateModelFromProceduralSkinnedMesh(const ProceduralSkinnedMesh& proceduralMesh) + static AZ::Data::Asset CreateTypedBufferAsset( + const void* data, const size_t elementCount, AZ::RHI::Format format) + { + AZ::RHI::BufferViewDescriptor bufferViewDescriptor = + AZ::RHI::BufferViewDescriptor::CreateTyped(0, static_cast(elementCount), format); + + return CreateBufferAsset(data, bufferViewDescriptor); + } + + static AZ::Data::Asset CreateRawBufferAsset( + const void* data, size_t elementCount, size_t elementSizeInBytes) + { + AZ::RHI::BufferViewDescriptor bufferViewDescriptor = + AZ::RHI::BufferViewDescriptor::CreateRaw(0, static_cast(elementCount * elementSizeInBytes)); + + return CreateBufferAsset(data, bufferViewDescriptor); + } + + // Create a buffer view descriptor based on the properties of the lod buffer, but using the sub-mesh's element count and offset + static AZ::RHI::BufferViewDescriptor CreateSubmeshBufferViewDescriptor(const AZ::Data::Asset& lodBufferAsset, uint32_t elementCount, uint32_t elementOffset) + { + AZ::RHI::BufferViewDescriptor viewDescriptor = lodBufferAsset->GetBufferViewDescriptor(); + viewDescriptor.m_elementCount = elementCount; + viewDescriptor.m_elementOffset = elementOffset; + return viewDescriptor; + } + + template + static void DuplicateVertices(T& vertices, uint32_t elementsPerSubMesh, uint32_t subMeshCount) + { + // Increase the size of the vertex buffer, and then copy the original vertex buffer data into the new elements + vertices.resize(elementsPerSubMesh * subMeshCount); + for (uint32_t i = 1; i < subMeshCount; ++i) + { + AZStd::copy(vertices.begin(), vertices.begin() + elementsPerSubMesh, vertices.begin() + elementsPerSubMesh * i); + } + } + + AZ::Data::Instance CreateModelFromProceduralSkinnedMesh(ProceduralSkinnedMesh& proceduralMesh) { using namespace AZ; Data::AssetId assetId; @@ -62,12 +98,52 @@ namespace AtomSampleViewer modelCreator.SetName(AZStd::string("ProceduralSkinnedMesh_" + assetId.m_guid.ToString())); - auto indexBuffer = CreateBufferAsset(proceduralMesh.m_indices.data(), proceduralMesh.m_indices.size(), AZ::RHI::Format::R32_FLOAT); - auto positionBuffer = CreateBufferAsset(proceduralMesh.m_positions.data(), proceduralMesh.m_positions.size(), AZ::RHI::Format::R32G32B32_FLOAT); - auto normalBuffer = CreateBufferAsset(proceduralMesh.m_normals.data(), proceduralMesh.m_normals.size(), AZ::RHI::Format::R32G32B32_FLOAT); - auto tangentBuffer = CreateBufferAsset(proceduralMesh.m_tangents.data(), proceduralMesh.m_tangents.size(), AZ::RHI::Format::R32G32B32A32_FLOAT); - auto bitangentBuffer = CreateBufferAsset(proceduralMesh.m_bitangents.data(), proceduralMesh.m_bitangents.size(), AZ::RHI::Format::R32G32B32_FLOAT); - auto uvBuffer = CreateBufferAsset(proceduralMesh.m_uvs.data(), proceduralMesh.m_uvs.size(), AZ::RHI::Format::R32G32_FLOAT); + uint32_t submeshCount = proceduralMesh.GetSubMeshCount(); + uint32_t verticesPerSubmesh = aznumeric_caster(proceduralMesh.m_positions.size()); + uint32_t totalVertices = verticesPerSubmesh * submeshCount; + + uint32_t jointIdCountPerSubmesh = verticesPerSubmesh * proceduralMesh.GetInfluencesPerVertex(); + uint32_t extraJointIdCount = AZ::RPI::CalculateJointIdPaddingCount(jointIdCountPerSubmesh); + uint32_t extraPackedIdCount = extraJointIdCount / 2; + + // Copy the original buffer data n-times to create the data for extra sub-meshes + DuplicateVertices(proceduralMesh.m_indices, aznumeric_caster(proceduralMesh.m_indices.size()), submeshCount); + DuplicateVertices(proceduralMesh.m_positions, verticesPerSubmesh, submeshCount); + DuplicateVertices(proceduralMesh.m_normals, verticesPerSubmesh, submeshCount); + DuplicateVertices(proceduralMesh.m_tangents, verticesPerSubmesh, submeshCount); + DuplicateVertices(proceduralMesh.m_bitangents, verticesPerSubmesh, submeshCount); + DuplicateVertices(proceduralMesh.m_uvs, verticesPerSubmesh, submeshCount); + DuplicateVertices(proceduralMesh.m_blendWeights, verticesPerSubmesh * proceduralMesh.GetInfluencesPerVertex(), submeshCount); + + // Insert the jointId padding first before duplicating + AZStd::vector extraIds(extraPackedIdCount, 0); + + // Track the count of 32-byte 'elements' (packed) and offsets for creating sub-mesh views + uint32_t jointIdElementCountPerSubmesh = aznumeric_caster(proceduralMesh.m_blendIndices.size()); + uint32_t jointIdOffsetElementsPerSubmesh = jointIdElementCountPerSubmesh + extraPackedIdCount; + + proceduralMesh.m_blendIndices.insert(proceduralMesh.m_blendIndices.end(), extraIds.begin(), extraIds.end()); + DuplicateVertices( + proceduralMesh.m_blendIndices, aznumeric_caster(proceduralMesh.m_blendIndices.size()), submeshCount); + + // Offset duplicate positions in the +y direction, so each sub-mesh ends up in a unique position + for (uint32_t subMeshIndex = 1; subMeshIndex < submeshCount; ++subMeshIndex) + { + for (uint32_t i = 0; i < verticesPerSubmesh; ++i) + { + proceduralMesh.m_positions[subMeshIndex*verticesPerSubmesh + i][1] += + aznumeric_cast(subMeshIndex) * proceduralMesh.GetSubMeshYOffset(); + } + } + + auto indexBuffer = CreateTypedBufferAsset(proceduralMesh.m_indices.data(), proceduralMesh.m_indices.size(), AZ::RHI::Format::R32_FLOAT); + auto positionBuffer = CreateTypedBufferAsset(proceduralMesh.m_positions.data(), proceduralMesh.m_positions.size(), AZ::RHI::Format::R32G32B32_FLOAT); + auto normalBuffer = CreateTypedBufferAsset(proceduralMesh.m_normals.data(), proceduralMesh.m_normals.size(), AZ::RHI::Format::R32G32B32_FLOAT); + auto tangentBuffer = CreateTypedBufferAsset(proceduralMesh.m_tangents.data(), proceduralMesh.m_tangents.size(), AZ::RHI::Format::R32G32B32A32_FLOAT); + auto bitangentBuffer = CreateTypedBufferAsset(proceduralMesh.m_bitangents.data(), proceduralMesh.m_bitangents.size(), AZ::RHI::Format::R32G32B32_FLOAT); + auto uvBuffer = CreateTypedBufferAsset(proceduralMesh.m_uvs.data(), proceduralMesh.m_uvs.size(), AZ::RHI::Format::R32G32_FLOAT); + auto skinJointIdBuffer = CreateRawBufferAsset(proceduralMesh.m_blendIndices.data(), proceduralMesh.m_blendIndices.size(), sizeof(proceduralMesh.m_blendIndices[0])); + auto skinJointWeightBuffer = CreateTypedBufferAsset(proceduralMesh.m_blendWeights.data(), proceduralMesh.m_blendWeights.size(), AZ::RHI::Format::R32_FLOAT); // // Lod @@ -81,28 +157,59 @@ namespace AtomSampleViewer modelLodCreator.AddLodStreamBuffer(tangentBuffer); modelLodCreator.AddLodStreamBuffer(bitangentBuffer); modelLodCreator.AddLodStreamBuffer(uvBuffer); + modelLodCreator.AddLodStreamBuffer(skinJointIdBuffer); + modelLodCreator.AddLodStreamBuffer(skinJointWeightBuffer); - // - // Submesh - // - modelLodCreator.BeginMesh(); - - // Set the index buffer view - modelLodCreator.SetMeshIndexBuffer(AZ::RPI::BufferAssetView{ indexBuffer, indexBuffer->GetBufferViewDescriptor() }); - modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), AZ::RPI::BufferAssetView{ positionBuffer, positionBuffer->GetBufferViewDescriptor() }); - modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "NORMAL" }, AZ::Name(), AZ::RPI::BufferAssetView{ normalBuffer, normalBuffer->GetBufferViewDescriptor() }); - modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "TANGENT" }, AZ::Name(), AZ::RPI::BufferAssetView{ tangentBuffer, tangentBuffer->GetBufferViewDescriptor() }); - modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "BITANGENT" }, AZ::Name(), AZ::RPI::BufferAssetView{ bitangentBuffer, bitangentBuffer->GetBufferViewDescriptor() }); - modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "UV" }, AZ::Name(), AZ::RPI::BufferAssetView{ uvBuffer, uvBuffer->GetBufferViewDescriptor() }); - - AZ::Aabb localAabb = AZ::Aabb::CreateCenterHalfExtents(AZ::Vector3(0.0f, 0.0f, 0.0f), AZ::Vector3(1000000.0f, 1000000.0f, 1000000.0f)); - modelLodCreator.SetMeshAabb(AZStd::move(localAabb)); - - RPI::ModelMaterialSlot::StableId slotId = 0; - modelCreator.AddMaterialSlot(RPI::ModelMaterialSlot{slotId, AZ::Name{}, AZ::RPI::AssetUtils::LoadAssetByProductPath(DefaultSkinnedMeshMaterial)}); - modelLodCreator.SetMeshMaterialSlot(slotId); - - modelLodCreator.EndMesh(); + for (uint32_t submeshIndex = 0; submeshIndex < submeshCount; ++submeshIndex) + { + // + // Submesh + // + modelLodCreator.BeginMesh(); + + // Set the index buffer view + RHI::BufferViewDescriptor indexBufferDescriptor = indexBuffer->GetBufferViewDescriptor(); + uint32_t lodTriangleCount = indexBufferDescriptor.m_elementCount / 3; + uint32_t meshTriangleCount = lodTriangleCount / submeshCount; + uint32_t indexOffset = meshTriangleCount * submeshIndex * 3; + + if (submeshIndex == submeshCount - 1) + { + meshTriangleCount += lodTriangleCount % submeshCount; + } + uint32_t indexCount = meshTriangleCount * 3; + modelLodCreator.SetMeshIndexBuffer(AZ::RPI::BufferAssetView{ indexBuffer, CreateSubmeshBufferViewDescriptor(indexBuffer, indexCount, indexOffset) }); + + // Get the element count and offset for this sub-mesh + uint32_t elementCount = verticesPerSubmesh; + uint32_t elementOffset = verticesPerSubmesh * submeshIndex; + + // Include any truncated vertices if this is the last mesh + if (submeshIndex == submeshCount - 1) + { + elementCount += totalVertices % verticesPerSubmesh; + } + + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), AZ::RPI::BufferAssetView{ positionBuffer, CreateSubmeshBufferViewDescriptor(positionBuffer, elementCount, elementOffset) }); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "NORMAL" }, AZ::Name(), AZ::RPI::BufferAssetView{ normalBuffer, CreateSubmeshBufferViewDescriptor(normalBuffer, elementCount, elementOffset) }); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "TANGENT" }, AZ::Name(), AZ::RPI::BufferAssetView{ tangentBuffer, CreateSubmeshBufferViewDescriptor(tangentBuffer, elementCount, elementOffset) }); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "BITANGENT" }, AZ::Name(), AZ::RPI::BufferAssetView{ bitangentBuffer, CreateSubmeshBufferViewDescriptor(bitangentBuffer, elementCount, elementOffset) }); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "UV" }, AZ::Name(), AZ::RPI::BufferAssetView{ uvBuffer, CreateSubmeshBufferViewDescriptor(uvBuffer, elementCount, elementOffset) }); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "SKIN_JOINTINDICES" }, AZ::Name(), AZ::RPI::BufferAssetView{ skinJointIdBuffer, CreateSubmeshBufferViewDescriptor(skinJointIdBuffer, jointIdElementCountPerSubmesh, jointIdOffsetElementsPerSubmesh * submeshIndex) }); + + uint32_t jointWeightElementCount = elementCount * proceduralMesh.GetInfluencesPerVertex(); + uint32_t jointWeightOffset = elementOffset * proceduralMesh.GetInfluencesPerVertex(); + modelLodCreator.AddMeshStreamBuffer(RHI::ShaderSemantic{ "SKIN_WEIGHTS" }, AZ::Name(), AZ::RPI::BufferAssetView{ skinJointWeightBuffer, CreateSubmeshBufferViewDescriptor(skinJointWeightBuffer, jointWeightElementCount, jointWeightOffset) }); + + AZ::Aabb localAabb = proceduralMesh.m_aabb; + modelLodCreator.SetMeshAabb(AZStd::move(localAabb)); + + RPI::ModelMaterialSlot::StableId slotId = 0; + modelCreator.AddMaterialSlot(RPI::ModelMaterialSlot{slotId, AZ::Name{}, AZ::RPI::AssetUtils::LoadAssetByProductPath(DefaultSkinnedMeshMaterial)}); + modelLodCreator.SetMeshMaterialSlot(slotId); + + modelLodCreator.EndMesh(); + } Data::Asset lodAsset; modelLodCreator.End(lodAsset); @@ -114,61 +221,14 @@ namespace AtomSampleViewer return RPI::Model::FindOrCreate(modelAsset); } - AZStd::intrusive_ptr CreateSkinnedMeshInputBuffersFromProceduralSkinnedMesh(const ProceduralSkinnedMesh& proceduralMesh) + AZStd::intrusive_ptr CreateSkinnedMeshInputBuffersFromProceduralSkinnedMesh(ProceduralSkinnedMesh& proceduralMesh) { AZStd::intrusive_ptr skinnedMeshInputBuffers = aznew AZ::Render::SkinnedMeshInputBuffers; AZ::Data::AssetId assetId; assetId.m_guid = AZ::Uuid::CreateRandom(); - skinnedMeshInputBuffers->SetAssetId(assetId); - - // For now, use only 1 lod. Better LOD support for the sample will be added with ATOM-3624 - size_t lodCount = 1; - skinnedMeshInputBuffers->SetLodCount(lodCount); - for (size_t lodIndex = 0; lodIndex < lodCount; ++lodIndex) - { - uint32_t lodIndexCount = aznumeric_cast(proceduralMesh.m_indices.size()); - uint32_t lodVertexCount = aznumeric_cast(proceduralMesh.m_positions.size()); - // Create a single LOD - AZ::Render::SkinnedMeshInputLod skinnedMeshLod; - - // With a single sub-mesh - AZStd::vector subMeshes; - - AZ::Render::SkinnedSubMeshProperties subMesh; - subMesh.m_aabb = proceduralMesh.m_aabb; - subMesh.m_indexOffset = 0; - subMesh.m_indexCount = lodIndexCount; - subMesh.m_vertexOffset = 0; - subMesh.m_vertexCount = lodVertexCount; - // Do a load blocking queue on the material asset because the ModelLod will ignore the material if it is not ready - subMesh.m_materialSlot.m_defaultMaterialAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath(DefaultSkinnedMeshMaterial); - subMesh.m_materialSlot.m_stableId = 0; - - subMeshes.push_back(subMesh); - - skinnedMeshLod.SetIndexCount(lodIndexCount); - skinnedMeshLod.SetVertexCount(lodVertexCount); - - // Create read-only buffers and views for input buffers that are shared across all instances - AZStd::string lodString = AZStd::string::format("_Lod%zu", lodIndex); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_positions.data(), AZ::Render::SkinnedMeshInputVertexStreams::Position, lodString + "_SkinnedMeshInputPositions"); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_normals.data(), AZ::Render::SkinnedMeshInputVertexStreams::Normal, lodString + "_SkinnedMeshInputNormals"); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_tangents.data(), AZ::Render::SkinnedMeshInputVertexStreams::Tangent, lodString + "_SkinnedMeshInputTangents"); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_bitangents.data(), AZ::Render::SkinnedMeshInputVertexStreams::BiTangent, lodString + "_SkinnedMeshInputBiTangents"); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_blendIndices.data(), AZ::Render::SkinnedMeshInputVertexStreams::BlendIndices, lodString + "_SkinnedMeshInputBlendIndices"); - skinnedMeshLod.CreateSkinningInputBuffer((void*)proceduralMesh.m_blendWeights.data(), AZ::Render::SkinnedMeshInputVertexStreams::BlendWeights, lodString + "_SkinnedMeshInputBlendWeights"); - - // Create read-only input assembly buffers that are not modified during skinning and shared across all instances - skinnedMeshLod.CreateIndexBuffer(proceduralMesh.m_indices.data(), lodString + "_SkinnedMeshIndexBuffer"); - skinnedMeshLod.CreateStaticBuffer((void*)proceduralMesh.m_uvs.data(), AZ::Render::SkinnedMeshStaticVertexStreams::UV_0, lodString + "_SkinnedMeshStaticUVs"); - - // Set the data that needs to be tracked on a per-sub-mesh basis - // and create the common, shared sub-mesh buffer views - skinnedMeshLod.SetSubMeshProperties(subMeshes); - - skinnedMeshInputBuffers->SetLod(lodIndex, skinnedMeshLod); - } // for all lods + AZ::Data::Instance model = CreateModelFromProceduralSkinnedMesh(proceduralMesh); + skinnedMeshInputBuffers->CreateFromModelAsset(model->GetModelAsset()); return skinnedMeshInputBuffers; } diff --git a/Gem/Code/Source/ProceduralSkinnedMeshUtils.h b/Gem/Code/Source/ProceduralSkinnedMeshUtils.h index a54276c5..b5e38228 100644 --- a/Gem/Code/Source/ProceduralSkinnedMeshUtils.h +++ b/Gem/Code/Source/ProceduralSkinnedMeshUtils.h @@ -28,7 +28,7 @@ namespace AtomSampleViewer { class ProceduralSkinnedMesh; - AZ::Data::Instance CreateModelFromProceduralSkinnedMesh(const ProceduralSkinnedMesh& proceduralMesh); - AZStd::intrusive_ptr CreateSkinnedMeshInputBuffersFromProceduralSkinnedMesh(const ProceduralSkinnedMesh& proceduralMesh); + AZ::Data::Instance CreateModelFromProceduralSkinnedMesh(ProceduralSkinnedMesh& proceduralMesh); + AZStd::intrusive_ptr CreateSkinnedMeshInputBuffersFromProceduralSkinnedMesh(ProceduralSkinnedMesh& proceduralMesh); AZ::Data::Instance CreateBoneTransformBufferFromProceduralSkinnedMesh(const ProceduralSkinnedMesh& proceduralMesh); } // namespace AtomSampleViewer diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 415b2b9b..c7f84634 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -305,6 +305,7 @@ namespace AtomSampleViewer NewFeaturesSample("Parallax"), NewFeaturesSample("Shadow"), NewFeaturesSample("ShadowedSponza"), + NewFeaturesSample("SkinnedMesh"), NewFeaturesSample("SSAO"), NewFeaturesSample("SSR"), NewFeaturesSample("Tonemapping"), diff --git a/Gem/Code/Source/SkinnedMeshExampleComponent.cpp b/Gem/Code/Source/SkinnedMeshExampleComponent.cpp index 0f1ea386..c89855ad 100644 --- a/Gem/Code/Source/SkinnedMeshExampleComponent.cpp +++ b/Gem/Code/Source/SkinnedMeshExampleComponent.cpp @@ -46,7 +46,6 @@ namespace AtomSampleViewer AZ::TickBus::Handler::BusConnect(); m_imguiSidebar.Activate(); - CreatePlaneObject(); ConfigureCamera(); AddImageBasedLight(); } @@ -108,8 +107,9 @@ namespace AtomSampleViewer float segmentCountFloat = static_cast(config.m_segmentCount); configWasModified |= ScriptableImGui::SliderFloat("Segments Per-Mesh", &segmentCountFloat, 2.0f, 2048.0f, "%.0f", ImGuiSliderFlags_Logarithmic); configWasModified |= ScriptableImGui::SliderInt("Vertices Per-Segment", &config.m_verticesPerSegment, 4, 2048); - configWasModified |= ScriptableImGui::SliderInt("Bones Per-Mesh", &config.m_boneCount, 2, 256); - configWasModified |= ScriptableImGui::SliderInt("Influences Per-Vertex", &config.m_influencesPerVertex, 1, 4); + configWasModified |= ScriptableImGui::SliderInt("Bones Per-Mesh", &config.m_boneCount, 4, 256); + configWasModified |= ScriptableImGui::SliderInt("Influences Per-Vertex", &config.m_influencesPerVertex, 4, 4); + configWasModified |= ScriptableImGui::SliderInt("Sub-mesh count", &config.m_subMeshCount, 1, 128); if (configWasModified) { @@ -141,8 +141,8 @@ namespace AtomSampleViewer SkinnedMeshConfig config; config.m_segmentCount = 10; config.m_verticesPerSegment = 7; - config.m_boneCount = 5; - config.m_influencesPerVertex = 3; + config.m_boneCount = 4; + config.m_influencesPerVertex = 4; m_skinnedMeshContainer = AZStd::make_unique(skinnedMeshFeatureProcessor, meshFeatureProcessor, config); } } From be4859eba6255d4302effa8e7138e8147b44f890 Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Wed, 27 Apr 2022 17:05:52 -0700 Subject: [PATCH 16/81] Update ASV to use the new handle interface for the SkinnedMeshFeatureProcessor (#431) Signed-off-by: Tommy Walton --- Gem/Code/Source/SkinnedMeshContainer.cpp | 21 +++++---------------- Gem/Code/Source/SkinnedMeshContainer.h | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Gem/Code/Source/SkinnedMeshContainer.cpp b/Gem/Code/Source/SkinnedMeshContainer.cpp index d1262ec2..4fd544b0 100644 --- a/Gem/Code/Source/SkinnedMeshContainer.cpp +++ b/Gem/Code/Source/SkinnedMeshContainer.cpp @@ -140,7 +140,7 @@ namespace AtomSampleViewer // For now, there is a 1-1 match of input meshes to instances SkinnedMesh& skinnedMesh = m_skinnedMeshes[i]; RenderData& renderData = m_skinnedMeshInstances[i]; - if (renderData.m_skinnedMeshRenderProxy.IsValid()) + if (renderData.m_skinnedMeshHandle.IsValid()) { return; } @@ -184,13 +184,9 @@ namespace AtomSampleViewer } // If render proxies already exist, they will be auto-freed AZ::Render::SkinnedMeshShaderOptions defaultShaderOptions; - AZ::Render::SkinnedMeshFeatureProcessorInterface::SkinnedMeshRenderProxyDesc desc{ skinnedMesh.m_skinnedMeshInputBuffers, renderData.m_skinnedMeshInstance, renderData.m_meshHandle, renderData.m_boneTransformBuffer, defaultShaderOptions }; + AZ::Render::SkinnedMeshFeatureProcessorInterface::SkinnedMeshHandleDescriptor desc{ skinnedMesh.m_skinnedMeshInputBuffers, renderData.m_skinnedMeshInstance, renderData.m_meshHandle, renderData.m_boneTransformBuffer, defaultShaderOptions }; - renderData.m_skinnedMeshRenderProxy = m_skinnedMeshFeatureProcessor->AcquireRenderProxyInterface(desc); - if (renderData.m_skinnedMeshRenderProxy.IsValid()) - { - renderData.m_skinnedMeshRenderProxy->SetTransform(renderData.m_rootTransform); - } + renderData.m_skinnedMeshHandle = m_skinnedMeshFeatureProcessor->AcquireSkinnedMesh(desc); } else { @@ -226,15 +222,8 @@ namespace AtomSampleViewer // Release the per-instance data RenderData& renderData = m_skinnedMeshInstances[i]; - - if (renderData.m_skinnedMeshRenderProxy.IsValid()) - { - m_skinnedMeshFeatureProcessor->ReleaseRenderProxyInterface(renderData.m_skinnedMeshRenderProxy); - } - if (renderData.m_meshHandle) - { - m_meshFeatureProcessor->ReleaseMesh(*renderData.m_meshHandle); - } + m_skinnedMeshFeatureProcessor->ReleaseSkinnedMesh(renderData.m_skinnedMeshHandle); + m_meshFeatureProcessor->ReleaseMesh(*renderData.m_meshHandle); renderData.m_skinnedMeshInstance.reset(); renderData.m_boneTransformBuffer.reset(); diff --git a/Gem/Code/Source/SkinnedMeshContainer.h b/Gem/Code/Source/SkinnedMeshContainer.h index 51a0fdf0..3b843df2 100644 --- a/Gem/Code/Source/SkinnedMeshContainer.h +++ b/Gem/Code/Source/SkinnedMeshContainer.h @@ -39,7 +39,7 @@ namespace AtomSampleViewer struct RenderData { AZ::Transform m_rootTransform = AZ::Transform::CreateIdentity(); - AZ::Render::SkinnedMeshRenderProxyInterfaceHandle m_skinnedMeshRenderProxy; + AZ::Render::SkinnedMeshFeatureProcessorInterface::SkinnedMeshHandle m_skinnedMeshHandle; AZStd::intrusive_ptr m_skinnedMeshInstance = nullptr; AZ::Data::Instance m_boneTransformBuffer = nullptr; AZStd::shared_ptr m_meshHandle; From d0f711defe39fa41b3591a6eff4c2939c92454c7 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:50:20 -0700 Subject: [PATCH 17/81] Updated parallax test screenshots to match latest behavior. This corresponds to https://github.com/o3de/o3de/pull/9292 "Removed PDO Shadow Bias That Is Obsolete". Also, some aspects of the screenshots have been updated that weren't necessarily impacted by the depth bias changes, but more for routine maintenance to make sure the baselines match recent behavior that looks correct. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png | 4 ++-- .../ParallaxTest/screenshot_10_offsetClippingSteep.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2.png | 4 ++-- .../ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png | 4 ++-- .../ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_2.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_3.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_4.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_5.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_6.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_7.png | 4 ++-- .../ExpectedScreenshots/ParallaxTest/screenshot_8_offset.png | 4 ++-- .../ParallaxTest/screenshot_9_offsetClipping.png | 4 ++-- .../StandardMultilayerPBR/002_parallaxpdo.png | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png index dcc5fb50..7a2dd2ec 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:361adf2857f67316fe29c959411b0024d4129c63bdf45b957a6d0478a70d84e1 -size 1846886 +oid sha256:d83309654307f0850656a5b24b278331165bdb0afeca88f8886dfa160e37ad2e +size 1836679 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_10_offsetClippingSteep.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_10_offsetClippingSteep.png index 3f1336ad..6bb6783e 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_10_offsetClippingSteep.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_10_offsetClippingSteep.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:823a3c1dd71085a34bcf99e26356f6094fb04a0c0b362028310fc79a2316c068 -size 916665 +oid sha256:0e36a07a8dc8af2f673eb80182d6c3c46a8afad5765a8bd6ac1aaef29e1f1f31 +size 933080 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2.png index 444474a3..3f8fa77b 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cea6d911babc5ea46a800e923229ff03a4b0af5ef62b80e2320105a8319e712 -size 1708812 +oid sha256:708dc8db25833f50f88443e5703a041efd2fe0bfd3dd6b383249d043cfde5c78 +size 1690704 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png index 6dcc0ed6..7a2dd2ec 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aced08ff65c7d336a338c25a68eb86eaec9bb7c4b0ae81b03709d47d349416b7 -size 1846904 +oid sha256:d83309654307f0850656a5b24b278331165bdb0afeca88f8886dfa160e37ad2e +size 1836679 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_2.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_2.png index 6dcc0ed6..7a2dd2ec 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_2.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aced08ff65c7d336a338c25a68eb86eaec9bb7c4b0ae81b03709d47d349416b7 -size 1846904 +oid sha256:d83309654307f0850656a5b24b278331165bdb0afeca88f8886dfa160e37ad2e +size 1836679 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_3.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_3.png index d766af99..183e0c33 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_3.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_3.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ee5c0467b3d11277209c45aab9edb4326d6eb96702c98ed153a6b290e12d9315 -size 1786989 +oid sha256:b515b3ec73ab3b32e86c59c25e37117e2994006369d581717a8f0f3a73823f74 +size 1768886 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_4.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_4.png index b46a88c8..4a62200f 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_4.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_4.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c8437c53a33e86bf31f6915ea9e3c346bff4d4bd1034e62ee7fb90130ca35ef -size 1689677 +oid sha256:429de1ab904f2b67d251e5a1da3ccab55625dd5d34562efdce5093918671d7f4 +size 1660822 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_5.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_5.png index 0c5f7915..124d02a7 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_5.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f714d74b4423d884f62babc0298f58e68839d321fa9c4887605d2d20ea8807ef -size 1783820 +oid sha256:762b991fe1c26627d3b29f8a06c93fbb678dbdbee1e25607ef87efadfc39b49e +size 1757082 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_6.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_6.png index 4f5965f9..fdf267d3 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_6.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_6.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:788eabe023e81870f5547389bdceb51283d505f98d2671121dd8e26b4f24cc45 -size 1753945 +oid sha256:7b2e3be7065e5aff4751d4ee8e6d92d5696d1cfa5ac2db14861372f720bd776f +size 1750511 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_7.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_7.png index a24ef851..8d5a31e7 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_7.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_7.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f44542b303f15691e7aa457418116366a05c931c9768fc077ebe9e97f16f8040 -size 1659587 +oid sha256:ae0059e0682e172cd055ab75fdd737c15451c96eccbfe75d561ab73e516bfcae +size 1549638 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_8_offset.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_8_offset.png index 15e02d52..cd8fd559 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_8_offset.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_8_offset.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe122d39c65d0595fba5f696328991ac8608182b7ae6dd51ef3937add65bcf8b -size 1527581 +oid sha256:aa42ac709a2c2ffb1d1e8572cc201519ca60954aba158088310ed8caa0cfd069 +size 1516022 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_9_offsetClipping.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_9_offsetClipping.png index 1c98365e..a42a0c97 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_9_offsetClipping.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_9_offsetClipping.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21dcbb1bbe925c97728e110808e64f8a47f6d6e32a7fb2594cf8ebf832bfe8c8 -size 952949 +oid sha256:d4e0a9850e87b8ec96152764e9ba0be9a22d83c31a50981d23561a2e0d24b723 +size 965839 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png index f4638c0f..ea57fae9 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:669473008a95559978ff3c34676445624f5bb091df4c6f7136ed700a7d5ba98c -size 1432817 +oid sha256:1c7968bae39f38dea56a2b82d047b5751fc347537ef4c64f4fe790084d07afc6 +size 1546330 From 8554d8c006a92ca9ca90430ba9f7e3d3fb3301f3 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:49:12 -0700 Subject: [PATCH 18/81] Updated another screenshot that had changed shadows. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardPBR/012_parallax_pom_cutout.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png index 38799745..21417558 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5938225067436492ce9acb4649e077367860f343245857853b178716c68cbbd -size 639748 +oid sha256:fd42c9b3863c4dbb6c3871ca83ed512abddcc0ec7cecaede4bebbb8b701c2bd8 +size 652663 From f7af53bd8ab20c4298204eacaff89c2b8957a095 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:13:06 -0700 Subject: [PATCH 19/81] Updated screenshots related to shadows on parallax surfaces. In these cases the shadows have been reduced. I'm not sure what caused these screenshots to change (it's not related to my recent work around PDO depth bias), but the changes seem reasonable. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardMultilayerPBR/004_usevertexcolors.png | 4 ++-- .../StandardMultilayerPBR/005_usedisplacement.png | 4 ++-- .../StandardMultilayerPBR/005_usedisplacement_layer2off.png | 4 ++-- .../StandardMultilayerPBR/005_usedisplacement_layer3off.png | 4 ++-- .../005_usedisplacement_with_blendmasktexture.png | 4 ++-- ...005_usedisplacement_with_blendmasktexture_noheightmaps.png | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png index 7a415cce..b7e33018 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d412f1f3fecc587ae87d6def7409514d818cd7190ac04b236fb9e75860b3e27f -size 1240497 +oid sha256:748f7dd58d7aaf0b951584537741743782dbbc4479868bf07caa855e50c10cb7 +size 1218513 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png index 6ca5800d..1d0926b4 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9dff2d59014ef739d59682a910b0e29fddbedb82415ff249009d2e6edf7584c3 -size 1999168 +oid sha256:79f1055c0f316a9b47518d282d9b062fe3e3f1a38011976e0a6de2fa598bc562 +size 1975325 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png index 346742e9..c7065276 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb2f2e14013d15894c1e49a20a7b5b18f72fcc04453ac068362714bed7edce8f -size 2037989 +oid sha256:f3c5fa6ef8512987cad15c63c0cfdf7f61395b46ca4d53abdf4a416c9d1d8b71 +size 1998472 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png index 4e139c63..1439eaf0 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fc2e17eba27d41aa48d3e6090fcf12256ab46c641746ee2a671cc3acdb23954 -size 1868250 +oid sha256:cf543c2e636876501284ebf3a5036ba6cd3d22f5968ee738871faaa31f7911e2 +size 1849033 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture.png index c05c02df..2ff5322d 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bdb6b0f06b7237eb4b575b2f5588fc96d454fe86b2de8882de9539de7c7ba0dc -size 1539841 +oid sha256:136ff37db596651bce06d56a8138592ba6e0b457ac8b78591f8a0d66effe4552 +size 1532287 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png index 4aec5083..db3320a5 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42d3fad40467bfbbc1fb8e4716b360ec751fed0035a9c212ae01c9882dad736d -size 1601805 +oid sha256:179d20a9ef0fdb1690935a4e641194834514d818d8c7618fc0b1f95bf1884cca +size 1587265 From efd6abe24ee4d7c6765888f56b8a3c426be5567f Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 29 Apr 2022 22:03:33 -0700 Subject: [PATCH 20/81] Updated 002_parallaxpdo.png again after adjusting shadow factor setting for this material Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardMultilayerPBR/002_parallaxpdo.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png index ea57fae9..44a77b01 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c7968bae39f38dea56a2b82d047b5751fc347537ef4c64f4fe790084d07afc6 -size 1546330 +oid sha256:66bbfc82db795b72d3b82a40dd9bfc7738508376de75de98a23531d6a3176cc2 +size 1443084 From 068c1bed29fb882d281ddf47f49d6d9b8f5b2a18 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 2 May 2022 14:30:18 -0700 Subject: [PATCH 21/81] Updated various baseline screenshots that show minor lighting differences that appear benign, just some inconsequential (relative to the intent of these particular samples) changes that happened sometime in the past year. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/ExpectedScreenshots/Shadow/directional_initial.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/initial.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/010_ambientocclusion.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/013_specularaa_off.png | 4 ++-- Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png | 4 ++-- .../StandardPBR/100_uvtiling_ambientocclusion.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_rotate20.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_rotate90.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_scaleonlyu.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_scaleonlyv.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_scaleuniform.png | 4 ++-- .../StandardPBR/100_uvtiling_normal_dome_transformall.png | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_initial.png b/Scripts/ExpectedScreenshots/Shadow/directional_initial.png index bc9f12f8..7f72997f 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a969ba21b419e3b9adc82bd84d36574f7ff44f5906d2d03afac893066166aa4 -size 172011 +oid sha256:8b91d9742d396630372218ed8ca3845c0b1d1bc750d8b26c64f90c39e98462a5 +size 169323 diff --git a/Scripts/ExpectedScreenshots/Shadow/initial.png b/Scripts/ExpectedScreenshots/Shadow/initial.png index 5418aa04..3e593e7f 100644 --- a/Scripts/ExpectedScreenshots/Shadow/initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09a9604ebdebf657e8eca79f86ea72de5d9973c943bc53d5c685806ad638c354 -size 245005 +oid sha256:dcb7dc110b4e9f71e474dacde70bd55a587c1c8097aa34b1b1255d6888ae6a92 +size 245634 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png index 8e17d479..dd37cf6b 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d458ac81048b455e23bf8841475259a67b77954767acbc028af8db567b435321 -size 1032935 +oid sha256:bc2a9a6e38c90b292093be34e7f14633ce1982507c771a18977d47e7233713f9 +size 1190199 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png index da252472..7e2787d1 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:990b9673ec4c66fdf26fc25bb5b22d2fdd3b69620dec2bb00191386e043b2497 -size 1355903 +oid sha256:e8945bb142e7c17c136f74ec6cec0a7d8edf4c9fe6437b0d31e796430396b360 +size 1314827 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png index 41f64104..0a597e0f 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88f88bda03fa2bf20f3abc835052eb9ad66a12a0f8414f7ccb7c88c1f4d98f30 -size 1474798 +oid sha256:6313898872e6e7b1163c4faaf4b1f383bd77caa491403b1a0ac7916fde7f7f62 +size 1357757 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png index 748a5057..ea68a717 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:22baa7304725880d03893893ccf747367a7af8ef5fb5feeeeb912974a6253636 -size 1108493 +oid sha256:493bbf1511f6c52649236bb5a6a774c793829a2b6123cf6d37aaa808539946d2 +size 1131678 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png index e05eaa47..67f74711 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:596a25dc6315127184e2046ff7e9932ef88556fef13666d8a72afc27a4021a8c -size 1072758 +oid sha256:e1f3ef4150fdd1d70d7b78ab5c4a7f5a974821635298374bdc87cc9ba5d67fb0 +size 1170348 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate20.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate20.png index 1354564c..5cc8d810 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate20.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate20.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a52ea7c3fbf92446f1ec190ba79b553d2275a89ba990c22f6756d8bad1cc439 -size 204874 +oid sha256:7adee45468a3195daa15c5ef13373fda0b2906125dee90377f6691f3f70b9fca +size 261164 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate90.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate90.png index 01bc8ea1..eba66f0b 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate90.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_rotate90.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9badacca4c23f1348e42e22578f080eeded63deb2011d2351ed291430a15d76b -size 191312 +oid sha256:c5f674b20db3a9d5f7712ef8a0653baf9b2ae05154984d4f27f76bda71425ff7 +size 248103 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyu.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyu.png index 737307c7..a2f9de1b 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyu.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyu.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b8cbed28de7f66bef3224e50acb989237f4012f08b2b705ce4630922b781eeb2 -size 211511 +oid sha256:c9c564f389444c0ca1d5e8f6012ee4ce7dd35569d091261dcb3989c2f28d65c2 +size 272813 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyv.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyv.png index adf26634..7bdf7fc6 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyv.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleonlyv.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd69a0b166f8ca9f1ff8ffe197a741509b431eca158516eb09cd90a978ca28f1 -size 242081 +oid sha256:11cdb4256e4f9ed4497c159a4dec95fbf65ee08da9fa15616cf7ef183151ba8a +size 293542 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleuniform.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleuniform.png index d2d26a49..522ff21b 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleuniform.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_scaleuniform.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbe71c0c71fdadbcd2c141604bf6fa10a9ee345c159e452df0cc765b751f576a -size 343985 +oid sha256:ce392eedef96e50e61d8853f3f8956cf469e389798e8551707f34ae9a934caa8 +size 404854 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_transformall.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_transformall.png index a74bc024..dbcaeddf 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_transformall.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal_dome_transformall.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe82acb3ff70077fb1404c1eaa906d5b5cd67c664371cfb1747d2a59c08fd6ec -size 248992 +oid sha256:7e93586017c5dd903eb16257231264fac792a4048bb82dc189752e95f21165f4 +size 311328 From c726a5167962a4e89d249fd49e8ef73110d6ba04 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 4 May 2022 00:21:09 -0700 Subject: [PATCH 22/81] Updated some baseline screenshots that were minorly impacted by normalizing interpolated vertex normals, at commit e08768cef5d2c7c2d659c5b9ce7d57aab6baeab9. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardPBR/101_detailmaps_basenodetailmaps.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/102_detailmaps_all.png | 4 ++-- .../StandardPBR/103_detailmaps_basecolor.png | 4 ++-- .../StandardPBR/103_detailmaps_basecolorwithmask.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png | 4 ++-- .../StandardPBR/104_detailmaps_normalwithmask.png | 4 ++-- .../StandardPBR/105_detailmaps_blendmaskusingdetailuvs.png | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Scripts/ExpectedScreenshots/StandardPBR/101_detailmaps_basenodetailmaps.png b/Scripts/ExpectedScreenshots/StandardPBR/101_detailmaps_basenodetailmaps.png index 610ddc30..7d3d44fd 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/101_detailmaps_basenodetailmaps.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/101_detailmaps_basenodetailmaps.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a781a351ecbce43ee86f1b6dfd143684fe44e1b7fd6707729b1b96225f52a42f -size 1951863 +oid sha256:52af7a5e4bf39d1ab465e07647fdd9f622bae06c40029cdbfee7bb37342a8a06 +size 1951062 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png b/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png index 550b373f..377d299a 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/102_detailmaps_all.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0634b525cf9652c4f5efc13851eefd002620156dfbcb26476f98370dcaff0596 -size 2149598 +oid sha256:a7bd153305e30865811fd1ef43e1d69284a8193c18c98484fde48cf5f9c93299 +size 2143842 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolor.png b/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolor.png index f6020e30..f37e2c29 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolor.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolor.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6cc0a4998b3b1d0aa1d5bdb8d904644cc9c0427db5b138d3608c215db7431189 -size 2026718 +oid sha256:a6c4e960afb90fc9492f21e50c9b01c8b4c65582f9146f03b13b46e0359194e4 +size 2025895 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolorwithmask.png b/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolorwithmask.png index a6089956..6411ce1d 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolorwithmask.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/103_detailmaps_basecolorwithmask.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93247bc22529055042f7816339e91991b26a1da28064c1de7971e20b46156a36 -size 2027064 +oid sha256:f636a21e0339062d6912286e7d842f4731a8258138039d9213c16b221e222a96 +size 2025933 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png index 374793a3..9349e197 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:873e4b4fd3c18ef638ecf793415835f39c4f66f013ff894a6d351c268174dd61 -size 2147663 +oid sha256:d27b457cc4cd56df235f0a60ff865f4420d645d0a38f334195715106c97cf783 +size 2141147 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png index da995ca2..009c993f 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed56d33312617bcd41843dbd5ca5f3ea957e58356a332e2464ce4b63febc5c1a -size 2038972 +oid sha256:068a8a190ca713ff99b5a6424a602626e59d685ee9ec41d7003b6b7302533105 +size 2033375 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/105_detailmaps_blendmaskusingdetailuvs.png b/Scripts/ExpectedScreenshots/StandardPBR/105_detailmaps_blendmaskusingdetailuvs.png index a6515eca..c401b36a 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/105_detailmaps_blendmaskusingdetailuvs.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/105_detailmaps_blendmaskusingdetailuvs.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14730af744f24b567fcf39f2c331027591cca8229b90768e68b59c773d1a9754 -size 2121594 +oid sha256:e05997db998afd634069075bcebd1f667a0316d64911659c19f33a8fe624590c +size 2115096 From a806cafbc2786b7774ff7a18e640d53a90127cb1 Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Wed, 4 May 2022 16:00:35 -0700 Subject: [PATCH 23/81] Update script manager with new interface from the ScriptAsset class Signed-off-by: Tommy Walton --- Gem/Code/Source/Automation/ScriptManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index 213d4f1a..4e4cf282 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -966,7 +966,8 @@ namespace AtomSampleViewer s_instance->m_executingScripts.insert(scriptAsset.GetId()); - if (!s_instance->m_scriptContext->Execute(scriptAsset->GetScriptBuffer().data(), scriptFilePath.c_str(), scriptAsset->GetScriptBuffer().size())) + if (!s_instance->m_scriptContext->Execute( + scriptAsset->m_data.GetScriptBuffer().data(), scriptFilePath.c_str(), scriptAsset->m_data.GetScriptBuffer().size())) { // Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost // in front of a bunch of queued m_scriptOperations. From 36915ae666b2024e3e808092f36d0aaf105a9d01 Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Wed, 4 May 2022 17:01:58 -0700 Subject: [PATCH 24/81] Use ScriptSystemRequestBus::Load event to execute the script instead of manually executing on the script context Signed-off-by: Tommy Walton --- Gem/Code/Source/Automation/ScriptManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index 4e4cf282..fe0ab8ce 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -966,8 +966,11 @@ namespace AtomSampleViewer s_instance->m_executingScripts.insert(scriptAsset.GetId()); - if (!s_instance->m_scriptContext->Execute( - scriptAsset->m_data.GetScriptBuffer().data(), scriptFilePath.c_str(), scriptAsset->m_data.GetScriptBuffer().size())) + bool executeSuccess = false; + AZ::ScriptSystemRequestBus::BroadcastResult( + executeSuccess, &AZ::ScriptSystemRequestBus::Events::Load, scriptAsset, AZ::k_scriptLoadBinaryOrText, + s_instance->m_scriptContext->GetId()); + if (!executeSuccess) { // Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost // in front of a bunch of queued m_scriptOperations. From 1e57837b44d9beed76b4411ffc5e76d1b22b36cc Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Thu, 5 May 2022 19:40:08 -0500 Subject: [PATCH 25/81] Copy the script fix from o3de Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index fe0ab8ce..d751b111 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -966,11 +966,8 @@ namespace AtomSampleViewer s_instance->m_executingScripts.insert(scriptAsset.GetId()); - bool executeSuccess = false; - AZ::ScriptSystemRequestBus::BroadcastResult( - executeSuccess, &AZ::ScriptSystemRequestBus::Events::Load, scriptAsset, AZ::k_scriptLoadBinaryOrText, - s_instance->m_scriptContext->GetId()); - if (!executeSuccess) + auto& scriptData = scriptAsset->m_data; + if (!s_instance->m_scriptContext->Execute(scriptData.GetScriptBuffer().data(), scriptFilePath.c_str(), scriptData.GetScriptBuffer().size())) { // Push an error operation on the back of the queue instead of reporting it immediately so it doesn't get lost // in front of a bunch of queued m_scriptOperations. From f69ecccc734cd6ba70dbe13040bdd395e3c29600 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 9 May 2022 14:57:07 -0700 Subject: [PATCH 26/81] adding a 'c' to the script command line argument so the luac is loaded Signed-off-by: Scott Murray --- .../PythonTests/Automated/benchmark_runner_periodic_suite.py | 4 ++-- .../PythonTests/Automated/test_AtomSampleViewer_main_suite.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Standalone/PythonTests/Automated/benchmark_runner_periodic_suite.py b/Standalone/PythonTests/Automated/benchmark_runner_periodic_suite.py index 99bac23c..c244fe39 100644 --- a/Standalone/PythonTests/Automated/benchmark_runner_periodic_suite.py +++ b/Standalone/PythonTests/Automated/benchmark_runner_periodic_suite.py @@ -37,7 +37,7 @@ def test_PerformanceBenchmarkPeriodicSuite(self, request, workspace, launcher_pl 'AtomSampleViewerStandalone.exe ' f'--project-path={workspace.paths.project()} ' f'--rhi {rhi} ' - f'--runtestsuite scripts/{benchmark_script} ' + f'--runtestsuite scripts/{benchmark_script}c ' '--exitontestend') def teardown(): @@ -48,7 +48,7 @@ def teardown(): process_utils.safe_check_call(cmd, stderr=subprocess.STDOUT, encoding='UTF-8', shell=True) try: expected_lines = ["Script: Capturing complete."] - atomsampleviewer_log_monitor.monitor_log_for_lines(expected_lines, timeout=180) + atomsampleviewer_log_monitor.monitor_log_for_lines(expected_lines, timeout=210) aggregator = BenchmarkDataAggregator(workspace, logger, 'periodic') aggregator.upload_metrics(rhi) diff --git a/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py b/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py index 9f004e79..dd71cbb9 100644 --- a/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py +++ b/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py @@ -37,7 +37,7 @@ def test_AutomatedReviewTestSuite(self, request, workspace, launcher_platform, r 'AtomSampleViewerStandalone.exe ' f'--project-path={workspace.paths.project()} ' f'--rhi {rhi} ' - f'--runtestsuite scripts/{test_script} ' + f'--runtestsuite scripts/{test_script}c ' '--exitontestend') def teardown(): From 0c9cc3c0451cb60df7b6903af9580c845d4d2d76 Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Thu, 12 May 2022 11:43:11 -0700 Subject: [PATCH 27/81] Fix buffer overrun and update bone transform code to us RPI function instead of WriteToBuffer util (#386) Signed-off-by: Tommy Walton --- .../RHI/TrianglesConstantBufferExampleComponent.cpp | 8 +------- .../Source/RHI/TrianglesConstantBufferExampleComponent.h | 3 --- Gem/Code/Source/SkinnedMeshContainer.cpp | 4 +++- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp b/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp index 32e890c9..bb3e4779 100644 --- a/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp +++ b/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.cpp @@ -87,11 +87,8 @@ namespace AtomSampleViewer colorMultiplier.StoreToFloat4(&trianglesData[triangleIdx].m_colorMultiplier[0]); } - // Calculate the alignment - const uint32_t alignment = RHI::AlignUp(static_cast(sizeof(InstanceInfo)), m_constantBufferAlighment); - // All triangles data will be uploaded in one go to the constant buffer once per frame. - UploadDataToConstantBuffer(trianglesData, alignment, s_numberOfTrianglesTotal); + UploadDataToConstantBuffer(trianglesData, static_cast(sizeof(InstanceInfo)), s_numberOfTrianglesTotal); BasicRHIComponent::OnFramePrepare(frameGraphBuilder); } @@ -116,9 +113,6 @@ namespace AtomSampleViewer RHI::Ptr device = Utils::GetRHIDevice(); - // Cache the alignment - m_constantBufferAlighment = device->GetLimits().m_minConstantBufferViewOffset; - AZ::RHI::PipelineStateDescriptorForDraw pipelineStateDescriptor; // Creates Input Assembly buffer and Streams/Index Views diff --git a/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.h b/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.h index b16643d1..7a13c5ec 100644 --- a/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.h +++ b/Gem/Code/Source/RHI/TrianglesConstantBufferExampleComponent.h @@ -103,9 +103,6 @@ namespace AtomSampleViewer AZ::RHI::Ptr m_constantBufferView; - // Cached Constant Buffer alignment queued from the device - uint32_t m_constantBufferAlighment = 0u; - // -------------------------------------------------------- // Pipeline state and SRG to be constructed from the shader // -------------------------------------------------------- diff --git a/Gem/Code/Source/SkinnedMeshContainer.cpp b/Gem/Code/Source/SkinnedMeshContainer.cpp index 4fd544b0..04247dd2 100644 --- a/Gem/Code/Source/SkinnedMeshContainer.cpp +++ b/Gem/Code/Source/SkinnedMeshContainer.cpp @@ -95,7 +95,9 @@ namespace AtomSampleViewer if (m_skinnedMeshInstances[i].m_boneTransformBuffer) { - AZ::Render::WriteToBuffer(m_skinnedMeshInstances[i].m_boneTransformBuffer->GetRHIBuffer(), m_skinnedMeshes[i].m_proceduralSkinnedMesh.m_boneMatrices); + m_skinnedMeshInstances[i].m_boneTransformBuffer->UpdateData( + m_skinnedMeshes[i].m_proceduralSkinnedMesh.m_boneMatrices.data(), + m_skinnedMeshes[i].m_proceduralSkinnedMesh.m_boneMatrices.size() * sizeof(AZ::Matrix3x4)); } } } From edc2dae470bc3b79b80ff83ed5327c431f752ca9 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Thu, 12 May 2022 13:51:54 -0500 Subject: [PATCH 28/81] Fixes for compile issue in the release config Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 4 +++- Gem/Code/Source/ShaderReloadTestComponent.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index d751b111..792974c0 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -1141,14 +1141,16 @@ namespace AtomSampleViewer s_instance->m_scriptOperations.push(AZStd::move(func)); } - void ScriptManager::Script_Print(const AZStd::string& message) + void ScriptManager::Script_Print(const AZStd::string& message [[maybe_unused]]) { +#ifndef RELEASE // AZ_TracePrintf is a no-op in release builds auto func = [message]() { AZ_TracePrintf("Automation", "Script: %s\n", message.c_str()); }; s_instance->m_scriptOperations.push(AZStd::move(func)); +#endif } AZStd::string ScriptManager::Script_ResolvePath(const AZStd::string& path) diff --git a/Gem/Code/Source/ShaderReloadTestComponent.cpp b/Gem/Code/Source/ShaderReloadTestComponent.cpp index 48122e8a..95d4ddfc 100644 --- a/Gem/Code/Source/ShaderReloadTestComponent.cpp +++ b/Gem/Code/Source/ShaderReloadTestComponent.cpp @@ -318,7 +318,7 @@ namespace AtomSampleViewer uint32_t ShaderReloadTestComponent::ReadPixel(const uint8_t* rawRGBAPixelData, const AZ::RHI::ImageDescriptor& imageDescriptor, uint32_t x, uint32_t y) const { const auto width = imageDescriptor.m_size.m_width; - const auto height = imageDescriptor.m_size.m_height; + [[maybe_unused]] const auto height = imageDescriptor.m_size.m_height; AZ_Assert((x < width) && (y < height), "Invalid read pixel location (x, y)=(%u, %u) for width=%u, height=%u", x, y, width, height); auto tmp = reinterpret_cast(rawRGBAPixelData); const uint32_t pixelColor = tmp[ (width * y) + x]; From f0a9ce869d1f6b9a16d44bb2861963f8c4f3c274 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 13 May 2022 19:23:19 -0700 Subject: [PATCH 29/81] Updated the MaterialHotReloadTest sample to report the actual shader variant being used by the MeshDrawPacket, rather than reporting what variant the material has requested. This gives more accurate results about what's being rendered, and revealed some edge cases where the expected variants weren't actually being used. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Source/MaterialHotReloadTestComponent.cpp | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Gem/Code/Source/MaterialHotReloadTestComponent.cpp b/Gem/Code/Source/MaterialHotReloadTestComponent.cpp index 97ff7dcc..6cda4c86 100644 --- a/Gem/Code/Source/MaterialHotReloadTestComponent.cpp +++ b/Gem/Code/Source/MaterialHotReloadTestComponent.cpp @@ -334,19 +334,32 @@ namespace AtomSampleViewer if (m_material) { - const ShaderVariantId variantId = m_material->GetShaderCollection()[0].GetShaderVariantId(); - auto searchResult = m_material->GetShaderCollection()[0].GetShaderAsset()->FindVariantStableId(variantId); - if (searchResult.IsFullyBaked()) + const Render::MeshDrawPacketLods& drawPackets = GetMeshFeatureProcessor()->GetDrawPackets(m_meshHandle); + if (!drawPackets.empty()) { - shaderVariantStatus = ShaderVariantStatus::FullyBaked; - } - else if (searchResult.IsRoot()) - { - shaderVariantStatus = ShaderVariantStatus::Root; - } - else - { - shaderVariantStatus = ShaderVariantStatus::PartiallyBaked; + AZ_Assert(drawPackets.size() == 1, "Expected exactly 1 LOD"); + AZ_Assert(drawPackets[0].size() == 1, "Expected exactly 1 mesh"); + AZ_Assert(drawPackets[0][0].GetMaterial() == m_material, "MeshDrawPacket didn't have the expected material."); + + const RPI::MeshDrawPacket::ShaderList& activeShaderList = drawPackets[0][0].GetActiveShaderList(); + + AZ_Assert(activeShaderList.size() == 1, "Expected exactly 1 active shader"); + + const ShaderVariantId activeVariantId = activeShaderList[0].m_activeShaderVariantId; + ShaderOptionGroup activeShaderOptions{activeShaderList[0].m_shader->GetAsset()->GetShaderOptionGroupLayout(), activeVariantId}; + + if (activeShaderOptions.IsFullySpecified()) + { + shaderVariantStatus = ShaderVariantStatus::FullyBaked; + } + else if (activeVariantId == activeShaderList[0].m_shader->GetVariant(RootShaderVariantStableId).GetShaderVariantId()) + { + shaderVariantStatus = ShaderVariantStatus::Root; + } + else + { + shaderVariantStatus = ShaderVariantStatus::PartiallyBaked; + } } } From 797bb79301540982470e5e83d51f4c285028db22 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 13 May 2022 19:24:56 -0700 Subject: [PATCH 30/81] Fixed an issue where ImGuiMaterialDetails wasn't showing the root variant. Also, updated to call GetVariantAsset instead of GetVariant, corresponding to the function being renamed in o3de. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/Utils/ImGuiMaterialDetails.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/Utils/ImGuiMaterialDetails.cpp b/Gem/Code/Source/Utils/ImGuiMaterialDetails.cpp index 9d6bdefb..5273baca 100644 --- a/Gem/Code/Source/Utils/ImGuiMaterialDetails.cpp +++ b/Gem/Code/Source/Utils/ImGuiMaterialDetails.cpp @@ -47,7 +47,12 @@ namespace AtomSampleViewer { AZ::RPI::ShaderVariantId requestedVariantId = shaderItem.GetShaderVariantId(); AZ::Data::Asset selectedVariantAsset = - shaderItem.GetShaderAsset()->GetVariant(requestedVariantId); + shaderItem.GetShaderAsset()->GetVariantAsset(requestedVariantId); + + if (!selectedVariantAsset) + { + selectedVariantAsset = shaderItem.GetShaderAsset()->GetRootVariantAsset(); + } if (selectedVariantAsset) { From 0299257c35011f84ca7a478afcf5fd5e17b35cac Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 13 May 2022 19:27:01 -0700 Subject: [PATCH 31/81] Added support for sorting results according to diff score against the local baseline images, in addition to the official baseline images. (This wasn't directly related the shader details tool work, but I happened to have these changes and it's convenient to just put them on the same feature branch). Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptReporter.cpp | 74 ++++++++++++++----- Gem/Code/Source/Automation/ScriptReporter.h | 16 +++- 2 files changed, 70 insertions(+), 20 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptReporter.cpp b/Gem/Code/Source/Automation/ScriptReporter.cpp index 87e08f46..d3bd09f4 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.cpp +++ b/Gem/Code/Source/Automation/ScriptReporter.cpp @@ -23,6 +23,11 @@ namespace AtomSampleViewer { "All Results", "Warnings & Errors", "Errors Only", }; + + static const char* SortOptions[] = + { + "Sort by Script", "Sort by Official Baseline Diff Score", "Sort by Local Baseline Diff Score", + }; namespace ScreenshotPaths { @@ -148,7 +153,8 @@ namespace AtomSampleViewer void ScriptReporter::Reset() { m_scriptReports.clear(); - m_descendingThresholdReports.clear(); + m_reportsSortedByOfficialBaslineScore.clear(); + m_reportsSortedByLocaBaslineScore.clear(); m_currentScriptIndexStack.clear(); m_invalidationMessage.clear(); m_uniqueTimestamp = GenerateTimestamp(); @@ -422,7 +428,10 @@ namespace AtomSampleViewer ImGui::Combo("Display", &displayOption, DiplayOptions, AZ_ARRAY_SIZE(DiplayOptions)); m_displayOption = (DisplayOption)displayOption; - ImGui::Checkbox("Show Script Reports Sorted By Threshold", &m_showReportsSortedByThreshold); + int sortOption = m_currentSortOption; + ImGui::Combo("Sort Results", &sortOption, SortOptions, AZ_ARRAY_SIZE(SortOptions)); + m_currentSortOption = (SortOption)sortOption; + ImGui::Checkbox("Force Show 'Update' Buttons", &m_forceShowUpdateButtons); ImGui::Checkbox("Force Show 'Export Png Diff' Buttons", &m_forceShowExportPngDiffButtons); @@ -431,7 +440,7 @@ namespace AtomSampleViewer ImGui::Separator(); - if (!m_showReportsSortedByThreshold) + if (m_currentSortOption == SortOption::Unsorted) { for (ScriptReport& scriptReport : m_scriptReports) { @@ -540,24 +549,49 @@ namespace AtomSampleViewer } else { - for (const auto& [threshold, reportIndex] : m_descendingThresholdReports) + const SortedReportIndexMap* sortedReportMap = nullptr; + if (m_currentSortOption == SortOption::OfficialBaselineDiffScore) + { + sortedReportMap = &m_reportsSortedByOfficialBaslineScore; + } + else if (m_currentSortOption == SortOption::LocalBaselineDiffScore) { - ScriptReport& scriptReport = m_scriptReports[reportIndex.first]; - ScreenshotTestInfo& screenshotResult = scriptReport.m_screenshotTests[reportIndex.second]; + sortedReportMap = &m_reportsSortedByLocaBaslineScore; + } - const bool screenshotPassed = screenshotResult.m_officialComparisonResult.m_resultCode == ImageComparisonResult::ResultCode::Pass; + AZ_Assert(sortedReportMap, "Unhandled m_currentSortOption"); - AZStd::string fileName; - AzFramework::StringFunc::Path::GetFullFileName(screenshotResult.m_screenshotFilePath.c_str(), fileName); + if (sortedReportMap) + { + for (const auto& [threshold, reportIndex] : *sortedReportMap) + { + ScriptReport& scriptReport = m_scriptReports[reportIndex.first]; + ScreenshotTestInfo& screenshotResult = scriptReport.m_screenshotTests[reportIndex.second]; - AZStd::string header = AZStd::string::format("%s %s %s '%s' %f", - screenshotPassed ? "PASSED" : "FAILED", - scriptReport.m_scriptAssetPath.c_str(), - fileName.c_str(), - screenshotResult.m_toleranceLevel.m_name.c_str(), - screenshotResult.m_officialComparisonResult.m_finalDiffScore); + float diffScore = 0.0f; + if (m_currentSortOption == SortOption::OfficialBaselineDiffScore) + { + diffScore = screenshotResult.m_officialComparisonResult.m_standardDiffScore; + } + else if (m_currentSortOption == SortOption::LocalBaselineDiffScore) + { + diffScore = screenshotResult.m_localComparisonResult.m_standardDiffScore; + } + + const bool screenshotPassed = screenshotResult.m_officialComparisonResult.m_resultCode == ImageComparisonResult::ResultCode::Pass; + + AZStd::string fileName; + AzFramework::StringFunc::Path::GetFullFileName(screenshotResult.m_screenshotFilePath.c_str(), fileName); - ShowScreenshotTestInfoTreeNode(header, scriptReport, screenshotResult); + AZStd::string header = AZStd::string::format("%f %s %s %s '%s'", + diffScore, + screenshotPassed ? "PASSED" : "FAILED", + scriptReport.m_scriptAssetPath.c_str(), + fileName.c_str(), + screenshotResult.m_toleranceLevel.m_name.c_str()); + + ShowScreenshotTestInfoTreeNode(header, scriptReport, screenshotResult); + } } } ResetTextHighlight(); @@ -822,8 +856,12 @@ namespace AtomSampleViewer const AZStd::vector& screenshotTestInfos = m_scriptReports[i].m_screenshotTests; for (size_t j = 0; j < screenshotTestInfos.size(); ++j) { - m_descendingThresholdReports.insert(AZStd::pair( - screenshotTestInfos[j].m_officialComparisonResult.m_finalDiffScore, + m_reportsSortedByOfficialBaslineScore.insert(AZStd::pair( + screenshotTestInfos[j].m_officialComparisonResult.m_standardDiffScore, + ReportIndex{ i, j })); + + m_reportsSortedByLocaBaslineScore.insert(AZStd::pair( + screenshotTestInfos[j].m_localComparisonResult.m_standardDiffScore, ReportIndex{ i, j })); } } diff --git a/Gem/Code/Source/Automation/ScriptReporter.h b/Gem/Code/Source/Automation/ScriptReporter.h index 1b92677f..64077c6d 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.h +++ b/Gem/Code/Source/Automation/ScriptReporter.h @@ -224,6 +224,15 @@ namespace AtomSampleViewer WarningsAndErrors, ErrorsOnly }; + + // Controls how screenshot reports are sorted + // Must match static const char* DiplayOptions in .cpp file + enum SortOption : int + { + Unsorted, + OfficialBaselineDiffScore, + LocalBaselineDiffScore + }; static void ReportScriptError(const AZStd::string& message); static void ReportScriptWarning(const AZStd::string& message); @@ -289,8 +298,11 @@ namespace AtomSampleViewer void UpdateColorSettings(); }; - AZStd::multimap> m_descendingThresholdReports; - bool m_showReportsSortedByThreshold = true; + using SortedReportIndexMap = AZStd::multimap>; + + SortedReportIndexMap m_reportsSortedByOfficialBaslineScore; + SortedReportIndexMap m_reportsSortedByLocaBaslineScore; + SortOption m_currentSortOption = SortOption::OfficialBaselineDiffScore; ImGuiMessageBox m_messageBox; From 3478a0b7ffe8b6dd68d564ad153f0b8aa837bd03 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 13 May 2022 22:19:28 -0700 Subject: [PATCH 32/81] Updated MaterialHotReloadTest to configure a shorter delay for the ShaderVariantAsyncLoader thread, so the IdleSeconds times can be reduced. This sortens the test execution time by about 5 seconds, while also preventing intermittent timing failures especially in debug builds. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 2 +- Scripts/MaterialHotReloadTest.bv.lua | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index d751b111..b8bf55b4 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -1371,7 +1371,7 @@ namespace AtomSampleViewer { auto operation = [command]() { - AzFramework::ConsoleRequestBus::Broadcast(&AzFramework::ConsoleRequests::ExecuteConsoleCommand, command.c_str()); + AZ::Interface::Get()->PerformCommand(command.c_str()); }; s_instance->m_scriptOperations.push(AZStd::move(operation)); diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index e3df3684..1a2d56c8 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -19,6 +19,10 @@ ResizeViewport(500, 500) SelectImageComparisonToleranceLevel("Level E") +-- The default ShaderVariantAsyncLoader service loop delay is too long and would require this +-- test script to use too long in IdleSeconds() +ExecuteConsoleCommand("r_ShaderVariantAsyncLoader_ServiceLoopDelayOverride_ms 10") + function SetColorRed() AssetTracking_Start() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material") @@ -33,7 +37,7 @@ function SetBlendingOn() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) - IdleSeconds(1) -- Idle for a bit to give time for the assets to reload + IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload end function SetBlendingOff() @@ -42,7 +46,7 @@ function SetBlendingOff() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) - IdleSeconds(1) -- Idle for a bit to give time for the assets to reload + IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload end CaptureScreenshot(g_screenshotOutputFolder .. '/01_Default.png') @@ -76,7 +80,7 @@ SetImguiValue('Vertical Pattern', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(1) -- Idle for a bit to give time for the assets to reload +IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload CaptureScreenshot(g_screenshotOutputFolder .. '/06_VerticalPattern.png') SetBlendingOn() @@ -87,7 +91,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/All', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(1) -- Idle for a bit to give time for the assets to reload +IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload CaptureScreenshot(g_screenshotOutputFolder .. '/08_Variants_All.png') -- This will switch to showing the "Shader Variant: Root" message @@ -125,7 +129,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/All', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(1) -- Idle for a bit to give time for the assets to reload +IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload CaptureScreenshot(g_screenshotOutputFolder .. '/13_Variants_All.png') -- Now that the material is using a fully-baked variant, modify the .azsl file to force *everything* to rebuild. In the failure case, the runtime -- holds onto the old fully-baked variant even though a new root variant is available. In the correct case, the root variant should take priority @@ -150,3 +154,5 @@ SetBlendingOff() SetColorRed() CaptureScreenshot(g_screenshotOutputFolder .. '/15_Red_AfterShaderReload.png') +-- Clear the service loop override back to the default delay +ExecuteConsoleCommand("r_ShaderVariantAsyncLoader_ServiceLoopDelayOverride_ms 0") From 95dc68753dc0747cb032f82e63b239f67b8d8acf Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 13 May 2022 22:44:05 -0700 Subject: [PATCH 33/81] Updated the MaterialHotReloadTest "14_HorizontalPattern.png" step to wait for the .shadervariantlist to finish processing. This fixes an intermittent failure (8/30) where sometimes it would have the root variant and sometimes the baked variant. Now it consistently has the baked variant. There was note in the script (originally written by me) about trying to hit a specific time window to test that the new shader was used as soon as possible. This test case was originally used to validate the ShaderAsset m_buildTimestamp check, but even when I commented out that check the test still passed. So considering that the original edge case is no longer enforced by this check (I guess some other improvement is also addressing the edge case), I decided it wasn't worth the intermittent failures. The main aspect of the test case (making sure we see the horizontal pattern rather than the vertical one) is still intact. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Scripts/MaterialHotReloadTest.bv.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index 1a2d56c8..8e9ef3af 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -136,15 +136,10 @@ CaptureScreenshot(g_screenshotOutputFolder .. '/13_Variants_All.png') -- over the fully-baked variant because it is more recent. AssetTracking_Start() SetImguiValue('Horizontal Pattern', true) --- Note that here we explicitly do NOT wait for HotReloadTest.shadervariantlist even though the ShaderVariantAssets will be rebuild here too; --- part of this test is to ensure the updated shader code is used as soon as the root variant is available. AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") +AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) --- We want this idle to be short enough that the ShaderVariantAssets don't have time to finish building before we take the screenshot, as part --- of the validation that the root variant gets applied asap. But it also needs to be long enough to account for some delay between the --- AssetTracking utility and the asset system triggering the reload. We should avoid increasing this if possible (but maybe we'll have no --- choice ... we'll see) IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png') From 2b01ff9fe8bfe4b00eb236487de59e5ab11ac5dc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 16 May 2022 14:53:13 -0700 Subject: [PATCH 34/81] Depth Of Field screenshot test Signed-off-by: Scott Murray --- Scripts/DepthOfFieldTest.bv.lua | 23 +++++++++++++++++++ .../screenshot_depth_of_field.png | 3 +++ Scripts/_FullTestSuite_.bv.lua | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Scripts/DepthOfFieldTest.bv.lua create mode 100644 Scripts/ExpectedScreenshots/DepthOfFieldTest/screenshot_depth_of_field.png diff --git a/Scripts/DepthOfFieldTest.bv.lua b/Scripts/DepthOfFieldTest.bv.lua new file mode 100644 index 00000000..d8e47982 --- /dev/null +++ b/Scripts/DepthOfFieldTest.bv.lua @@ -0,0 +1,23 @@ +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/DepthOfFieldTest/') +Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) + +OpenSample('Features/DepthOfField') +ResizeViewport(800, 600) +SelectImageComparisonToleranceLevel("Level D") + +IdleSeconds(5) + +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_depth_of_field.png') + +OpenSample(nil) \ No newline at end of file diff --git a/Scripts/ExpectedScreenshots/DepthOfFieldTest/screenshot_depth_of_field.png b/Scripts/ExpectedScreenshots/DepthOfFieldTest/screenshot_depth_of_field.png new file mode 100644 index 00000000..67ae16d6 --- /dev/null +++ b/Scripts/ExpectedScreenshots/DepthOfFieldTest/screenshot_depth_of_field.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7b2e6a462b7e1590dd3510cd227c144b8ea4e6b6f63da01b537400ed30682d2 +size 179921 diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index cb2e4413..9c07e508 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -67,6 +67,7 @@ tests= { RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'), RunScriptWrapper('scripts/PassTree.bv.luac'), RunScriptWrapper('scripts/ReadbackTest.bv.luac'), + RunScriptWrapper('scripts/depthoffieldtest.bv.luac'), --Fast checking for the samples which don't have a test. Samples should be removed from this list once they have their own tests @@ -101,7 +102,6 @@ tests= { FastCheckSample('RPI/RootConstants'), FastCheckSample('Features/Bloom'), - FastCheckSample('Features/DepthOfField'), FastCheckSample('Features/Exposure'), FastCheckSample('Features/SkinnedMesh'), FastCheckSample('Features/SSAO'), From ad17c8641867e5653f012441004507d767d24e97 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 16 May 2022 14:55:30 -0700 Subject: [PATCH 35/81] adding end of file newline to script Signed-off-by: Scott Murray --- Scripts/DepthOfFieldTest.bv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/DepthOfFieldTest.bv.lua b/Scripts/DepthOfFieldTest.bv.lua index d8e47982..954bb628 100644 --- a/Scripts/DepthOfFieldTest.bv.lua +++ b/Scripts/DepthOfFieldTest.bv.lua @@ -20,4 +20,4 @@ IdleSeconds(5) CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_depth_of_field.png') -OpenSample(nil) \ No newline at end of file +OpenSample(nil) From e76fa67d6b356b68b8ce714463d7fb566139210f Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Fri, 1 Apr 2022 17:10:53 -0700 Subject: [PATCH 36/81] Added AZ::IO::Streamer's profiler. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- Gem/Code/Source/SampleComponentManager.cpp | 38 +++++++++++++++++++--- Gem/Code/Source/SampleComponentManager.h | 2 ++ Gem/Code/enabled_gems.cmake | 1 + 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index c7f84634..aca71c86 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -111,6 +111,7 @@ #include #include #include +#include #include #include #include @@ -142,10 +143,11 @@ namespace AtomSampleViewer { namespace { - const char* PassTreeToolName = "PassTree"; - const char* CpuProfilerToolName = "CPU Profiler"; - const char* GpuProfilerToolName = "GPU Profiler"; - const char* TransientAttachmentProfilerToolName = "Transient Attachment Profiler"; + constexpr const char* PassTreeToolName = "PassTree"; + constexpr const char* CpuProfilerToolName = "CPU Profiler"; + constexpr const char* GpuProfilerToolName = "GPU Profiler"; + constexpr const char* FileIoProfilerToolName = "File IO Profiler"; + constexpr const char* TransientAttachmentProfilerToolName = "Transient Attachment Profiler"; } bool IsValidNumMSAASamples(int numSamples) @@ -830,6 +832,11 @@ namespace AtomSampleViewer ShowGpuProfilerWindow(); } + if (m_showFileIoProfiler) + { + ShowFileIoProfilerWindow(); + } + if (m_showTransientAttachmentProfiler) { ShowTransientAttachmentProfilerWindow(); @@ -1007,6 +1014,16 @@ namespace AtomSampleViewer Utils::ReportScriptableAction("ShowTool('%s', %s)", CpuProfilerToolName, m_showCpuProfiler ? "true" : "false"); } + if (AZ::IO::StreamerProfiler::Get() != nullptr) + { + if (ImGui::MenuItem(FileIoProfilerToolName)) + { + m_showFileIoProfiler = !m_showFileIoProfiler; + Utils::ReportScriptableAction( + "ShowTool('%s', %s)", FileIoProfilerToolName, m_showFileIoProfiler ? "true" : "false"); + } + } + if (ImGui::MenuItem(GpuProfilerToolName)) { m_showGpuProfiler = !m_showGpuProfiler; @@ -1101,6 +1118,14 @@ namespace AtomSampleViewer } } + void SampleComponentManager::ShowFileIoProfilerWindow() + { + if (auto profilerImGui = AZ::IO::StreamerProfiler::Get(); profilerImGui) + { + profilerImGui->DrawStatistics(m_showFileIoProfiler); + } + } + void SampleComponentManager::ShowGpuProfilerWindow() { m_imguiGpuProfiler.Draw(m_showGpuProfiler, AZ::RPI::PassSystemInterface::Get()->GetRootPass()); @@ -1414,6 +1439,11 @@ namespace AtomSampleViewer m_showCpuProfiler = enable; return true; } + else if (toolName == FileIoProfilerToolName) + { + m_showFileIoProfiler = enable; + return true; + } else if (toolName == GpuProfilerToolName) { m_showGpuProfiler = enable; diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index 68dcde7e..9582b1d0 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -137,6 +137,7 @@ namespace AtomSampleViewer void ShowFrameGraphVisualizerWindow(); void ShowCpuProfilerWindow(); void ShowGpuProfilerWindow(); + void ShowFileIoProfilerWindow(); void ShowShaderMetricsWindow(); void ShowTransientAttachmentProfilerWindow(); @@ -210,6 +211,7 @@ namespace AtomSampleViewer bool m_showCullingDebugWindow = false; bool m_showCpuProfiler = false; bool m_showGpuProfiler = false; + bool m_showFileIoProfiler = false; bool m_showTransientAttachmentProfiler = false; bool m_showShaderMetrics = false; diff --git a/Gem/Code/enabled_gems.cmake b/Gem/Code/enabled_gems.cmake index caf591f8..9f4b804e 100644 --- a/Gem/Code/enabled_gems.cmake +++ b/Gem/Code/enabled_gems.cmake @@ -22,4 +22,5 @@ set(ENABLED_GEMS Sponza MaterialEditor UiBasics + StreamerProfiler ) From 4bc8b074a0b307488fadc6b20795e9c58e3c7128 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 17 May 2022 18:04:36 -0700 Subject: [PATCH 37/81] updating ASV materials for fullscreen shadow changes Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Materials/DynamicMaterialTest/EmissiveMaterial.azsl | 5 +---- Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Materials/DynamicMaterialTest/EmissiveMaterial.azsl b/Materials/DynamicMaterialTest/EmissiveMaterial.azsl index d50e5644..2811f35a 100644 --- a/Materials/DynamicMaterialTest/EmissiveMaterial.azsl +++ b/Materials/DynamicMaterialTest/EmissiveMaterial.azsl @@ -93,9 +93,6 @@ ForwardPassOutput MainPS(VSOutput IN) lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); lightingData.Init(surface.position, surface.normal, surface.roughnessLinear); - // Shadow, Occlusion - lightingData.shadowCoords = IN.m_shadowCoords; - // Emissive float3 emissive = MaterialSrg::m_emissiveColor.rgb * MaterialSrg::m_emissiveIntensity; if (o_emissive_useTexture) @@ -117,7 +114,7 @@ ForwardPassOutput MainPS(VSOutput IN) ApplyDecals(lightingData.tileIterator, surface); // Apply Direct Lighting - ApplyDirectLighting(surface, lightingData); + ApplyDirectLighting(surface, lightingData, IN.m_position); // Apply Image Based Lighting (IBL) ApplyIBL(surface, lightingData); diff --git a/Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl b/Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl index bc4b70c5..993b32be 100644 --- a/Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl +++ b/Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl @@ -122,9 +122,6 @@ ForwardPassOutput MinimalMultilayerPBR_MainPassPS(VSOutput IN) lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); lightingData.Init(surface.position, surface.normal, surface.roughnessLinear); - // Shadow, Occlusion - lightingData.shadowCoords = IN.m_shadowCoords; - // Diffuse and Specular response lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); lightingData.diffuseResponse = 1.0f - lightingData.specularResponse; @@ -137,7 +134,7 @@ ForwardPassOutput MinimalMultilayerPBR_MainPassPS(VSOutput IN) ApplyDecals(lightingData.tileIterator, surface); // Apply Direct Lighting - ApplyDirectLighting(surface, lightingData); + ApplyDirectLighting(surface, lightingData, IN.m_position); // Apply Image Based Lighting (IBL) ApplyIBL(surface, lightingData); From 82c2ffd05a82d16e9aec4b8171b2f1189120c7e9 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 18 May 2022 11:20:46 -0700 Subject: [PATCH 38/81] bumping the timout for the test run Signed-off-by: Scott Murray --- .../PythonTests/Automated/test_AtomSampleViewer_main_suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py b/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py index dd71cbb9..c22dfdf5 100644 --- a/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py +++ b/Standalone/PythonTests/Automated/test_AtomSampleViewer_main_suite.py @@ -52,7 +52,7 @@ def teardown(): "Trace::Assert", "Traceback (most recent call last):"] atomsampleviewer_log_monitor.monitor_log_for_lines( - unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=240) + unexpected_lines=unexpected_lines, halt_on_unexpected=True, timeout=400) except ly_test_tools.log.log_monitor.LogMonitorException as e: expected_screenshots_path = os.path.join( workspace.paths.project(), "Scripts", "ExpectedScreenshots") From d123490be1b15a483127ec77f5d5c68c59d09e6f Mon Sep 17 00:00:00 2001 From: Tommy Walton Date: Thu, 19 May 2022 10:14:46 -0700 Subject: [PATCH 39/81] Added a new screenshot test for skinned meshes and fixed a crash that would occur after running out of memory if you create too large of a skinned mesh in the sample. (#445) Signed-off-by: Tommy Walton --- Gem/Code/Source/SkinnedMeshContainer.cpp | 7 ++-- .../SkinnedMesh/screenshot_skinnedmesh.png | 3 ++ Scripts/SkinnedMesh.bv.lua | 32 +++++++++++++++++++ Scripts/_FullTestSuite_.bv.lua | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 Scripts/ExpectedScreenshots/SkinnedMesh/screenshot_skinnedmesh.png create mode 100644 Scripts/SkinnedMesh.bv.lua diff --git a/Gem/Code/Source/SkinnedMeshContainer.cpp b/Gem/Code/Source/SkinnedMeshContainer.cpp index 04247dd2..9ea0194f 100644 --- a/Gem/Code/Source/SkinnedMeshContainer.cpp +++ b/Gem/Code/Source/SkinnedMeshContainer.cpp @@ -27,7 +27,7 @@ namespace { - static const char* const SkinnedMeshMaterial = "shaders/debugvertexnormals.azmaterial"; + static const char* const SkinnedMeshMaterial = "materials/special/debugvertexstreams.azmaterial"; } namespace AtomSampleViewer @@ -225,7 +225,10 @@ namespace AtomSampleViewer // Release the per-instance data RenderData& renderData = m_skinnedMeshInstances[i]; m_skinnedMeshFeatureProcessor->ReleaseSkinnedMesh(renderData.m_skinnedMeshHandle); - m_meshFeatureProcessor->ReleaseMesh(*renderData.m_meshHandle); + if (renderData.m_meshHandle) + { + m_meshFeatureProcessor->ReleaseMesh(*renderData.m_meshHandle); + } renderData.m_skinnedMeshInstance.reset(); renderData.m_boneTransformBuffer.reset(); diff --git a/Scripts/ExpectedScreenshots/SkinnedMesh/screenshot_skinnedmesh.png b/Scripts/ExpectedScreenshots/SkinnedMesh/screenshot_skinnedmesh.png new file mode 100644 index 00000000..944a2d97 --- /dev/null +++ b/Scripts/ExpectedScreenshots/SkinnedMesh/screenshot_skinnedmesh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7ff2973787e511b0927d7fd925d1812d6219792f2fe73b64441584ca8642d3b +size 113018 diff --git a/Scripts/SkinnedMesh.bv.lua b/Scripts/SkinnedMesh.bv.lua new file mode 100644 index 00000000..d96f93c6 --- /dev/null +++ b/Scripts/SkinnedMesh.bv.lua @@ -0,0 +1,32 @@ +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/SkinnedMesh/') +Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) + +OpenSample('Features/SkinnedMesh') +ResizeViewport(1600, 900) +SelectImageComparisonToleranceLevel("Level B") + +SetImguiValue('Sub-mesh count', 3) +SetImguiValue('Bones Per-Mesh', 78) +SetImguiValue('Vertices Per-Segment', 693) +SetImguiValue('Segments Per-Mesh', 65.000000) +SetImguiValue('Use Fixed Animation Time', true) +SetImguiValue('Fixed Animation Time', 4.751000) +SetImguiValue('Draw bones', false) + +NoClipCameraController_SetPosition(Vector3(-0.125466, -2.129441, 1.728536)) +NoClipCameraController_SetHeading(DegToRad(-8.116900)) +NoClipCameraController_SetPitch(DegToRad(-31.035244)) +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_skinnedmesh.png') + +OpenSample(nil) \ No newline at end of file diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index 9c07e508..d06327eb 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -64,6 +64,7 @@ tests= { RunScriptWrapper('scripts/multiscene.bv.luac'), RunScriptWrapper('scripts/shadowtest.bv.luac'), RunScriptWrapper('scripts/shadowedsponzatest.bv.luac'), + RunScriptWrapper('scripts/skinnedmesh.bv.luac'), RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'), RunScriptWrapper('scripts/PassTree.bv.luac'), RunScriptWrapper('scripts/ReadbackTest.bv.luac'), From 91301a00c0028e35d811c2da1ee88988f477e716 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 24 May 2022 18:21:50 -0700 Subject: [PATCH 40/81] ASV update for Fullscreen Shadows Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Passes/SsaoPipeline.pass | 11 +++++++++-- Scripts/ExpectedScreenshots/AutoBrick/brick.png | 4 ++-- Scripts/ExpectedScreenshots/AutoBrick/tile.png | 4 ++-- .../CullingAndLod/screenshot_1.png | 4 ++-- .../MinimalPBR/minimalpbr_default.png | 4 ++-- .../MinimalPBR/minimalpbr_reddielectric.png | 4 ++-- .../MultiRenderPipeline/Start_window2.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/initial.png | 4 ++-- .../ShadowedSponza/directional_filter.png | 4 ++-- .../ShadowedSponza/directional_nofilter.png | 4 ++-- .../StandardPBR/001_defaultwhite.png | 4 ++-- .../007_multiscatteringcompensationoff.png | 4 ++-- .../StandardPBR/007_multiscatteringcompensationon.png | 4 ++-- .../StandardPBR/012_parallax_pom_cutout.png | 4 ++-- .../StandardPBR/015_subsurfacescattering.png | 4 ++-- .../015_subsurfacescattering_transmission.png | 4 ++-- .../015_subsurfacescattering_transmission_thin.png | 4 ++-- Scripts/_FullTestSuite_.bv.lua | 6 ++++-- 18 files changed, 45 insertions(+), 36 deletions(-) diff --git a/Passes/SsaoPipeline.pass b/Passes/SsaoPipeline.pass index c95315b8..3e058bca 100644 --- a/Passes/SsaoPipeline.pass +++ b/Passes/SsaoPipeline.pass @@ -57,7 +57,7 @@ { "LocalSlot": "SwapChainOutput", "AttachmentRef": { - "Pass": "Parent", + "Pass": "PipelineGlobal", "Attachment": "SwapChainOutput" } } @@ -104,9 +104,16 @@ { "LocalSlot": "SwapChainOutput", "AttachmentRef": { - "Pass": "Parent", + "Pass": "PipelineGlobal", "Attachment": "SwapChainOutput" } + }, + { + "LocalSlot": "Depth", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "DepthMSAA" + } } ] }, diff --git a/Scripts/ExpectedScreenshots/AutoBrick/brick.png b/Scripts/ExpectedScreenshots/AutoBrick/brick.png index 49a3fa6e..720c28da 100644 --- a/Scripts/ExpectedScreenshots/AutoBrick/brick.png +++ b/Scripts/ExpectedScreenshots/AutoBrick/brick.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d6ddd82ec6a73c7307f166a8f92ffdf67cf8f3772f7cbcda023558d13e8088d4 -size 522261 +oid sha256:62526ff5bb7ad0ac14abf8388d714b39b107eb03b30f33d81214160c315299c2 +size 522637 diff --git a/Scripts/ExpectedScreenshots/AutoBrick/tile.png b/Scripts/ExpectedScreenshots/AutoBrick/tile.png index 01fc830d..7d014aab 100644 --- a/Scripts/ExpectedScreenshots/AutoBrick/tile.png +++ b/Scripts/ExpectedScreenshots/AutoBrick/tile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a63984194663d16b07be16686785bb920061e7bec03b6ebb509163230cf2c38d -size 415166 +oid sha256:a3b9092ad6d1bb256391a35a869afbf510bd5c199990b9cda97e4581ffce0fca +size 416056 diff --git a/Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.png b/Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.png index 5e0b025a..36358050 100644 --- a/Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.png +++ b/Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37ce46e43bd38e918447c63fa0c1dd5579dc2c0d7a2fb5743defe6dc0b5a3d39 -size 89664 +oid sha256:776711afde141b1af32e6b6ed0110b02af1178a77de98f3854245b200ca37e96 +size 93562 diff --git a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png index 2fc6e95b..8b36586f 100644 --- a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png +++ b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:984bfd7f1d50ee35090e2d3c7d23b63a75bf0a912dce773be19b187515c3d2d7 -size 541638 +oid sha256:dbf6b47abf9611cfd979c49ce95939859826f198418f705e9c07ad58a251f7b5 +size 542956 diff --git a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png index bacd72e4..d3bfa18a 100644 --- a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png +++ b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf10b4101e8a313d96eb4eb245c43b4b9cff7f0faa99aedb124252518348c7e1 -size 603149 +oid sha256:bbd93b09c0acbd1c618ec89faa910f8997d8209453f75a108eb3d2e353b99a3e +size 603942 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/Start_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/Start_window2.png index 5752e54e..50af19af 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/Start_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/Start_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:24bf99486218f87ed32573c03bb69add3b631c72b2a37c135ebf5dc978ac22bd -size 221447 +oid sha256:9d3c56ade95f56d2d1014c4fae87840a8bcc3433ce447887bec828218e2bfc3f +size 221227 diff --git a/Scripts/ExpectedScreenshots/Shadow/initial.png b/Scripts/ExpectedScreenshots/Shadow/initial.png index 3e593e7f..ca8ece5b 100644 --- a/Scripts/ExpectedScreenshots/Shadow/initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dcb7dc110b4e9f71e474dacde70bd55a587c1c8097aa34b1b1255d6888ae6a92 -size 245634 +oid sha256:01534dc1043d6de99df8f9d4e27327686b863579e24206ea90d625825ef8eda7 +size 248102 diff --git a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png index a29e29a9..d0321083 100644 --- a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png +++ b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97e8e3793c497f53b19a20581bcaf29e14172042654de3b847d133e33613134b -size 126990 +oid sha256:03f627765c31df44273d4134a2e3017dd46e0c2d0a67737cbdf4cd1fcbabc74e +size 138436 diff --git a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png index 0cf4d727..43406b28 100644 --- a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png +++ b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c4ae6a6e645083b86410d24fab05ccae96d69984b1d120e6dd3c2b7a56e1b3c -size 123338 +oid sha256:d42c76e63ede81eda54bd7a68ef1e8e5b77f4c6578838a619fa26b845531aaf6 +size 138107 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png b/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png index ff5e27c6..e5a2e398 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a216b14e2b8096a7de91e87a9c9eaec7b557c038fd5dd121641f5af55efe4d76 -size 542308 +oid sha256:1bc99ca925ae1bffbe48fb5aab004927a7fe613acd2b269705e0382c6dad53eb +size 543370 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png index 4737e027..11e49264 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ee3c29f469bd5f9f566284d21844262ab8d6ea35faa4fb7a6d422122afd9391 -size 495797 +oid sha256:755854a47edb2bdb25408f71dccdae7394788ad71928ca7c768ed8ed034c0459 +size 499942 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png index 2342b6f8..c4732407 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3975acde098e87140e91f962045c8500eaa4a0035ebe97994c32538dfc7bf750 -size 556401 +oid sha256:7cf1d36647b7107ccc97b30d222c2822f2da2e78eafb7cc101771545b018994e +size 560380 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png index 21417558..f2e938e2 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd42c9b3863c4dbb6c3871ca83ed512abddcc0ec7cecaede4bebbb8b701c2bd8 -size 652663 +oid sha256:aa2ca88cf26ea7e714866d09a2a799880565bb28dc5b1effe5352c697efcbf2b +size 736004 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png index 59efbe27..3b9934a3 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6cce81fec81ee03f7dc4de6a9a68edaa688698c75c43a2a10fd94140647d638 -size 769763 +oid sha256:a4b71affbe3a42dcae65adbbc4c600ca658df8f55430a9488d870d32b5b4818a +size 746578 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png index 32f15489..64d09893 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57df2a1870b6de8c95b0065b019005d07282e4f641bce41523afd1f01880e655 -size 784975 +oid sha256:2ca32ab7166fb5934a570f78230dbd84a7c82db56542189febf0634a716bfc40 +size 786635 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png index de8e168e..30faa1b8 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5a9c43061cae04c2914e0e2e8c93481b89510809b199f3b1ecaae206e066b9f9 -size 621979 +oid sha256:930034d81ba5b97081c7083ac0e331a27eed58e59b975ec390aa05453d0664bb +size 664526 diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index 9c07e508..877f0048 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -57,7 +57,8 @@ tests= { RunScriptWrapper('scripts/streamingimagetest.bv.luac'), RunScriptWrapper('scripts/parallaxtest.bv.luac'), RunScriptWrapper('scripts/parallaxdepthartifacts.bv.luac'), - RunScriptWrapper('scripts/checkerboardtest.bv.luac'), + -- Disable checkerboard pipeline as it's quite out of date and currently a maintenance burden + -- RunScriptWrapper('scripts/checkerboardtest.bv.luac'), RunScriptWrapper('scripts/scenereloadsoaktest.bv.luac'), RunScriptWrapper('scripts/diffusegitest.bv.luac'), RunScriptWrapper('scripts/arealighttest.bv.luac'), @@ -66,7 +67,8 @@ tests= { RunScriptWrapper('scripts/shadowedsponzatest.bv.luac'), RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'), RunScriptWrapper('scripts/PassTree.bv.luac'), - RunScriptWrapper('scripts/ReadbackTest.bv.luac'), + -- Seems to cause GPU Device Lost, requires further investigation. + -- RunScriptWrapper('scripts/ReadbackTest.bv.luac'), RunScriptWrapper('scripts/depthoffieldtest.bv.luac'), --Fast checking for the samples which don't have a test. Samples should be removed from this list once they have their own tests From 1baf4ac776681f5087eaf6fee8ca98e0c2e717a1 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 25 May 2022 15:52:58 -0700 Subject: [PATCH 41/81] adding Exposure sample screenshot compare test Signed-off-by: Scott Murray --- .../ExposureTest/screenshot_exposure.png | 3 +++ Scripts/ExposureTest.bv.lua | 24 +++++++++++++++++++ Scripts/_FullTestSuite_.bv.lua | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Scripts/ExpectedScreenshots/ExposureTest/screenshot_exposure.png create mode 100644 Scripts/ExposureTest.bv.lua diff --git a/Scripts/ExpectedScreenshots/ExposureTest/screenshot_exposure.png b/Scripts/ExpectedScreenshots/ExposureTest/screenshot_exposure.png new file mode 100644 index 00000000..cafad880 --- /dev/null +++ b/Scripts/ExpectedScreenshots/ExposureTest/screenshot_exposure.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d376381c9d8519d27e8e4a03117919582f936eb709bf76d1885c84d1cf71e682 +size 512689 diff --git a/Scripts/ExposureTest.bv.lua b/Scripts/ExposureTest.bv.lua new file mode 100644 index 00000000..9c8fa121 --- /dev/null +++ b/Scripts/ExposureTest.bv.lua @@ -0,0 +1,24 @@ +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ExposureTest/') +Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) + +OpenSample('Features/Exposure') +ResizeViewport(800, 600) +SelectImageComparisonToleranceLevel("Level E") + +-- eye adaptation has a default speed. we are waiting 9 seconds for the sample to reach stable state +IdleSeconds(9) + +CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_exposure.png') + +OpenSample(nil) diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index d06327eb..df5c67b2 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -69,6 +69,7 @@ tests= { RunScriptWrapper('scripts/PassTree.bv.luac'), RunScriptWrapper('scripts/ReadbackTest.bv.luac'), RunScriptWrapper('scripts/depthoffieldtest.bv.luac'), + RunScriptWrapper('scripts/exposuretest.bv.luac'), --Fast checking for the samples which don't have a test. Samples should be removed from this list once they have their own tests @@ -103,7 +104,6 @@ tests= { FastCheckSample('RPI/RootConstants'), FastCheckSample('Features/Bloom'), - FastCheckSample('Features/Exposure'), FastCheckSample('Features/SkinnedMesh'), FastCheckSample('Features/SSAO'), FastCheckSample('Features/SSR'), From 3494711218cb2fbf63c4a00e41772a176af3f0aa Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 26 May 2022 18:13:18 -0700 Subject: [PATCH 42/81] updated non-failing screenshots and updated shadow example components and added test for fullscreen blur Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Gem/Code/Source/ShadowExampleComponent.cpp | 6 ++++++ Gem/Code/Source/ShadowExampleComponent.h | 1 + Gem/Code/Source/ShadowedSponzaExampleComponent.cpp | 6 ++++++ Gem/Code/Source/ShadowedSponzaExampleComponent.h | 1 + Scripts/ExpectedScreenshots/AutoBrick/brick.png | 4 ++-- .../MinimalPBR/minimalmultilayerexample.png | 4 ++-- .../ExpectedScreenshots/MinimalPBR/minimalpbr_default.png | 4 ++-- .../MinimalPBR/minimalpbr_reddielectric.png | 4 ++-- .../IBL_Skybox_Spot_Dir_DOF_window2.png | 4 ++-- .../MultiRenderPipeline/IBL_Skybox_Spot_Dir_window1.png | 4 ++-- .../MultiRenderPipeline/IBL_Skybox_Spot_Dir_window2.png | 4 ++-- .../MultiRenderPipeline/IBL_Skybox_Spot_window1.png | 4 ++-- .../MultiRenderPipeline/IBL_Skybox_Spot_window2.png | 4 ++-- .../MultiRenderPipeline/NoDOF_window1.png | 4 ++-- .../MultiRenderPipeline/NoDOF_window2.png | 4 ++-- .../MultiRenderPipeline/TwoCameras_window2.png | 4 ++-- .../MultiRenderPipeline/WithDOF_window1.png | 4 ++-- .../MultiRenderPipeline/WithDOF_window2.png | 4 ++-- .../ExpectedScreenshots/MultiScene/Start_MultiScene2.png | 4 ++-- Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png | 4 ++-- .../ParallaxTest/screenshot_2ndUv_1.png | 4 ++-- Scripts/ExpectedScreenshots/PassTree/albedo.png | 4 ++-- Scripts/ExpectedScreenshots/PassTree/brdf.png | 4 ++-- Scripts/ExpectedScreenshots/PassTree/depthStencilMs.png | 4 ++-- .../ExpectedScreenshots/PassTree/depthStencilResolve.png | 4 ++-- Scripts/ExpectedScreenshots/PassTree/linearDepth.png | 4 ++-- Scripts/ExpectedScreenshots/PassTree/specularResolved.png | 4 ++-- .../Shadow/directional_auto_cascade.png | 4 ++-- .../Shadow/directional_cascade_correction.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/directional_esm.png | 4 ++-- .../ExpectedScreenshots/Shadow/directional_esm_pcf.png | 4 ++-- .../Shadow/directional_fullscreen_blur.png | 3 +++ .../ExpectedScreenshots/Shadow/directional_initial.png | 4 ++-- .../Shadow/directional_manual_cascade.png | 4 ++-- .../ExpectedScreenshots/Shadow/directional_pcf_high.png | 4 ++-- .../ExpectedScreenshots/Shadow/directional_pcf_low.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/initial.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/spot_initial.png | 4 ++-- Scripts/ExpectedScreenshots/Shadow/spot_no_red_shadow.png | 4 ++-- .../ExpectedScreenshots/Shadow/spot_shadowmap_size.png | 4 ++-- .../ShadowedSponza/directional_filter.png | 4 ++-- .../ShadowedSponza/directional_nofilter.png | 4 ++-- .../StandardMultilayerPBR/002_parallaxpdo.png | 4 ++-- .../StandardMultilayerPBR/004_usevertexcolors.png | 4 ++-- .../StandardMultilayerPBR/005_usedisplacement.png | 4 ++-- .../005_usedisplacement_layer2off.png | 4 ++-- .../005_usedisplacement_layer3off.png | 4 ++-- ...usedisplacement_with_blendmasktexture_noheightmaps.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/001_defaultwhite.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/002_basecolorlerp.png | 4 ++-- .../StandardPBR/002_basecolorlinearlight.png | 4 ++-- .../StandardPBR/002_basecolormultiply.png | 4 ++-- Scripts/ExpectedScreenshots/StandardPBR/004_metalmap.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/005_roughnessmap.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/006_specularf0map.png | 4 ++-- .../StandardPBR/007_multiscatteringcompensationoff.png | 4 ++-- .../StandardPBR/007_multiscatteringcompensationon.png | 4 ++-- Scripts/ExpectedScreenshots/StandardPBR/008_normalmap.png | 4 ++-- .../StandardPBR/008_normalmap_bevels.png | 4 ++-- .../StandardPBR/010_ambientocclusion.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/010_bothocclusion.png | 4 ++-- .../StandardPBR/010_specularocclusion.png | 4 ++-- Scripts/ExpectedScreenshots/StandardPBR/011_emissive.png | 4 ++-- .../StandardPBR/012_parallax_pom_cutout.png | 4 ++-- .../StandardPBR/013_specularaa_off.png | 4 ++-- .../ExpectedScreenshots/StandardPBR/013_specularaa_on.png | 4 ++-- Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat.png | 4 ++-- .../StandardPBR/014_clearcoat_normalmap.png | 4 ++-- .../StandardPBR/014_clearcoat_normalmap_2nduv.png | 4 ++-- .../StandardPBR/014_clearcoat_roughnessmap.png | 4 ++-- .../StandardPBR/015_subsurfacescattering.png | 4 ++-- .../StandardPBR/015_subsurfacescattering_transmission.png | 4 ++-- .../015_subsurfacescattering_transmission_thin.png | 4 ++-- .../StandardPBR/100_uvtiling_ambientocclusion.png | 4 ++-- .../StandardPBR/100_uvtiling_metallic.png | 4 ++-- .../StandardPBR/100_uvtiling_normal.png | 4 ++-- .../StandardPBR/100_uvtiling_opacity.png | 4 ++-- .../StandardPBR/100_uvtiling_specularf0.png | 4 ++-- .../StandardPBR/104_detailmaps_normal.png | 4 ++-- .../StandardPBR/104_detailmaps_normalwithmask.png | 4 ++-- Scripts/ShadowTest.bv.lua | 8 +++++++- 81 files changed, 174 insertions(+), 151 deletions(-) create mode 100644 Scripts/ExpectedScreenshots/Shadow/directional_fullscreen_blur.png diff --git a/Gem/Code/Source/ShadowExampleComponent.cpp b/Gem/Code/Source/ShadowExampleComponent.cpp index d50105b3..5215a1ea 100644 --- a/Gem/Code/Source/ShadowExampleComponent.cpp +++ b/Gem/Code/Source/ShadowExampleComponent.cpp @@ -416,6 +416,7 @@ namespace AtomSampleViewer featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); featureProcessor->SetFilteringSampleCount(handle, static_cast(m_filteringSampleCountDirectional)); featureProcessor->SetGroundHeight(handle, 0.f); + featureProcessor->SetFullscreenBlurEnabled(handle, m_useFullscreenBlur); m_directionalLightHandle = handle; SetupDebugFlags(); @@ -598,6 +599,11 @@ namespace AtomSampleViewer { m_directionalLightFeatureProcessor->SetViewFrustumCorrectionEnabled(m_directionalLightHandle, m_isCascadeCorrectionEnabled); } + + if (ScriptableImGui::Checkbox("Use Fullscreen Blur", &m_useFullscreenBlur)) + { + m_directionalLightFeatureProcessor->SetFullscreenBlurEnabled(m_directionalLightHandle, m_useFullscreenBlur); + } } ImGui::Unindent(); } diff --git a/Gem/Code/Source/ShadowExampleComponent.h b/Gem/Code/Source/ShadowExampleComponent.h index 7ed4ede0..2f6dd2ac 100644 --- a/Gem/Code/Source/ShadowExampleComponent.h +++ b/Gem/Code/Source/ShadowExampleComponent.h @@ -159,6 +159,7 @@ namespace AtomSampleViewer FarClipDistance * 3 / 4, FarClipDistance * 4 / 4 }; + bool m_useFullscreenBlur = false; bool m_isCascadeCorrectionEnabled = false; bool m_isDebugColoringEnabled = false; bool m_isDebugBoundingBoxEnabled = false; diff --git a/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp b/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp index 402f44e2..14250559 100644 --- a/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp +++ b/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp @@ -249,6 +249,7 @@ namespace AtomSampleViewer featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); featureProcessor->SetFilteringSampleCount(handle, static_cast(m_filteringSampleCountDirectional)); featureProcessor->SetGroundHeight(handle, 0.f); + featureProcessor->SetFullscreenBlurEnabled(handle, m_useFullscreenBlur); m_directionalLightHandle = handle; SetupDebugFlags(); @@ -447,6 +448,11 @@ namespace AtomSampleViewer ImGui::Spacing(); + if (ScriptableImGui::Checkbox("Use Fullscreen Blur", &m_useFullscreenBlur)) + { + m_directionalLightFeatureProcessor->SetFullscreenBlurEnabled(m_directionalLightHandle, m_useFullscreenBlur); + } + if (ScriptableImGui::Checkbox("Cascade Position Correction", &m_isCascadeCorrectionEnabled)) { m_directionalLightFeatureProcessor->SetViewFrustumCorrectionEnabled( diff --git a/Gem/Code/Source/ShadowedSponzaExampleComponent.h b/Gem/Code/Source/ShadowedSponzaExampleComponent.h index 636807b7..4ce0ca5f 100644 --- a/Gem/Code/Source/ShadowedSponzaExampleComponent.h +++ b/Gem/Code/Source/ShadowedSponzaExampleComponent.h @@ -141,6 +141,7 @@ namespace AtomSampleViewer int m_filteringSampleCountDirectional = 16; int m_filteringSampleCountDisk = 16; + bool m_useFullscreenBlur = false; bool m_isCascadeCorrectionEnabled = false; bool m_isDebugColoringEnabled = false; bool m_isDebugBoundingBoxEnabled = false; diff --git a/Scripts/ExpectedScreenshots/AutoBrick/brick.png b/Scripts/ExpectedScreenshots/AutoBrick/brick.png index 720c28da..1f0cb452 100644 --- a/Scripts/ExpectedScreenshots/AutoBrick/brick.png +++ b/Scripts/ExpectedScreenshots/AutoBrick/brick.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:62526ff5bb7ad0ac14abf8388d714b39b107eb03b30f33d81214160c315299c2 -size 522637 +oid sha256:bed1230ba32b45f6220fcc79161c5e7fa80a7aab01eadc6e9b7cf88977d547fa +size 522244 diff --git a/Scripts/ExpectedScreenshots/MinimalPBR/minimalmultilayerexample.png b/Scripts/ExpectedScreenshots/MinimalPBR/minimalmultilayerexample.png index 544bae56..fbcd4864 100644 --- a/Scripts/ExpectedScreenshots/MinimalPBR/minimalmultilayerexample.png +++ b/Scripts/ExpectedScreenshots/MinimalPBR/minimalmultilayerexample.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d2c3542cc2e6774d2783d7aadb9855293a726370410d6dcb620ca13aea9fbd9 -size 1171349 +oid sha256:e6fd73d31b0b7450a094ef1cf653e1cb40adda54a25d6e205638ae7d54ef9a3c +size 1171501 diff --git a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png index 8b36586f..acd2571a 100644 --- a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png +++ b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_default.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dbf6b47abf9611cfd979c49ce95939859826f198418f705e9c07ad58a251f7b5 -size 542956 +oid sha256:cbe165e285c9ddaff64ba506e6c7c5cef05fa7fba9273bc5163aa75606e28974 +size 541803 diff --git a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png index d3bfa18a..ad49850c 100644 --- a/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png +++ b/Scripts/ExpectedScreenshots/MinimalPBR/minimalpbr_reddielectric.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbd93b09c0acbd1c618ec89faa910f8997d8209453f75a108eb3d2e353b99a3e -size 603942 +oid sha256:19124cd24df89d52a616ea3a3ec84ebc908384f64d8841f6d521d9fe4ef87d60 +size 603342 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_DOF_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_DOF_window2.png index b94a268a..a709900d 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_DOF_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_DOF_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:399c44427006dccae645acaddbb639bc91fa505b51f3d4ad948d21895f7ecd93 -size 201388 +oid sha256:454df03e84cce52a6eb0695f785c6f9d176b1e872d1fb5b0e7b0d0d96186fa60 +size 199739 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window1.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window1.png index a0e4c4c5..31b7e0c0 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window1.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e737994e206c34df4f4d548593607ff2d848abcff892a7356cb22379685d3f4 -size 273021 +oid sha256:2024c6662db0d54d5ea8ff144d058ce9a7f96936a6acaad9866b004a448508d9 +size 269267 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window2.png index 779a8643..a709900d 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_Dir_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bea8c10a2a65ec81296a3c4d8d6c856d9fa67688f331d8872f060f2a02e24b70 -size 201319 +oid sha256:454df03e84cce52a6eb0695f785c6f9d176b1e872d1fb5b0e7b0d0d96186fa60 +size 199739 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window1.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window1.png index 3a4133d2..96258f71 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window1.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:98e2c89ee0d749374ef0d8b9478fe768f5a092efe701110db729dacca2f5f262 -size 294408 +oid sha256:4954c0e90c29ced8fa34821c2af8d62ad09b2f40a0946d6d082378dd2bdb4072 +size 289822 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window2.png index ee906c66..81542abe 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/IBL_Skybox_Spot_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66c47c3dc72893e5005dfc8131ebd5219aa2c828813044b441b6a5469c9d38e3 -size 223071 +oid sha256:445a0f7f9f724b30a4a54ec77be3b825bcbfb289d8a91eaa0817ec4655b6d055 +size 221144 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window1.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window1.png index 60cfe1d6..31b7e0c0 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window1.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e041a9ea5d73769b3d0e7162d9ab1f74be638c05f2fc65aad22a8db08e543b7 -size 270228 +oid sha256:2024c6662db0d54d5ea8ff144d058ce9a7f96936a6acaad9866b004a448508d9 +size 269267 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window2.png index b94a268a..a709900d 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/NoDOF_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:399c44427006dccae645acaddbb639bc91fa505b51f3d4ad948d21895f7ecd93 -size 201388 +oid sha256:454df03e84cce52a6eb0695f785c6f9d176b1e872d1fb5b0e7b0d0d96186fa60 +size 199739 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/TwoCameras_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/TwoCameras_window2.png index b94a268a..a709900d 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/TwoCameras_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/TwoCameras_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:399c44427006dccae645acaddbb639bc91fa505b51f3d4ad948d21895f7ecd93 -size 201388 +oid sha256:454df03e84cce52a6eb0695f785c6f9d176b1e872d1fb5b0e7b0d0d96186fa60 +size 199739 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window1.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window1.png index c8a3a3aa..72d6ecbe 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window1.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1479a456246e629ad429600a2232f5cb94d07e454b1e254aed58ba83cf0df871 -size 221159 +oid sha256:fe470763fb15406079debef4fdd76314a3869320b0ba590c0e3b700d06e955c5 +size 220772 diff --git a/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window2.png b/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window2.png index b94a268a..a709900d 100644 --- a/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window2.png +++ b/Scripts/ExpectedScreenshots/MultiRenderPipeline/WithDOF_window2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:399c44427006dccae645acaddbb639bc91fa505b51f3d4ad948d21895f7ecd93 -size 201388 +oid sha256:454df03e84cce52a6eb0695f785c6f9d176b1e872d1fb5b0e7b0d0d96186fa60 +size 199739 diff --git a/Scripts/ExpectedScreenshots/MultiScene/Start_MultiScene2.png b/Scripts/ExpectedScreenshots/MultiScene/Start_MultiScene2.png index e38f966f..9d633ac6 100644 --- a/Scripts/ExpectedScreenshots/MultiScene/Start_MultiScene2.png +++ b/Scripts/ExpectedScreenshots/MultiScene/Start_MultiScene2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc2d683fe443277dc19c40a57cad2fff534066638886aa65ad8f7774af51a43d -size 247779 +oid sha256:704f6041146011a0dcd851fe955a25a37e542db508f410726d619ccf0fa1caaa +size 248129 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png index 7a2dd2ec..b1667aff 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d83309654307f0850656a5b24b278331165bdb0afeca88f8886dfa160e37ad2e -size 1836679 +oid sha256:2f6ee9db386018316889ec48912b4ac1282d90b72e007068187f3835844ad743 +size 1838082 diff --git a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png index 7a2dd2ec..b1667aff 100644 --- a/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png +++ b/Scripts/ExpectedScreenshots/ParallaxTest/screenshot_2ndUv_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d83309654307f0850656a5b24b278331165bdb0afeca88f8886dfa160e37ad2e -size 1836679 +oid sha256:2f6ee9db386018316889ec48912b4ac1282d90b72e007068187f3835844ad743 +size 1838082 diff --git a/Scripts/ExpectedScreenshots/PassTree/albedo.png b/Scripts/ExpectedScreenshots/PassTree/albedo.png index 00fe46c4..b6d8cb32 100644 --- a/Scripts/ExpectedScreenshots/PassTree/albedo.png +++ b/Scripts/ExpectedScreenshots/PassTree/albedo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1172abab6b87e6097f579a6a0dd0ee8967cf8d0c1afe6f0766bedbc65fdc7740 -size 241139 +oid sha256:6516087fbbacffad981aba8e7886771b727eaa63542ad35e3ef430182d77796a +size 241078 diff --git a/Scripts/ExpectedScreenshots/PassTree/brdf.png b/Scripts/ExpectedScreenshots/PassTree/brdf.png index d24a44a5..46e652b0 100644 --- a/Scripts/ExpectedScreenshots/PassTree/brdf.png +++ b/Scripts/ExpectedScreenshots/PassTree/brdf.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b03c1da7705375112394edf197a1ddd5dfb41621de9450d7c897a7cccf9c006 -size 251221 +oid sha256:fe871ea1a41f95bb3a85661688690b40f6cb8015b4fa5a899a2a9388532cee22 +size 251291 diff --git a/Scripts/ExpectedScreenshots/PassTree/depthStencilMs.png b/Scripts/ExpectedScreenshots/PassTree/depthStencilMs.png index bb81afe4..d9c8fefd 100644 --- a/Scripts/ExpectedScreenshots/PassTree/depthStencilMs.png +++ b/Scripts/ExpectedScreenshots/PassTree/depthStencilMs.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37e527aae96d6b58ff97f0b0a1d1e3e27d461ba296a2ec0ead6c2ba789a48546 -size 207872 +oid sha256:4642c62ad5dd261aee7e088f0276d1326198abd51d7635e1a9b4fbe358afd971 +size 207806 diff --git a/Scripts/ExpectedScreenshots/PassTree/depthStencilResolve.png b/Scripts/ExpectedScreenshots/PassTree/depthStencilResolve.png index 1bf04589..2c066ad9 100644 --- a/Scripts/ExpectedScreenshots/PassTree/depthStencilResolve.png +++ b/Scripts/ExpectedScreenshots/PassTree/depthStencilResolve.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e7cbcb07dc9cd8a0c10b9a8c3e55db7141ea1f07ccf2fa1efadfdadb3c279a3 -size 208072 +oid sha256:572429ea5dbd7289d0babd2e096d9d5ea02f454c64c3df9493efd6077714f617 +size 208044 diff --git a/Scripts/ExpectedScreenshots/PassTree/linearDepth.png b/Scripts/ExpectedScreenshots/PassTree/linearDepth.png index 7b6dc383..c62fafa4 100644 --- a/Scripts/ExpectedScreenshots/PassTree/linearDepth.png +++ b/Scripts/ExpectedScreenshots/PassTree/linearDepth.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f1bd5b2966d57d97ca9a38914ced65d33daeb70fd09ce2758ec4fa05292f64b -size 204945 +oid sha256:69cf2aa787dc163a7fba0023080ad187863e67cda9806da9cd0a6703d13af3f0 +size 204880 diff --git a/Scripts/ExpectedScreenshots/PassTree/specularResolved.png b/Scripts/ExpectedScreenshots/PassTree/specularResolved.png index 42e2a8ea..957701ec 100644 --- a/Scripts/ExpectedScreenshots/PassTree/specularResolved.png +++ b/Scripts/ExpectedScreenshots/PassTree/specularResolved.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa486051731f114e3e06b155e96b00719080f39e6c6b7543e4f4fe80e9f53afd -size 234151 +oid sha256:5c57ec5825b8937a0c564c6a9c6cdd686e0535c44d118fd51b8e6193f3e6471e +size 234234 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_auto_cascade.png b/Scripts/ExpectedScreenshots/Shadow/directional_auto_cascade.png index d853d378..53fb888e 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_auto_cascade.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_auto_cascade.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:db49a2f5609d6eab598e4e1e936af4ba4ba3efafa76044e0e836bd2cbb624d5b -size 192990 +oid sha256:42d7b9a3deaa445f724de2936604674142bcc5a242605ec0a92d14a93fd3c920 +size 192759 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_cascade_correction.png b/Scripts/ExpectedScreenshots/Shadow/directional_cascade_correction.png index 19a1aba6..52f16be8 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_cascade_correction.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_cascade_correction.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d848fc90ae55a9bd4d25c5488a25bf73f974ab5bf0b2c65212fa4b6e081eff42 -size 189011 +oid sha256:4a2054d29dc23bccd4e17eef748eccdccf2a441bc37c97e66f720cb5856e4d29 +size 188561 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_esm.png b/Scripts/ExpectedScreenshots/Shadow/directional_esm.png index b43ae7bb..579a6e44 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_esm.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_esm.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5a00855d14d006a19806142d240aebb383f2d765f4fe4b4487ffc4d583ca57c4 -size 172519 +oid sha256:a582d68d78b33343587cc1fc984ee224c15c83cf71c294e78c3c2380bdbe55d2 +size 171922 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_esm_pcf.png b/Scripts/ExpectedScreenshots/Shadow/directional_esm_pcf.png index c3d09b4a..1cb445f6 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_esm_pcf.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_esm_pcf.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd820713d4a3a5e223147ad7906ec0e2905bb55c9fa2f4e0482a9d35141ff6af -size 173188 +oid sha256:0ffe6779e10458a51a62484cb1a0345d645834289f7b143fee6e71c91c2e05a6 +size 172121 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_fullscreen_blur.png b/Scripts/ExpectedScreenshots/Shadow/directional_fullscreen_blur.png new file mode 100644 index 00000000..5b8f5e1a --- /dev/null +++ b/Scripts/ExpectedScreenshots/Shadow/directional_fullscreen_blur.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7423dc7ab51e70701462670db317ec07f24616c54acf32272fb237dba14fbefe +size 203864 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_initial.png b/Scripts/ExpectedScreenshots/Shadow/directional_initial.png index 7f72997f..07e045a1 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b91d9742d396630372218ed8ca3845c0b1d1bc750d8b26c64f90c39e98462a5 -size 169323 +oid sha256:7f80c0e2294810a63de324c7495b8b9c5c3b5582f37395752e879495cfd60efa +size 168984 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_manual_cascade.png b/Scripts/ExpectedScreenshots/Shadow/directional_manual_cascade.png index 31dbe51c..5b10a17c 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_manual_cascade.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_manual_cascade.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:046b00a19af242c1b92a6a4aabb68c876a5deff02833ca613895619fd06a1956 -size 187435 +oid sha256:e1010e59975b72a6bb85846ea9c95513775e7983c0f463d540bceb33c08606ef +size 187410 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_pcf_high.png b/Scripts/ExpectedScreenshots/Shadow/directional_pcf_high.png index 136dc8f4..b3821e0b 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_pcf_high.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_pcf_high.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f50e12e3b53a8e257ad6184eef68112a28600af002f7d25bdcd0a011696e8ad -size 178792 +oid sha256:cf3c698fab8f789c79fdd272dd8b9160920831769646d5ce70f03834c0ad0743 +size 172619 diff --git a/Scripts/ExpectedScreenshots/Shadow/directional_pcf_low.png b/Scripts/ExpectedScreenshots/Shadow/directional_pcf_low.png index 7f99286f..9420c3c8 100644 --- a/Scripts/ExpectedScreenshots/Shadow/directional_pcf_low.png +++ b/Scripts/ExpectedScreenshots/Shadow/directional_pcf_low.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2e2034456fe33b7f6b635e6ffb77e39f97cc25d440a504cd6326bfaabb52286 -size 175446 +oid sha256:bbbf1a116ed688528be692f4d475f1c149d1282941d10c4bbb55233a6779601b +size 171776 diff --git a/Scripts/ExpectedScreenshots/Shadow/initial.png b/Scripts/ExpectedScreenshots/Shadow/initial.png index ca8ece5b..ab4223ec 100644 --- a/Scripts/ExpectedScreenshots/Shadow/initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01534dc1043d6de99df8f9d4e27327686b863579e24206ea90d625825ef8eda7 -size 248102 +oid sha256:7570eafa862f7788961f38cebffc3956b8024d790f6320cf88930c9a328f20c0 +size 245515 diff --git a/Scripts/ExpectedScreenshots/Shadow/spot_initial.png b/Scripts/ExpectedScreenshots/Shadow/spot_initial.png index b154be3d..eada48e3 100644 --- a/Scripts/ExpectedScreenshots/Shadow/spot_initial.png +++ b/Scripts/ExpectedScreenshots/Shadow/spot_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:acb7c4151fa39295753f403350b3d353eec330aa152995dfd1a254dc8e7ab1b7 -size 241018 +oid sha256:86f2f833623e9038420b9c50ca61fdfe69e19f3b29211b924f11d334e0b36d48 +size 240542 diff --git a/Scripts/ExpectedScreenshots/Shadow/spot_no_red_shadow.png b/Scripts/ExpectedScreenshots/Shadow/spot_no_red_shadow.png index 3f9daf84..bf499638 100644 --- a/Scripts/ExpectedScreenshots/Shadow/spot_no_red_shadow.png +++ b/Scripts/ExpectedScreenshots/Shadow/spot_no_red_shadow.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b2da74269f9d77ea04f8b43a4126e01e4ae690470f0ac58ec37ffe9540df9e9 -size 247474 +oid sha256:61459bcc3f46b0b4ed3743d819cda4294de2efa7627fc38cc6896f892b538d5f +size 247582 diff --git a/Scripts/ExpectedScreenshots/Shadow/spot_shadowmap_size.png b/Scripts/ExpectedScreenshots/Shadow/spot_shadowmap_size.png index f8bc1ac9..1125fb66 100644 --- a/Scripts/ExpectedScreenshots/Shadow/spot_shadowmap_size.png +++ b/Scripts/ExpectedScreenshots/Shadow/spot_shadowmap_size.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2e20f1c65bae4a78e5985d49a8b9ce2f09b53a0cc1fae3d10a7bb66892d89061 -size 240880 +oid sha256:879d186c00ba960974b300ffeae16a3e102e7a6b90355c3a73264d8adc1f8c5a +size 240798 diff --git a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png index d0321083..4b99498f 100644 --- a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png +++ b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_filter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:03f627765c31df44273d4134a2e3017dd46e0c2d0a67737cbdf4cd1fcbabc74e -size 138436 +oid sha256:42449195d6a23112da52b2fbcb222ff9ab3389b42b04ead78d2cbaea870fafa9 +size 128228 diff --git a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png index 43406b28..6f2babf9 100644 --- a/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png +++ b/Scripts/ExpectedScreenshots/ShadowedSponza/directional_nofilter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d42c76e63ede81eda54bd7a68ef1e8e5b77f4c6578838a619fa26b845531aaf6 -size 138107 +oid sha256:2db89b7dbae100dc137cd5b3c5eff3e6970d26966026b8482a8d8abfb564228f +size 121618 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png index 44a77b01..38138efe 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/002_parallaxpdo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66bbfc82db795b72d3b82a40dd9bfc7738508376de75de98a23531d6a3176cc2 -size 1443084 +oid sha256:b7cf03bd917b6af89c7ed3f675d1e6da1232aef6a60a9ef845e40265569d7ebf +size 1486275 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png index b7e33018..2476c1e0 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/004_usevertexcolors.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:748f7dd58d7aaf0b951584537741743782dbbc4479868bf07caa855e50c10cb7 -size 1218513 +oid sha256:54eb53c642d7e41f66b861f46d53ec7dd2f2593aefec65e257b47d0eb57872e9 +size 1237024 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png index 1d0926b4..430aa5b8 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79f1055c0f316a9b47518d282d9b062fe3e3f1a38011976e0a6de2fa598bc562 -size 1975325 +oid sha256:8962d830789d9182907b1d6923a482b62ae9a79085ac272358224961c2b111be +size 1989073 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png index c7065276..75dd9b0b 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer2off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3c5fa6ef8512987cad15c63c0cfdf7f61395b46ca4d53abdf4a416c9d1d8b71 -size 1998472 +oid sha256:06274b09f0f16d92a3e806d0c4676415a88aa9f70bfcebc921d952f9cf795206 +size 2028568 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png index 1439eaf0..86f64aa0 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_layer3off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf543c2e636876501284ebf3a5036ba6cd3d22f5968ee738871faaa31f7911e2 -size 1849033 +oid sha256:6a2a39f01162fe845a8beef34ad49cf3f5bc239b536a7159857b7b9086cfac92 +size 1853489 diff --git a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png index db3320a5..4d03ed27 100644 --- a/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png +++ b/Scripts/ExpectedScreenshots/StandardMultilayerPBR/005_usedisplacement_with_blendmasktexture_noheightmaps.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:179d20a9ef0fdb1690935a4e641194834514d818d8c7618fc0b1f95bf1884cca -size 1587265 +oid sha256:a3b908393ae1a298d8a1cdcdc3b4fc69315099888d1cb5b1926862c41f3a6342 +size 1599034 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png b/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png index e5a2e398..7f7418cd 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/001_defaultwhite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1bc99ca925ae1bffbe48fb5aab004927a7fe613acd2b269705e0382c6dad53eb -size 543370 +oid sha256:4622521f18bdeaa9840bc3b13807a7a4ac4f1c18a85ad6464fb8009f2b24f82f +size 542369 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlerp.png b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlerp.png index 0dd8b6f5..04cd12eb 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlerp.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlerp.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e87dd0e75fde66d864bc8fdbbef2fb84e7273294cb1e1df4e2597361bb05c32 -size 1051149 +oid sha256:9e93e354c175335cd753f6786fe1e74baff25136d03bfdc2c7da36dc4c77caa6 +size 1177644 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlinearlight.png b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlinearlight.png index 7644e747..04e8ec38 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlinearlight.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolorlinearlight.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab73d6c7d39898925f82d1a27b786adfd3627e213fbe22b975c0d18241f8b1a3 -size 1261338 +oid sha256:a36bfbee04421bbd8b56862d1d6c913b1d7702493a5a65f0fdc544ed11a94674 +size 1379354 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolormultiply.png b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolormultiply.png index 92598a1c..b873bcff 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/002_basecolormultiply.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/002_basecolormultiply.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33d1c2e4677ccd0125db9aac0b627e6acf0ae1f79dc5cd96fb14b37dff9cc01e -size 1047404 +oid sha256:da6350446d4dab0f495e6120b5d755906741f859d981bb95119c26d5f2062d11 +size 1182797 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/004_metalmap.png b/Scripts/ExpectedScreenshots/StandardPBR/004_metalmap.png index a8d6c1b4..733fe424 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/004_metalmap.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/004_metalmap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c2f5efefc79b6ebec4817913c48844270a6f8469ad39d770c9cb801f7308d07e -size 542134 +oid sha256:4dc17b1236859d3d81e55c44a8743cc80b68417f45a7780b213561a3d13de7d8 +size 652111 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/005_roughnessmap.png b/Scripts/ExpectedScreenshots/StandardPBR/005_roughnessmap.png index 5acbd9d3..11657875 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/005_roughnessmap.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/005_roughnessmap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d341aedc4d5ecdcd8d300628990c32d9dd8c1c6077905c894024e29fd89927d -size 539983 +oid sha256:d2f40de13b41bf9b90f5076db6bddbc20e468af146a4a3fd6041846bd10e7707 +size 649800 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/006_specularf0map.png b/Scripts/ExpectedScreenshots/StandardPBR/006_specularf0map.png index 63435170..7ad8cb9b 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/006_specularf0map.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/006_specularf0map.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:10a45d7c4e7e782d1900aa2290e0a65f7fad9b87418057bd35b780af1ac026ff -size 712991 +oid sha256:d6f08746e91b3d742136118d08fb6d5967a1b43bdb555c9ebcbfd0458c9d3224 +size 712370 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png index 11e49264..788545e7 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationoff.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:755854a47edb2bdb25408f71dccdae7394788ad71928ca7c768ed8ed034c0459 -size 499942 +oid sha256:59349223575cb1373ea4de1fe7f2a258f8e3f29ea43f086a5fabb6fe70a46985 +size 497826 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png index c4732407..aa8dff63 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/007_multiscatteringcompensationon.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7cf1d36647b7107ccc97b30d222c2822f2da2e78eafb7cc101771545b018994e -size 560380 +oid sha256:075191fa3a516f8e68ebedc1a41c8c9b43ff601a1ea51b734fe4c46b9385ca02 +size 557669 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap.png b/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap.png index 50c51118..f3f29bcc 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e5fef588b9747ddc3f973004fd169a1563bf5d9c6988235de95951ee4b547ef7 -size 1241657 +oid sha256:b114361328e52867399098fccb558a5a22ce6a00e0741f632c68b218860dafa2 +size 1224261 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap_bevels.png b/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap_bevels.png index 16c9feab..88879840 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap_bevels.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/008_normalmap_bevels.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d07ff3b3880fc39555f4d11c0d44db1e930f848cb4c12c99e46523f37421defd -size 575115 +oid sha256:252cb58d7f6a06d06632a743195a2566851b86c69657131c315c11bb9c3bbce7 +size 680186 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png index dd37cf6b..1084fb57 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/010_ambientocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc2a9a6e38c90b292093be34e7f14633ce1982507c771a18977d47e7233713f9 -size 1190199 +oid sha256:c08c51fc2262145a8400c5cd91afe0a8f26f111ff471b2316e54a0c4d44e45bb +size 1190000 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/010_bothocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/010_bothocclusion.png index 5ba23fe7..d7b76cfb 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/010_bothocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/010_bothocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65e0543d44792fd250faa60e5159aac1717ee4fbcd4cf265e8cc543c2f3de3d0 -size 1168055 +oid sha256:067b1eca1fcc5c48cf6e36a8e83f446132da956bf5c88e09aba70d75df4bf5d0 +size 1167649 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/010_specularocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/010_specularocclusion.png index 6dc22667..9e675265 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/010_specularocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/010_specularocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2942d36524abcc97e49fa2be80988018b14e6868aa8254151f5e84b7eae1da7a -size 1128517 +oid sha256:8d06947fefe610908a19f721f77e137d629e4ea8d08563d6b671cbebcef3256e +size 1128783 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/011_emissive.png b/Scripts/ExpectedScreenshots/StandardPBR/011_emissive.png index 99c0cddf..350dd579 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/011_emissive.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/011_emissive.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2b831e6fa9b7995333e91d13e5bf67511d0c3f080d377e5d61c5c2a4bf687c2 -size 588456 +oid sha256:98001263ed51de632fa4b0ffe2849ed7f6353a66ffa91268bf0ec1f7155a42a9 +size 716618 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png index f2e938e2..17b1310f 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/012_parallax_pom_cutout.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa2ca88cf26ea7e714866d09a2a799880565bb28dc5b1effe5352c697efcbf2b -size 736004 +oid sha256:84be838738bd05d502ae190ac440f10d1d630d1be786d06742faaa9fbe0dcd1f +size 736264 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png index 7e2787d1..ebd4557a 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e8945bb142e7c17c136f74ec6cec0a7d8edf4c9fe6437b0d31e796430396b360 -size 1314827 +oid sha256:38323fb67b937aa91f4f81cef45a5b68dde73684183a49b1a3283306f53815d0 +size 1316145 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png index 0a597e0f..6163cae7 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/013_specularaa_on.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6313898872e6e7b1163c4faaf4b1f383bd77caa491403b1a0ac7916fde7f7f62 -size 1357757 +oid sha256:d9d03c70c8214db77ad2b40f3da9a1a58b4978332b2bade840f1fe5eb84e75ea +size 1363544 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat.png b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat.png index 58d49a5f..db73cf32 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc23835009bf0d3ce499f0213668b0475f030119efcee8dc8dc4b072a4f76bad -size 1058869 +oid sha256:52511d6d118d3f9e6ce98a36a7e5acdc4c5a522744488d9918c4e2a9774d4782 +size 1059127 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap.png b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap.png index b09a4751..9ee0e732 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bccbb6e72ea23d7e77787d0daf903f6253c90c0f344da231eabacdee3d844cd8 -size 1365597 +oid sha256:8f3556fe9efc59466bb80a24c2514c923f39cad34a94e0e41027e1e5a6389c15 +size 1365697 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap_2nduv.png b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap_2nduv.png index c09de80b..965bf712 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap_2nduv.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_normalmap_2nduv.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9129799eb0aa9fa38f19ff4e2eef0a74db2cee881b5fef67af72bd7bab89dd4c -size 1292448 +oid sha256:b9a81fca8e0385ba5eddc8045cbfc00b219131370115b21be5e89031d7eeda77 +size 1292474 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_roughnessmap.png b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_roughnessmap.png index a8d48ccc..c890f9cd 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_roughnessmap.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/014_clearcoat_roughnessmap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d652eb9c30dbdd6a96f27fd7f8d415228bfec31b2ef7611ff8e7567e6e17cc6 -size 1137308 +oid sha256:e1870d81c7a39c18167c77b2d1d6904d033ebe5a2da29b0cb525b3ac31c1eea9 +size 1138053 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png index 3b9934a3..a54956e0 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4b71affbe3a42dcae65adbbc4c600ca658df8f55430a9488d870d32b5b4818a -size 746578 +oid sha256:f565fbc6b77212476129876359b269c4f3a4af7ef6ccccee572583869dc73d33 +size 746189 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png index 64d09893..5f9b0d26 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ca32ab7166fb5934a570f78230dbd84a7c82db56542189febf0634a716bfc40 -size 786635 +oid sha256:58385ecc1131c5b7bc91784c14bb067cbb805fe16d9e193a00be1866fe921baf +size 790998 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png index 30faa1b8..de8ea735 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/015_subsurfacescattering_transmission_thin.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:930034d81ba5b97081c7083ac0e331a27eed58e59b975ec390aa05453d0664bb -size 664526 +oid sha256:1ae64bc1a9f86fc0e4f0e794b1983e2d7685a9cefe0e5174a9115550ebad5168 +size 662933 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png index ea68a717..0d44ceda 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_ambientocclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:493bbf1511f6c52649236bb5a6a774c793829a2b6123cf6d37aaa808539946d2 -size 1131678 +oid sha256:186d4d3db9d8ce9f9f50a382276ac8ae9e260f941995a6cb2c981eeda19a39d2 +size 1133087 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png index 67f74711..30ba9ac6 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_metallic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e1f3ef4150fdd1d70d7b78ab5c4a7f5a974821635298374bdc87cc9ba5d67fb0 -size 1170348 +oid sha256:59947da1003bca9e3843e685ab224fe67b76801b40cc143a865c4c0282b9c48d +size 1170074 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal.png index bf9deea9..941631a3 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_normal.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:63b41ca54e1b4382014ccf99a8073ae592b877d17a8a55daf058cb8ed6de26b5 -size 1121262 +oid sha256:a76f571cd4db8a64243eb2832e4d5d0953087eb5f4215769ad16f84c338bcf60 +size 1120764 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_opacity.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_opacity.png index 1297eb78..80f79a6e 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_opacity.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_opacity.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa88f3e8b95e2da6752b3c3586fff6185f9e9d8076ed31d276964e73460940cf -size 1100541 +oid sha256:88a8f99a95959818d352b08ad97d24f202bcf16b8aac3d7e1ff1d7165e130a02 +size 1242368 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_specularf0.png b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_specularf0.png index 6ed8590a..fb4884f6 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_specularf0.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/100_uvtiling_specularf0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f3e940410cb64bc5c36a0a3e1465545d25cf5c1cab43d841c55519d030240cd -size 779838 +oid sha256:094c0aec6f1bce0a2cc8a6453b1750014bddc867e11dae37d87041562ca9e8fd +size 887846 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png index 9349e197..e834a371 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normal.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d27b457cc4cd56df235f0a60ff865f4420d645d0a38f334195715106c97cf783 -size 2141147 +oid sha256:52eb0859f0c9eba0cdb624855cf9cdfe81b62084b91d5f0fae8714e9589d5b73 +size 2141041 diff --git a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png index 009c993f..01a482bd 100644 --- a/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png +++ b/Scripts/ExpectedScreenshots/StandardPBR/104_detailmaps_normalwithmask.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:068a8a190ca713ff99b5a6424a602626e59d685ee9ec41d7003b6b7302533105 -size 2033375 +oid sha256:6bfeda7856f185c6af8f809b95c0f0eb0c5daa9403d67c96760fd714deeb8845 +size 2033194 diff --git a/Scripts/ShadowTest.bv.lua b/Scripts/ShadowTest.bv.lua index 9f35302e..0c607e11 100644 --- a/Scripts/ShadowTest.bv.lua +++ b/Scripts/ShadowTest.bv.lua @@ -70,10 +70,16 @@ function TestDirectionalLight() SetImguiValue('Cascade Position Correction', true) IdleFrames(1) CaptureScreenshot(g_screenshotOutputFolder .. '/directional_cascade_correction.png') + SetImguiValue('Cascade Position Correction', false) + + -- Directional Light Cascade Position Correction + SetImguiValue('Use Fullscreen Blur', true) + IdleFrames(1) + CaptureScreenshot(g_screenshotOutputFolder .. '/directional_fullscreen_blur.png') + SetImguiValue('Use Fullscreen Blur', false) -- Directional Light PCF low SetImguiValue('Debug Coloring', false) - SetImguiValue('Cascade Position Correction', false) SetImguiValue('Filter Method##Directional', 'PCF') SetImguiValue('Filtering # ##Directional', 4) IdleFrames(1) From 39a9cbe79193a1683e74e5e0b177220918c96217 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 26 May 2022 18:23:54 -0700 Subject: [PATCH 43/81] adding links to github issues for commented out tests Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Scripts/_FullTestSuite_.bv.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index 0b44cea6..33695c62 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -58,6 +58,7 @@ tests= { RunScriptWrapper('scripts/parallaxtest.bv.luac'), RunScriptWrapper('scripts/parallaxdepthartifacts.bv.luac'), -- Disable checkerboard pipeline as it's quite out of date and currently a maintenance burden + -- https://github.com/o3de/o3de-atom-sampleviewer/issues/456 -- RunScriptWrapper('scripts/checkerboardtest.bv.luac'), RunScriptWrapper('scripts/scenereloadsoaktest.bv.luac'), RunScriptWrapper('scripts/diffusegitest.bv.luac'), @@ -68,7 +69,8 @@ tests= { RunScriptWrapper('scripts/skinnedmesh.bv.luac'), RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'), RunScriptWrapper('scripts/PassTree.bv.luac'), - -- Seems to cause GPU Device Lost, requires further investigation. + -- ReadbackTest seems to increase frequency of GPU Device Lost to almost every run of full test suite, requires further investigation: + -- https://github.com/o3de/o3de-atom-sampleviewer/issues/455 -- RunScriptWrapper('scripts/ReadbackTest.bv.luac'), RunScriptWrapper('scripts/depthoffieldtest.bv.luac'), From 7d894cbc51e53b3dce33c8fc6255eda226b334c9 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 2 Jun 2022 13:40:06 -0700 Subject: [PATCH 44/81] forcing both RHI and RPI scene reset on sample change Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Gem/Code/Source/SampleComponentManager.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 5e1bd6cc..02fdc854 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -1559,10 +1559,8 @@ namespace AtomSampleViewer void SampleComponentManager::SwitchSceneForRHISample() { ReleaseRPIScene(); - if (!m_rhiScene) - { - CreateSceneForRHISample(); - } + ReleaseRHIScene(); + CreateSceneForRHISample(); } void SampleComponentManager::CreateSceneForRPISample() @@ -1651,10 +1649,8 @@ namespace AtomSampleViewer void SampleComponentManager::SwitchSceneForRPISample() { ReleaseRHIScene(); - if (!m_rpiScene) - { - CreateSceneForRPISample(); - } + ReleaseRPIScene(); + CreateSceneForRPISample(); } // AzFramework::AssetCatalogEventBus::Handler overrides ... From a37f0049a6cecaf74665baee280a63c08ada92f8 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:07:37 -0700 Subject: [PATCH 45/81] Fixed a timing issue in MaterialHotReloadTest. When there were many AssetBuilder.exe processes running, many reload operations seemed to happen on the same frame, which made that frame to take the entire IdleSeconds(0.25). Since the shader reloading process can span multiple frames, this was not enough of a delay. So I made the test idle for 0.25s plus 2 frames. I also made a slight improvement to MaterialHotReloadTestComponent to check the active shader variant ID without calling GetVariant, which could have impacted the behavior of the test. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Source/MaterialHotReloadTestComponent.cpp | 2 +- Scripts/MaterialHotReloadTest.bv.lua | 32 ++++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Gem/Code/Source/MaterialHotReloadTestComponent.cpp b/Gem/Code/Source/MaterialHotReloadTestComponent.cpp index 6cda4c86..25b97e57 100644 --- a/Gem/Code/Source/MaterialHotReloadTestComponent.cpp +++ b/Gem/Code/Source/MaterialHotReloadTestComponent.cpp @@ -352,7 +352,7 @@ namespace AtomSampleViewer { shaderVariantStatus = ShaderVariantStatus::FullyBaked; } - else if (activeVariantId == activeShaderList[0].m_shader->GetVariant(RootShaderVariantStableId).GetShaderVariantId()) + else if (activeVariantId.IsEmpty()) { shaderVariantStatus = ShaderVariantStatus::Root; } diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index 8e9ef3af..e28b6fbe 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -23,12 +23,20 @@ SelectImageComparisonToleranceLevel("Level E") -- test script to use too long in IdleSeconds() ExecuteConsoleCommand("r_ShaderVariantAsyncLoader_ServiceLoopDelayOverride_ms 10") +function IdleForReload() + -- Idle for a bit to give time for assets to reload + IdleSeconds(0.25) + -- Just in case the above IdleSeconds were consumed by one long frame, idle for a couple more frames, since the full reload + -- process can often span multiple frames. + IdleFrames(2) +end + function SetColorRed() AssetTracking_Start() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material") SetImguiValue('ColorA = Red', true) AssetTracking_IdleUntilExpectedAssetsFinish(10) - IdleSeconds(0.25) -- Idle for a bit to give time for the asset to reload + IdleForReload() end function SetBlendingOn() @@ -37,7 +45,7 @@ function SetBlendingOn() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) - IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload + IdleForReload() end function SetBlendingOff() @@ -46,7 +54,7 @@ function SetBlendingOff() AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) - IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload + IdleForReload() end CaptureScreenshot(g_screenshotOutputFolder .. '/01_Default.png') @@ -58,21 +66,21 @@ AssetTracking_Start() SetImguiValue('ColorA = Blue', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material") AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the asset to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/03_Blue.png') AssetTracking_Start() SetImguiValue('Default Colors', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.material") AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the asset to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/04_DefaultAgain.png') AssetTracking_Start() SetImguiValue('Wavy Lines', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/05_WavyLines.png') AssetTracking_Start() @@ -80,7 +88,7 @@ SetImguiValue('Vertical Pattern', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/06_VerticalPattern.png') SetBlendingOn() @@ -91,7 +99,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/All', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/08_Variants_All.png') -- This will switch to showing the "Shader Variant: Root" message @@ -99,7 +107,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/Only Straight Lines', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 2) -- Waiting for 2 products, the list asset and one variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/09_Variants_OnlyStraightLines.png') -- This will switch to showing the "Shader Variant: Fully Baked" message again @@ -107,7 +115,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/Only Wavy Lines', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 2) -- Waiting for 2 products, the list asset and one variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/10_Variants_OnlyWavyLines.png') -- This screenshot will be identical to the one above because the variants @@ -129,7 +137,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/All', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/13_Variants_All.png') -- Now that the material is using a fully-baked variant, modify the .azsl file to force *everything* to rebuild. In the failure case, the runtime -- holds onto the old fully-baked variant even though a new root variant is available. In the correct case, the root variant should take priority @@ -140,7 +148,7 @@ AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) -IdleSeconds(0.25) -- Idle for a bit to give time for the assets to reload +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png') -- Test a specific scenario that was failing, where color changes fail to reload after making a shader change. From ca30117440c4ee7317151da132f61de2803fc8ba Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:59:23 -0700 Subject: [PATCH 46/81] Re-enabling Readback test in ASV now that TDR is resolved Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Scripts/_FullTestSuite_.bv.lua | 4 +--- atomsampleviewer_asset_files.cmake | 38 ++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Scripts/_FullTestSuite_.bv.lua b/Scripts/_FullTestSuite_.bv.lua index b058870b..a61330e0 100644 --- a/Scripts/_FullTestSuite_.bv.lua +++ b/Scripts/_FullTestSuite_.bv.lua @@ -69,9 +69,7 @@ tests= { RunScriptWrapper('scripts/skinnedmesh.bv.luac'), RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'), RunScriptWrapper('scripts/PassTree.bv.luac'), - -- ReadbackTest seems to increase frequency of GPU Device Lost to almost every run of full test suite, requires further investigation: - -- https://github.com/o3de/o3de-atom-sampleviewer/issues/455 - -- RunScriptWrapper('scripts/ReadbackTest.bv.luac'), + RunScriptWrapper('scripts/ReadbackTest.bv.luac'), RunScriptWrapper('scripts/depthoffieldtest.bv.luac'), RunScriptWrapper('scripts/exposuretest.bv.luac'), diff --git a/atomsampleviewer_asset_files.cmake b/atomsampleviewer_asset_files.cmake index 26550928..0d64296b 100644 --- a/atomsampleviewer_asset_files.cmake +++ b/atomsampleviewer_asset_files.cmake @@ -1,9 +1,8 @@ # -# 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 -# +# 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(FILES @@ -12,46 +11,64 @@ set(FILES Materials/DynamicMaterialTest/EmissiveMaterial.shader Materials/DynamicMaterialTest/EmissiveWithCppFunctors.materialtype Materials/DynamicMaterialTest/EmissiveWithLuaFunctors.materialtype + Materials/Types/MinimalMultilayerPBR.materialtype + Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl + Materials/Types/MinimalMultilayerPBR_ForwardPass.shader Passes/CheckerboardPipeline.pass Passes/ColorblindnessSimulation.pass Passes/ColorInvertCS.pass Passes/ComplexPipeline.pass + Passes/Fullscreen.pass + Passes/FullscreenPipeline.pass Passes/ImGuiNoInput.pass Passes/ImGuiOnlyPipeline.pass Passes/Monochrome.pass Passes/RayTracingAmbientOcclusion.pass + Passes/ReadbackFiller.pass + Passes/ReadbackPipeline.pass + Passes/ReadbackPreview.pass Passes/RenderTexture.pass Passes/RHISamplePass.pass Passes/RHISamplePipeline.pass Passes/SelectorPass.pass Passes/SsaoPipeline.pass Scripts/AreaLightTest.bv.lua + Scripts/AuxGeom.bv.lua Scripts/CheckerboardTest.bv.lua Scripts/CullingAndLod.bv.lua - Scripts/EyeMaterialTest.bv.lua Scripts/Decals.bv.lua + Scripts/DepthOfFieldTest.bv.lua Scripts/DiffuseGITest.bv.lua Scripts/DynamicDraw.bv.lua Scripts/DynamicMaterialTest.bv.lua + Scripts/ExposureTest.bv.lua + Scripts/EyeMaterialTest.bv.lua Scripts/LightCulling.bv.lua Scripts/MaterialHotReloadTest.bv.lua Scripts/MaterialScreenshotTests.bv.lua Scripts/MSAA_RPI_Test.bv.lua Scripts/MultiRenderPipeline.bv.lua Scripts/MultiScene.bv.lua + Scripts/ParallaxDepthArtifacts.bv.lua Scripts/ParallaxTest.bv.lua Scripts/PassTree.bv.lua + Scripts/ReadbackTest.bv.lua + Scripts/RenderTargetTexture.bv.lua Scripts/SceneReloadSoakTest.bv.lua + Scripts/ShaderReloadSoakTest.bv.lua Scripts/ShadowedSponzaTest.bv.lua Scripts/ShadowTest.bv.lua + Scripts/SkinnedMesh.bv.lua Scripts/StreamingImageTest.bv.lua Scripts/TransparentTest.bv.lua + Scripts/_AutomatedPeriodicBenchmarkSuite_.bv.lua Scripts/_FullTestSuite_.bv.lua Shaders/DebugVertexNormals.azsl Shaders/DebugVertexNormals.materialtype Shaders/DebugVertexNormals.shader Shaders/Instanced.azsl - Shaders/MaterialEditorTest.materialtype + Shaders/MaterialEditorTest.materialtype + Shaders/StaticMesh.azsl Shaders/ComprehensiveTestMaterial/Comprehensive.materialtype Shaders/ComprehensiveTestMaterial/Stacks.azsl Shaders/ComprehensiveTestMaterial/Stacks.shader @@ -72,6 +89,10 @@ set(FILES Shaders/RayTracing/RTAOGeneration.shader Shaders/RayTracing/RTAOMiss.azsl Shaders/RayTracing/RTAOMiss.shader + Shaders/Readback/Filler.azsl + Shaders/Readback/Filler.shader + Shaders/Readback/Preview.azsl + Shaders/Readback/Preview.shader Shaders/RHI/AsyncComputeLuminanceMap.azsl Shaders/RHI/AsyncComputeLuminanceMap.shader Shaders/RHI/AsyncComputeLuminanceReduce.azsl @@ -82,6 +103,7 @@ set(FILES Shaders/RHI/AsyncComputeTonemapping.shader Shaders/RHI/BindlessPrototype.azsl Shaders/RHI/BindlessPrototype.shader + Shaders/RHI/BindlessPrototypeSrg.azsli Shaders/RHI/ColorMesh.azsl Shaders/RHI/ColorMesh.shader Shaders/RHI/Compute.azsli @@ -102,6 +124,8 @@ set(FILES Shaders/RHI/InputAssemblyCompute.shader Shaders/RHI/InputAssemblyDraw.azsl Shaders/RHI/InputAssemblyDraw.shader + Shaders/RHI/MatrixAlignmentTest.azsl + Shaders/RHI/MatrixAlignmentTest.shader Shaders/RHI/MRTScreen.azsl Shaders/RHI/MRTScreen.shader Shaders/RHI/MRTTarget.azsl From a69b9a26319fe946c4d3841e1e90161803fbfa5f Mon Sep 17 00:00:00 2001 From: moraaar Date: Tue, 28 Jun 2022 16:36:39 +0100 Subject: [PATCH 47/81] Add missing platform projects, necessary for Android. (#470) Signed-off-by: moraaar --- Platform/Android/android_project.cmake | 6 ++++++ Platform/Android/android_project.json | 9 +++++++++ Platform/Linux/linux_project.cmake | 6 ++++++ Platform/Linux/linux_project.json | 3 +++ Platform/Mac/mac_project.cmake | 6 ++++++ Platform/Mac/mac_project.json | 3 +++ Platform/Windows/windows_project.cmake | 6 ++++++ Platform/Windows/windows_project.json | 3 +++ Platform/iOS/ios_project.cmake | 6 ++++++ Platform/iOS/ios_project.json | 3 +++ 10 files changed, 51 insertions(+) create mode 100644 Platform/Android/android_project.cmake create mode 100644 Platform/Android/android_project.json create mode 100644 Platform/Linux/linux_project.cmake create mode 100644 Platform/Linux/linux_project.json create mode 100644 Platform/Mac/mac_project.cmake create mode 100644 Platform/Mac/mac_project.json create mode 100644 Platform/Windows/windows_project.cmake create mode 100644 Platform/Windows/windows_project.json create mode 100644 Platform/iOS/ios_project.cmake create mode 100644 Platform/iOS/ios_project.json diff --git a/Platform/Android/android_project.cmake b/Platform/Android/android_project.cmake new file mode 100644 index 00000000..7e6d741e --- /dev/null +++ b/Platform/Android/android_project.cmake @@ -0,0 +1,6 @@ +# 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 +# + diff --git a/Platform/Android/android_project.json b/Platform/Android/android_project.json new file mode 100644 index 00000000..38c729d9 --- /dev/null +++ b/Platform/Android/android_project.json @@ -0,0 +1,9 @@ +{ + "Tags": ["Android"], + "android_settings" : { + "package_name" : "org.o3de.AtomSampleViewer", + "version_number" : 1, + "version_name" : "1.0.0.0", + "orientation" : "landscape" + } +} \ No newline at end of file diff --git a/Platform/Linux/linux_project.cmake b/Platform/Linux/linux_project.cmake new file mode 100644 index 00000000..7e6d741e --- /dev/null +++ b/Platform/Linux/linux_project.cmake @@ -0,0 +1,6 @@ +# 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 +# + diff --git a/Platform/Linux/linux_project.json b/Platform/Linux/linux_project.json new file mode 100644 index 00000000..d08fbf53 --- /dev/null +++ b/Platform/Linux/linux_project.json @@ -0,0 +1,3 @@ +{ + "Tags": ["Linux"] +} \ No newline at end of file diff --git a/Platform/Mac/mac_project.cmake b/Platform/Mac/mac_project.cmake new file mode 100644 index 00000000..7e6d741e --- /dev/null +++ b/Platform/Mac/mac_project.cmake @@ -0,0 +1,6 @@ +# 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 +# + diff --git a/Platform/Mac/mac_project.json b/Platform/Mac/mac_project.json new file mode 100644 index 00000000..d42b6f81 --- /dev/null +++ b/Platform/Mac/mac_project.json @@ -0,0 +1,3 @@ +{ + "Tags": ["Mac"] +} \ No newline at end of file diff --git a/Platform/Windows/windows_project.cmake b/Platform/Windows/windows_project.cmake new file mode 100644 index 00000000..7e6d741e --- /dev/null +++ b/Platform/Windows/windows_project.cmake @@ -0,0 +1,6 @@ +# 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 +# + diff --git a/Platform/Windows/windows_project.json b/Platform/Windows/windows_project.json new file mode 100644 index 00000000..a052f1e0 --- /dev/null +++ b/Platform/Windows/windows_project.json @@ -0,0 +1,3 @@ +{ + "Tags": ["Windows"] +} \ No newline at end of file diff --git a/Platform/iOS/ios_project.cmake b/Platform/iOS/ios_project.cmake new file mode 100644 index 00000000..7e6d741e --- /dev/null +++ b/Platform/iOS/ios_project.cmake @@ -0,0 +1,6 @@ +# 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 +# + diff --git a/Platform/iOS/ios_project.json b/Platform/iOS/ios_project.json new file mode 100644 index 00000000..b2dab56d --- /dev/null +++ b/Platform/iOS/ios_project.json @@ -0,0 +1,3 @@ +{ + "Tags": ["iOS"] +} \ No newline at end of file From ad0efe81740eaa524a4d53529f61ed2140980214 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 28 Jun 2022 19:22:27 -0700 Subject: [PATCH 48/81] fixes for ASV screenshot tests Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Gem/Code/Source/RenderTargetTextureExampleComponent.cpp | 2 +- Scripts/MaterialHotReloadTest.bv.lua | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Gem/Code/Source/RenderTargetTextureExampleComponent.cpp b/Gem/Code/Source/RenderTargetTextureExampleComponent.cpp index 75c0e9c7..7ef5e044 100644 --- a/Gem/Code/Source/RenderTargetTextureExampleComponent.cpp +++ b/Gem/Code/Source/RenderTargetTextureExampleComponent.cpp @@ -165,7 +165,7 @@ namespace AtomSampleViewer // we need process queued changes to build the pass properly // which Scene::RebuildPipelineStatesLookup() requires - AZ::RPI::PassSystemInterface::Get()->ProcessQueuedChanges(); + renderPipeline->ProcessQueuedPassChanges(); m_scene->RebuildPipelineStatesLookup(); } diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index e28b6fbe..17aa0484 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -28,7 +28,7 @@ function IdleForReload() IdleSeconds(0.25) -- Just in case the above IdleSeconds were consumed by one long frame, idle for a couple more frames, since the full reload -- process can often span multiple frames. - IdleFrames(2) + IdleFrames(3) end function SetColorRed() @@ -123,6 +123,7 @@ CaptureScreenshot(g_screenshotOutputFolder .. '/10_Variants_OnlyWavyLines.png') AssetTracking_Start() SetImguiValue('ShaderVariantList/None', true) IdleSeconds(1.0) -- Idle for a bit to give time for the assets to disappear +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/11_Variants_None.png') -- Now, changing the .shader file will force the shader to reload and will not find @@ -137,6 +138,7 @@ AssetTracking_Start() SetImguiValue('ShaderVariantList/All', true) AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) +IdleSeconds(3.0) IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/13_Variants_All.png') -- Now that the material is using a fully-baked variant, modify the .azsl file to force *everything* to rebuild. In the failure case, the runtime @@ -148,6 +150,7 @@ AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader") AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shadervariantlist", 3) -- Waiting for 3 products, the list asset and two variant assets AssetTracking_IdleUntilExpectedAssetsFinish(10) +IdleSeconds(4.0) IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png') @@ -155,6 +158,8 @@ CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png') SetBlendingOn() SetBlendingOff() SetColorRed() +IdleSeconds(4.0) +IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/15_Red_AfterShaderReload.png') -- Clear the service loop override back to the default delay From 249f6cf07d8d5d010ada1f68cac1505bed1037d8 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Tue, 14 Jun 2022 10:28:12 -0500 Subject: [PATCH 49/81] Updates to handle api changes for multiple active screen captures and add a multi-capture sample Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 60 ++- Gem/Code/Source/Automation/ScriptManager.h | 3 +- .../MultiRenderToTextureExampleComponent.cpp | 439 ++++++++++++++++++ .../MultiRenderToTextureExampleComponent.h | 140 ++++++ Gem/Code/Source/ReadbackExampleComponent.cpp | 2 +- Gem/Code/Source/SampleComponentManager.cpp | 17 +- Gem/Code/Source/SampleComponentManager.h | 3 +- .../atomsampleviewergem_private_files.cmake | 2 + 8 files changed, 646 insertions(+), 20 deletions(-) create mode 100644 Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp create mode 100644 Gem/Code/Source/MultiRenderToTextureExampleComponent.h diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index 43faf0d1..e8f0efe6 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -320,16 +320,18 @@ namespace AtomSampleViewer if (m_scriptPaused) { - m_scriptPauseTimeout -= deltaTime; - if (m_scriptPauseTimeout < 0) - { - AZ_Error("Automation", false, "Script pause timed out. Continuing..."); - m_scriptPaused = false; - } - else - { + // Remove while debugging script screencaps + + //m_scriptPauseTimeout -= deltaTime; + //if (m_scriptPauseTimeout < 0) + //{ + // AZ_Error("Automation", false, "Script pause timed out. Continuing..."); + // m_scriptPaused = false; + //} + //else + //{ break; - } + //} } if (m_waitForAssetTracker) @@ -1451,7 +1453,13 @@ namespace AtomSampleViewer // Note this will pause the script until the capture is complete if (PrepareForScreenCapture(filePath)) { - AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath); + AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); + uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; + AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath); + if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId) + { + s_instance->m_frameCaptureId = frameCaptureId; + } } }; @@ -1478,7 +1486,13 @@ namespace AtomSampleViewer // Note this will pause the script until the capture is complete if (PrepareForScreenCapture(filePath)) { - AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath); + AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); + uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; + AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, filePath); + if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId) + { + s_instance->m_frameCaptureId = frameCaptureId; + } } }; @@ -1502,7 +1516,13 @@ namespace AtomSampleViewer // Note this will pause the script until the capture is complete if (PrepareForScreenCapture(filePath)) { - AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshotWithPreview, filePath); + AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); + uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; + AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshotWithPreview, filePath); + if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId) + { + s_instance->m_frameCaptureId = frameCaptureId; + } } }; @@ -1593,7 +1613,13 @@ namespace AtomSampleViewer // 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, readbackOption); + AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); + uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; + AZ::Render::FrameCaptureRequestBus::BroadcastResult(frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, passHierarchy, slot, outputFilePath, readbackOption); + if (frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId) + { + s_instance->m_frameCaptureId = frameCaptureId; + } } }; @@ -1604,9 +1630,15 @@ namespace AtomSampleViewer }); } - void ScriptManager::OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string &info) + void ScriptManager::OnCaptureFinished(uint32_t frameCaptureId, AZ::Render::FrameCaptureResult result, const AZStd::string &info) { + // ignore captures that are not triggered by the script manager + if (m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId || frameCaptureId != m_frameCaptureId) + { + return; + } m_isCapturePending = false; + m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; AZ::Render::FrameCaptureNotificationBus::Handler::BusDisconnect(); ResumeScript(); diff --git a/Gem/Code/Source/Automation/ScriptManager.h b/Gem/Code/Source/Automation/ScriptManager.h index 9f47fb4d..f7ceeadd 100644 --- a/Gem/Code/Source/Automation/ScriptManager.h +++ b/Gem/Code/Source/Automation/ScriptManager.h @@ -217,7 +217,7 @@ namespace AtomSampleViewer void OnCameraMoveEnded(AZ::TypeId controllerTypeId, uint32_t channels) override; // FrameCaptureNotificationBus overrides... - void OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string& info) override; + void OnCaptureFinished(uint32_t frameCaptureId, AZ::Render::FrameCaptureResult result, const AZStd::string& info) override; // ProfilingCaptureNotificationBus overrides... void OnCaptureQueryTimestampFinished(bool result, const AZStd::string& info) override; @@ -338,6 +338,7 @@ namespace AtomSampleViewer bool m_showPrecommitWizard = false; PrecommitWizardSettings m_wizardSettings; + uint32_t m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; bool m_showScriptRunnerDialog = false; bool m_isCapturePending = false; bool m_frameTimeIsLocked = false; diff --git a/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp b/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp new file mode 100644 index 00000000..449304c0 --- /dev/null +++ b/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp @@ -0,0 +1,439 @@ +/* + * 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 + * + */ + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +#include + +#include + +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include + +namespace AtomSampleViewer +{ + using namespace AZ; + + void MultiRenderToTextureExampleComponent::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ; + } + } + + MultiRenderToTextureExampleComponent::MultiRenderToTextureExampleComponent() + : m_imguiSidebar("@user@/MultiRenderToTextureExampleComponent/sidebar.xml") + { + m_sampleName = "MultiRenderToTextureExampleComponent"; + } + + void MultiRenderToTextureExampleComponent::Activate() + { + // Save references of different feature processors + m_diskLightFeatureProcessor = m_scene->GetFeatureProcessor(); + m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor(); + m_skyboxFeatureProcessor = m_scene->GetFeatureProcessor(); + m_postProcessFeatureProcessor = m_scene->GetFeatureProcessor(); + + m_ibl.PreloadAssets(); + + // Don't continue the script until assets are ready and scene is setup + ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::PauseScriptWithTimeout, 120.0f); + + // preload assets + AZStd::vector assetList = { + {DefaultPbrMaterialPath, azrtti_typeid()}, + {BunnyModelFilePath, azrtti_typeid()}, + {CubeModelFilePath, azrtti_typeid()} + }; + + PreloadAssets(assetList); + } + + void MultiRenderToTextureExampleComponent::OnAllAssetsReadyActivate() + { + SetupScene(); + + AZ::TickBus::Handler::BusConnect(); + m_imguiSidebar.Activate(); + ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript); + } + + void MultiRenderToTextureExampleComponent::SetupScene() + { + auto meshFeatureProcessor = GetMeshFeatureProcessor(); + + auto materialAsset = RPI::AssetUtils::LoadAssetByProductPath(DefaultPbrMaterialPath, + RPI::AssetUtils::TraceLevel::Assert); + auto material = AZ::RPI::Material::FindOrCreate(materialAsset); + auto bunnyAsset = RPI::AssetUtils::LoadAssetByProductPath(BunnyModelFilePath, + RPI::AssetUtils::TraceLevel::Assert); + auto floorAsset = RPI::AssetUtils::LoadAssetByProductPath(CubeModelFilePath, + RPI::AssetUtils::TraceLevel::Assert); + m_floorMeshHandle = meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor{ floorAsset }, material); + for (uint32_t bunnyIndex = 0; bunnyIndex < BunnyCount; bunnyIndex++) + { + m_bunnyMeshHandles[bunnyIndex] = meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor{ bunnyAsset }, material); + } + + const Vector3 floorNonUniformScale{ 12.f, 12.f, 0.1f }; + const Vector3 translation{ 0.f, 0.f, -0.05f }; + Transform floorTransform = Transform::CreateTranslation(translation); + meshFeatureProcessor->SetTransform(m_floorMeshHandle, floorTransform, floorNonUniformScale); + + meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[0], Transform::CreateTranslation(Vector3(0.f, 0.f, 0.21f))); + meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[1], Transform::CreateTranslation(Vector3(-3.f, 3.f, 0.21f))); + meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[2], Transform::CreateTranslation(Vector3(3.f, 3.f, 0.21f))); + meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[3], Transform::CreateTranslation(Vector3(3.f, -3.f, 0.21f))); + meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[4], Transform::CreateTranslation(Vector3(-3.f, -3.f, 0.21f))); + + // Set camera to use no clip controller + AZ::Debug::CameraControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::CameraControllerRequestBus::Events::Enable, + azrtti_typeid()); + AZ::Debug::NoClipControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::NoClipControllerRequestBus::Events::SetFov, AZ::DegToRad(90)); + + // Set camera's initial transform + Transform cameraLookat = Transform::CreateLookAt(Vector3(-2.15f, -5.25f, 1.6f), Vector3(-0.5f, -2.0f, 0)); + AZ::TransformBus::Event(GetCameraEntityId(), &AZ::TransformInterface::SetWorldTM, cameraLookat); + + if (m_enabledDepthOfField) + { + EnableDepthOfField(); + } + if (m_hasDirectionalLight) + { + AddDirectionalLight(); + } + if (m_hasDiskLight) + { + AddDiskLight(); + } + if (m_enabledSkybox) + { + EnableSkybox(); + } + if (m_hasIBL) + { + AddIBL(); + } + + AddRenderToTextureCamera(); + AddRenderToTextureCamera(); + AddRenderToTextureCamera(); + } + + void MultiRenderToTextureExampleComponent::EnableDepthOfField() + { + if (m_postProcessFeatureProcessor) + { + auto* postProcessSettings = m_postProcessFeatureProcessor->GetOrCreateSettingsInterface(GetCameraEntityId()); + auto* dofSettings = postProcessSettings->GetOrCreateDepthOfFieldSettingsInterface(); + dofSettings->SetQualityLevel(1); + dofSettings->SetApertureF(0.5f); + dofSettings->SetEnableDebugColoring(false); + dofSettings->SetEnableAutoFocus(true); + dofSettings->SetAutoFocusScreenPosition(AZ::Vector2{ 0.5f, 0.5f }); + dofSettings->SetAutoFocusSensitivity(1.0f); + dofSettings->SetAutoFocusSpeed(Render::DepthOfField::AutoFocusSpeedMax); + dofSettings->SetAutoFocusDelay(0.2f); + dofSettings->SetCameraEntityId(GetCameraEntityId()); + dofSettings->SetEnabled(true); + dofSettings->OnConfigChanged(); + + // associate a setting to the primary view + AZ::RPI::ViewPtr cameraView; + AZ::RPI::ViewProviderBus::EventResult(cameraView, GetCameraEntityId(), &AZ::RPI::ViewProvider::GetView); + AZ::Render::PostProcessSettingsInterface::ViewBlendWeightMap perViewBlendWeights; + perViewBlendWeights[cameraView.get()] = 1.0; + postProcessSettings->CopyViewToBlendWeightSettings(perViewBlendWeights); + } + } + + void MultiRenderToTextureExampleComponent::DisableDepthOfField() + { + if (m_postProcessFeatureProcessor) + { + auto* postProcessSettings = m_postProcessFeatureProcessor->GetOrCreateSettingsInterface(GetCameraEntityId()); + auto* dofSettings = postProcessSettings->GetOrCreateDepthOfFieldSettingsInterface(); + dofSettings->SetEnabled(false); + dofSettings->OnConfigChanged(); + } + } + + void MultiRenderToTextureExampleComponent::AddDirectionalLight() + { + if (m_directionalLightHandle.IsValid()) + { + return; + } + + auto& featureProcessor = m_directionalLightFeatureProcessor; + + DirectionalLightHandle handle = featureProcessor->AcquireLight(); + + const auto lightTransform = Transform::CreateLookAt( + Vector3(100, 100, 100), + Vector3::CreateZero()); + + featureProcessor->SetDirection(handle, lightTransform.GetBasis(1)); + AZ::Render::PhotometricColor lightColor(Color::CreateOne() * 5.0f); + featureProcessor->SetRgbIntensity(handle, lightColor); + featureProcessor->SetCascadeCount(handle, 4); + featureProcessor->SetShadowmapSize(handle, Render::ShadowmapSize::Size2048); + featureProcessor->SetViewFrustumCorrectionEnabled(handle, true); + featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast(m_shadowFilteringMethod)); + featureProcessor->SetFilteringSampleCount(handle, 32); + featureProcessor->SetGroundHeight(handle, 0.f); + featureProcessor->SetShadowFarClipDistance(handle, 100.f); + + m_directionalLightHandle = handle; + } + + void MultiRenderToTextureExampleComponent::RemoveDirectionalLight() + { + if (m_directionalLightHandle.IsValid()) + { + m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle); + } + } + + void MultiRenderToTextureExampleComponent::AddDiskLight() + { + Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor; + + const DiskLightHandle handle = featureProcessor->AcquireLight(); + + AZ::Render::PhotometricColor lightColor(Colors::Green * 500.0f); + featureProcessor->SetRgbIntensity(handle, lightColor); + featureProcessor->SetAttenuationRadius(handle, 30.0f); + featureProcessor->SetConeAngles(handle, DegToRad(17.5f * 0.9f), DegToRad(17.5f)); + featureProcessor->SetShadowsEnabled(handle, true); + featureProcessor->SetShadowmapMaxResolution(handle, Render::ShadowmapSize::Size1024); + Vector3 position(0, 5, 7); + Vector3 direction = -position; + direction.Normalize(); + featureProcessor->SetPosition(handle, position); + featureProcessor->SetDirection(handle, direction); + + m_diskLightHandle = handle; + } + + void MultiRenderToTextureExampleComponent::RemoveDiskLight() + { + if (m_diskLightHandle.IsValid()) + { + m_diskLightFeatureProcessor->ReleaseLight(m_diskLightHandle); + } + } + + void MultiRenderToTextureExampleComponent::EnableSkybox() + { + m_skyboxFeatureProcessor->SetSkyboxMode(AZ::Render::SkyBoxMode::PhysicalSky); + m_skyboxFeatureProcessor->Enable(true); + } + + void MultiRenderToTextureExampleComponent::DisableSkybox() + { + if (m_skyboxFeatureProcessor) + { + m_skyboxFeatureProcessor->Enable(false); + } + } + + void MultiRenderToTextureExampleComponent::AddIBL() + { + m_ibl.Init(m_scene); + } + + void MultiRenderToTextureExampleComponent::RemoveIBL() + { + m_ibl.Reset(); + } + + void MultiRenderToTextureExampleComponent::AddRenderToTextureCamera() + { + const uint32_t width = 320; + const uint32_t height = 240; + uint32_t renderIndex = aznumeric_cast(m_renderToTextureContexts.size()); + RenderToTextureContext rttc; + AZStd::string pipelineName = AZStd::string::format("RenderToTexture_pipeline%d", renderIndex+1); + AZ_TracePrintf("AtomSampleViewer", "Initializing pipeline for %s\n", pipelineName.c_str()); + AZ::Name viewName = AZ::Name(AZStd::string::format("RTT_Camera_%d", renderIndex).c_str()); + rttc.m_view = AZ::RPI::View::CreateView(viewName, AZ::RPI::View::UsageCamera); + float aspectRatio = static_cast(width)/static_cast(height); + + AZ::Matrix4x4 viewToClipMatrix; + AZ::MakePerspectiveFovMatrixRH(viewToClipMatrix, AZ::DegToRad(90.0f), aspectRatio, 0.1f, 100.0f, true); + rttc.m_view->SetViewToClipMatrix(viewToClipMatrix); + + AZ::Matrix4x4 localToWorldMat = AZ::Matrix4x4::CreateTranslation(Vector3(2.75f, 5.25f, 1.49f)) * AZ::Matrix4x4::CreateRotationZ(AZ::DegToRad(19.0f * static_cast(renderIndex))); + rttc.m_view->SetWorldToViewMatrix(localToWorldMat.GetInverseFast()); + + AZ::RPI::RenderPipelineDescriptor pipelineDesc; + pipelineDesc.m_mainViewTagName = "MainCamera"; + pipelineDesc.m_name = pipelineName; + pipelineDesc.m_rootPassTemplate = "MainPipelineRenderToTexture"; + pipelineDesc.m_renderSettings.m_multisampleState.m_samples = 4; + rttc.m_pipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); + rttc.m_pipeline->RemoveFromRenderTick(); + + if (auto renderToTexturePass = azrtti_cast(rttc.m_pipeline->GetRootPass().get())) + { + renderToTexturePass->ResizeOutput(width, height); + } + + auto pass = rttc.m_pipeline->FindFirstPass(AZ::Name("SlowClearPass")); + if (auto slowClearPass = azrtti_cast(pass)) + { + slowClearPass->SetClearValue( + static_cast(renderIndex==0), + static_cast(renderIndex==1), + static_cast(renderIndex==2), + 1 + ); + } + + m_scene->AddRenderPipeline(rttc.m_pipeline); + + rttc.m_passHierarchy.push_back(pipelineName); + rttc.m_passHierarchy.push_back("CopyToSwapChain"); + + rttc.m_pipeline->SetDefaultView(rttc.m_view); + rttc.m_targetView = m_scene->GetDefaultRenderPipeline()->GetDefaultView(); + if (auto* fp = m_scene->GetFeatureProcessor()) + { + fp->SetViewAlias(rttc.m_view, rttc.m_targetView); + } + + m_renderToTextureContexts.push_back(rttc); + } + + void MultiRenderToTextureExampleComponent::DestroyRenderToTextureCamera(uint32_t index) + { + RenderToTextureContext& rttc = m_renderToTextureContexts[index]; + if (auto* fp = m_scene->GetFeatureProcessor()) + { + fp->RemoveViewAlias(rttc.m_view); + } + m_scene->RemoveRenderPipeline(rttc.m_pipeline->GetId()); + rttc.m_passHierarchy.clear(); + rttc.m_pipeline.reset(); + rttc.m_view.reset(); + rttc.m_targetView.reset(); +} + + + void MultiRenderToTextureExampleComponent::CleanUpScene() + { + RemoveIBL(); + DisableSkybox(); + RemoveDiskLight(); + RemoveDirectionalLight(); + DisableDepthOfField(); + + for (uint32_t index = 0; index < m_renderToTextureContexts.size(); ++index) + { + DestroyRenderToTextureCamera(index); + } + + GetMeshFeatureProcessor()->ReleaseMesh(m_floorMeshHandle); + for (auto index = 0; index < BunnyCount; index++) + { + GetMeshFeatureProcessor()->ReleaseMesh(m_bunnyMeshHandles[index]); + } + } + + void MultiRenderToTextureExampleComponent::Deactivate() + { + m_imguiSidebar.Deactivate(); + AZ::TickBus::Handler::BusDisconnect(); + + CleanUpScene(); + + m_directionalLightFeatureProcessor = nullptr; + m_diskLightFeatureProcessor = nullptr; + m_skyboxFeatureProcessor = nullptr; + m_scene = nullptr; + } + + void MultiRenderToTextureExampleComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint timePoint) + { + if (m_hasDirectionalLight) + { + auto& featureProcessor = m_directionalLightFeatureProcessor; + Transform cameraTransform = Transform::CreateIdentity(); + TransformBus::EventResult( + cameraTransform, + GetCameraEntityId(), + &TransformBus::Events::GetWorldTM); + featureProcessor->SetCameraTransform( + m_directionalLightHandle, + cameraTransform); + } + + if (m_imguiSidebar.Begin()) + { + ImGui::Spacing(); + + ImGui::Text("Second RenderPipeline"); + + m_imguiSidebar.End(); + } + + for (uint32_t index = 0; index < m_renderToTextureContexts.size(); ++index) + { + RenderToTextureContext& rttc = m_renderToTextureContexts[index]; + rttc.m_pipeline->AddToRenderTickOnce(); + AZStd::string outputImageName = AZStd::string::format("MultiRenderToTextureImage_cam%d_image%d.png", index, rttc.m_imageCount++); + AZ::Render::FrameCaptureRequestBus::Broadcast( + &AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, + rttc.m_passHierarchy, + AZStd::string("Output"), + outputImageName, + AZ::RPI::PassAttachmentReadbackOption::Output); + + } + } + + +} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/MultiRenderToTextureExampleComponent.h b/Gem/Code/Source/MultiRenderToTextureExampleComponent.h new file mode 100644 index 00000000..9137f1c8 --- /dev/null +++ b/Gem/Code/Source/MultiRenderToTextureExampleComponent.h @@ -0,0 +1,140 @@ +/* + * 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 + * + */ + +#pragma once + +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +struct ImGuiContext; + +namespace AtomSampleViewer +{ + //! A sample component which render the same scene with different render pipelines in different windows + //! It has a imgui menu to switch on/off the second render pipeline as well as turn on/off different graphics features + //! There is also an option to have the second render pipeline to use the second camera. + class MultiRenderToTextureExampleComponent final + : public CommonSampleComponentBase + , public AZ::TickBus::Handler + { + public: + AZ_COMPONENT(MultiRenderToTextureExampleComponent, "{C9602E16-8D75-481D-B430-6C0622AD1E6D}", CommonSampleComponentBase); + + static void Reflect(AZ::ReflectContext* context); + + MultiRenderToTextureExampleComponent(); + ~MultiRenderToTextureExampleComponent() final = default; + + // AZ::Component + void Activate() override; + void Deactivate() override; + + private: + // AZ::TickBus::Handler overrides ... + void OnTick(float deltaTime, AZ::ScriptTimePoint timePoint) override; + + // CommonSampleComponentBase overrides... + void OnAllAssetsReadyActivate() override; + + // Add render content to the scene + void SetupScene(); + // Clean up render content in the scene + void CleanUpScene(); + + // enable/disable different features for the second render pipeline + void EnableDepthOfField(); + void DisableDepthOfField(); + + void AddDirectionalLight(); + void RemoveDirectionalLight(); + + void AddDiskLight(); + void RemoveDiskLight(); + + void EnableSkybox(); + void DisableSkybox(); + + void AddIBL(); + void RemoveIBL(); + + void AddRenderToTextureCamera(); + void DestroyRenderToTextureCamera(uint32_t index); + + // For draw menus of selecting pipelines + ImGuiSidebar m_imguiSidebar; + + // For scene content + using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle; + using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle; + using MeshHandle = AZ::Render::MeshFeatureProcessorInterface::MeshHandle; + + // Directional light + AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr; + DirectionalLightHandle m_directionalLightHandle; + // Disk light + AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr; + DiskLightHandle m_diskLightHandle; + // Meshes + MeshHandle m_floorMeshHandle; + + static const uint32_t BunnyCount = 5; + MeshHandle m_bunnyMeshHandles[BunnyCount]; + // Skybox + AZ::Render::SkyBoxFeatureProcessorInterface* m_skyboxFeatureProcessor = nullptr; + // IBL + Utils::DefaultIBL m_ibl; + // Post Process + AZ::Render::PostProcessFeatureProcessorInterface* m_postProcessFeatureProcessor = nullptr; + AZ::Entity* m_depthOfFieldEntity = nullptr; + + // flags of features enabled + bool m_enabledDepthOfField = true; + bool m_hasDirectionalLight = true; + bool m_hasDiskLight = true; + bool m_enabledSkybox = true; + bool m_hasIBL = true; + bool m_enableSecondRenderPipeline = true; + bool m_useSecondCamera = false; + + // for directional light + int m_shadowFilteringMethod = aznumeric_cast(AZ::Render::ShadowFilterMethod::EsmPcf); + + // For second render pipeline + AZStd::shared_ptr m_secondWindow; + AZStd::shared_ptr m_secondWindowContext; + + struct RenderToTextureContext + { + AZStd::vector m_passHierarchy; + AZ::RPI::RenderPipelinePtr m_pipeline; + AZ::RPI::ViewPtr m_view; + AZ::RPI::ViewPtr m_targetView; + + uint32_t m_imageCount = 0; + }; + AZStd::vector m_renderToTextureContexts; + }; + +} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/ReadbackExampleComponent.cpp b/Gem/Code/Source/ReadbackExampleComponent.cpp index af0a4eac..3be61e17 100644 --- a/Gem/Code/Source/ReadbackExampleComponent.cpp +++ b/Gem/Code/Source/ReadbackExampleComponent.cpp @@ -271,7 +271,7 @@ namespace AtomSampleViewer m_readback->SetCallback(AZStd::bind(&ReadbackExampleComponent::ReadbackCallback, this, AZStd::placeholders::_1)); } - m_fillerPass->ReadbackAttachment(m_readback, AZ::Name("Output")); + m_fillerPass->ReadbackAttachment(m_readback, 0, AZ::Name("Output")); } void ReadbackExampleComponent::ReadbackCallback(const AZ::RPI::AttachmentReadback::ReadbackResult& result) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 02fdc854..25cd71f7 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -88,6 +88,7 @@ #include #include #include +#include #include #include #include @@ -288,6 +289,7 @@ namespace AtomSampleViewer NewRPISample("Mesh"), NewRPISample("MSAA"), NewRPISample("MultiRenderPipeline"), + NewRPISample("MultiRenderToTexture"), NewRPISample("MultiScene"), NewRPISample("MultiViewSingleSceneAuxGeom"), NewRPISample("Readback"), @@ -619,8 +621,11 @@ namespace AtomSampleViewer else if (m_countdownForFrameCapture == 0) { AZ::Render::FrameCaptureNotificationBus::Handler::BusConnect(); - AZ::Render::FrameCaptureRequestBus::Broadcast(&AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, m_frameCaptureFilePath); - m_countdownForFrameCapture = -1; // Don't call CaptureScreenshot again + AZ::Render::FrameCaptureRequestBus::BroadcastResult(m_frameCaptureId, &AZ::Render::FrameCaptureRequestBus::Events::CaptureScreenshot, m_frameCaptureFilePath); + if (m_frameCaptureId != AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId ) // if unsuccessfull leave state to attempt again next tick + { + m_countdownForFrameCapture = -1; // Don't call CaptureScreenshot again + } } } } @@ -1201,6 +1206,7 @@ namespace AtomSampleViewer void SampleComponentManager::RequestFrameCapture(const AZStd::string& filePath, bool hideImGui) { AZ_Assert(false == m_isFrameCapturePending, "Frame capture already in progress"); + AZ_Assert(AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId == m_frameCaptureId, "Unfinished frame capture detected"); m_isFrameCapturePending = true; m_hideImGuiDuringFrameCapture = hideImGui; m_frameCaptureFilePath = filePath; @@ -1224,8 +1230,12 @@ namespace AtomSampleViewer } } - void SampleComponentManager::OnCaptureFinished(AZ::Render::FrameCaptureResult /*result*/, const AZStd::string& /*info*/) + void SampleComponentManager::OnCaptureFinished(uint32_t captureId, AZ::Render::FrameCaptureResult /*result*/, const AZStd::string& /*info*/) { + if (captureId != m_frameCaptureId) // ignore captures from other systems + { + return; + } AZ::Render::FrameCaptureNotificationBus::Handler::BusDisconnect(); if (m_hideImGuiDuringFrameCapture) @@ -1238,6 +1248,7 @@ namespace AtomSampleViewer ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript); m_isFrameCapturePending = false; + m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; } bool SampleComponentManager::IsFrameCapturePending() diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index 9582b1d0..60a42620 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -159,7 +159,7 @@ namespace AtomSampleViewer void ClearRPIScene() override; // FrameCaptureNotificationBus overrides... - void OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string& info) override; + void OnCaptureFinished(uint32_t frameCaptureId, AZ::Render::FrameCaptureResult result, const AZStd::string& info) override; // AzFramework::AssetCatalogEventBus::Handler overrides ... void OnCatalogLoaded(const char* catalogFile) override; @@ -247,6 +247,7 @@ namespace AtomSampleViewer bool m_isFrameCapturePending = false; bool m_hideImGuiDuringFrameCapture = true; int m_countdownForFrameCapture = 0; + uint32_t m_frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; AZStd::string m_frameCaptureFilePath; AZStd::unique_ptr m_scriptManager; diff --git a/Gem/Code/atomsampleviewergem_private_files.cmake b/Gem/Code/atomsampleviewergem_private_files.cmake index f8be2522..049fef1f 100644 --- a/Gem/Code/atomsampleviewergem_private_files.cmake +++ b/Gem/Code/atomsampleviewergem_private_files.cmake @@ -139,6 +139,8 @@ set(FILES Source/MSAA_RPI_ExampleComponent.h Source/MultiRenderPipelineExampleComponent.cpp Source/MultiRenderPipelineExampleComponent.h + Source/MultiRenderToTextureExampleComponent.cpp + Source/MultiRenderToTextureExampleComponent.h Source/MultiSceneExampleComponent.cpp Source/MultiSceneExampleComponent.h Source/MultiViewSingleSceneAuxGeomExampleComponent.cpp From 59fa2aef216a481b6d1b76c5564e2ccbd91dc95b Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Tue, 28 Jun 2022 10:31:40 -0500 Subject: [PATCH 50/81] Fix render to texture camera to start matching the screen viewport and then rotate 19 degrees for each new instance Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Source/MultiRenderToTextureExampleComponent.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp b/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp index 449304c0..c4f9dbeb 100644 --- a/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp +++ b/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp @@ -292,8 +292,8 @@ namespace AtomSampleViewer void MultiRenderToTextureExampleComponent::AddRenderToTextureCamera() { - const uint32_t width = 320; - const uint32_t height = 240; + const uint32_t width = 640; + const uint32_t height = 480; uint32_t renderIndex = aznumeric_cast(m_renderToTextureContexts.size()); RenderToTextureContext rttc; AZStd::string pipelineName = AZStd::string::format("RenderToTexture_pipeline%d", renderIndex+1); @@ -302,13 +302,14 @@ namespace AtomSampleViewer rttc.m_view = AZ::RPI::View::CreateView(viewName, AZ::RPI::View::UsageCamera); float aspectRatio = static_cast(width)/static_cast(height); + AZ::Vector3 camPos = AZ::Matrix4x4::CreateRotationZ(AZ::DegToRad(19.0f * static_cast(renderIndex))) * Vector3(-2.15f, -5.25f, 1.6f); + AZ::Matrix3x4 cameraLookat = Matrix3x4::CreateLookAt(camPos, Vector3(0.f, 0.f, 0.f)); + rttc.m_view->SetCameraTransform(cameraLookat); + AZ::Matrix4x4 viewToClipMatrix; AZ::MakePerspectiveFovMatrixRH(viewToClipMatrix, AZ::DegToRad(90.0f), aspectRatio, 0.1f, 100.0f, true); rttc.m_view->SetViewToClipMatrix(viewToClipMatrix); - AZ::Matrix4x4 localToWorldMat = AZ::Matrix4x4::CreateTranslation(Vector3(2.75f, 5.25f, 1.49f)) * AZ::Matrix4x4::CreateRotationZ(AZ::DegToRad(19.0f * static_cast(renderIndex))); - rttc.m_view->SetWorldToViewMatrix(localToWorldMat.GetInverseFast()); - AZ::RPI::RenderPipelineDescriptor pipelineDesc; pipelineDesc.m_mainViewTagName = "MainCamera"; pipelineDesc.m_name = pipelineName; From c8db7c0b336bd577dfa48589ec8197996a3935c0 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 29 Jun 2022 15:32:41 -0500 Subject: [PATCH 51/81] Remove the MultiRenderToTextureExampleComponent Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../MultiRenderToTextureExampleComponent.cpp | 440 ------------------ .../MultiRenderToTextureExampleComponent.h | 140 ------ Gem/Code/Source/SampleComponentManager.cpp | 2 - .../atomsampleviewergem_private_files.cmake | 2 - 4 files changed, 584 deletions(-) delete mode 100644 Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp delete mode 100644 Gem/Code/Source/MultiRenderToTextureExampleComponent.h diff --git a/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp b/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp deleted file mode 100644 index c4f9dbeb..00000000 --- a/Gem/Code/Source/MultiRenderToTextureExampleComponent.cpp +++ /dev/null @@ -1,440 +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 - * - */ - -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include - -#include - -#include - -namespace AtomSampleViewer -{ - using namespace AZ; - - void MultiRenderToTextureExampleComponent::Reflect(AZ::ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(0) - ; - } - } - - MultiRenderToTextureExampleComponent::MultiRenderToTextureExampleComponent() - : m_imguiSidebar("@user@/MultiRenderToTextureExampleComponent/sidebar.xml") - { - m_sampleName = "MultiRenderToTextureExampleComponent"; - } - - void MultiRenderToTextureExampleComponent::Activate() - { - // Save references of different feature processors - m_diskLightFeatureProcessor = m_scene->GetFeatureProcessor(); - m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor(); - m_skyboxFeatureProcessor = m_scene->GetFeatureProcessor(); - m_postProcessFeatureProcessor = m_scene->GetFeatureProcessor(); - - m_ibl.PreloadAssets(); - - // Don't continue the script until assets are ready and scene is setup - ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::PauseScriptWithTimeout, 120.0f); - - // preload assets - AZStd::vector assetList = { - {DefaultPbrMaterialPath, azrtti_typeid()}, - {BunnyModelFilePath, azrtti_typeid()}, - {CubeModelFilePath, azrtti_typeid()} - }; - - PreloadAssets(assetList); - } - - void MultiRenderToTextureExampleComponent::OnAllAssetsReadyActivate() - { - SetupScene(); - - AZ::TickBus::Handler::BusConnect(); - m_imguiSidebar.Activate(); - ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript); - } - - void MultiRenderToTextureExampleComponent::SetupScene() - { - auto meshFeatureProcessor = GetMeshFeatureProcessor(); - - auto materialAsset = RPI::AssetUtils::LoadAssetByProductPath(DefaultPbrMaterialPath, - RPI::AssetUtils::TraceLevel::Assert); - auto material = AZ::RPI::Material::FindOrCreate(materialAsset); - auto bunnyAsset = RPI::AssetUtils::LoadAssetByProductPath(BunnyModelFilePath, - RPI::AssetUtils::TraceLevel::Assert); - auto floorAsset = RPI::AssetUtils::LoadAssetByProductPath(CubeModelFilePath, - RPI::AssetUtils::TraceLevel::Assert); - m_floorMeshHandle = meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor{ floorAsset }, material); - for (uint32_t bunnyIndex = 0; bunnyIndex < BunnyCount; bunnyIndex++) - { - m_bunnyMeshHandles[bunnyIndex] = meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor{ bunnyAsset }, material); - } - - const Vector3 floorNonUniformScale{ 12.f, 12.f, 0.1f }; - const Vector3 translation{ 0.f, 0.f, -0.05f }; - Transform floorTransform = Transform::CreateTranslation(translation); - meshFeatureProcessor->SetTransform(m_floorMeshHandle, floorTransform, floorNonUniformScale); - - meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[0], Transform::CreateTranslation(Vector3(0.f, 0.f, 0.21f))); - meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[1], Transform::CreateTranslation(Vector3(-3.f, 3.f, 0.21f))); - meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[2], Transform::CreateTranslation(Vector3(3.f, 3.f, 0.21f))); - meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[3], Transform::CreateTranslation(Vector3(3.f, -3.f, 0.21f))); - meshFeatureProcessor->SetTransform(m_bunnyMeshHandles[4], Transform::CreateTranslation(Vector3(-3.f, -3.f, 0.21f))); - - // Set camera to use no clip controller - AZ::Debug::CameraControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::CameraControllerRequestBus::Events::Enable, - azrtti_typeid()); - AZ::Debug::NoClipControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::NoClipControllerRequestBus::Events::SetFov, AZ::DegToRad(90)); - - // Set camera's initial transform - Transform cameraLookat = Transform::CreateLookAt(Vector3(-2.15f, -5.25f, 1.6f), Vector3(-0.5f, -2.0f, 0)); - AZ::TransformBus::Event(GetCameraEntityId(), &AZ::TransformInterface::SetWorldTM, cameraLookat); - - if (m_enabledDepthOfField) - { - EnableDepthOfField(); - } - if (m_hasDirectionalLight) - { - AddDirectionalLight(); - } - if (m_hasDiskLight) - { - AddDiskLight(); - } - if (m_enabledSkybox) - { - EnableSkybox(); - } - if (m_hasIBL) - { - AddIBL(); - } - - AddRenderToTextureCamera(); - AddRenderToTextureCamera(); - AddRenderToTextureCamera(); - } - - void MultiRenderToTextureExampleComponent::EnableDepthOfField() - { - if (m_postProcessFeatureProcessor) - { - auto* postProcessSettings = m_postProcessFeatureProcessor->GetOrCreateSettingsInterface(GetCameraEntityId()); - auto* dofSettings = postProcessSettings->GetOrCreateDepthOfFieldSettingsInterface(); - dofSettings->SetQualityLevel(1); - dofSettings->SetApertureF(0.5f); - dofSettings->SetEnableDebugColoring(false); - dofSettings->SetEnableAutoFocus(true); - dofSettings->SetAutoFocusScreenPosition(AZ::Vector2{ 0.5f, 0.5f }); - dofSettings->SetAutoFocusSensitivity(1.0f); - dofSettings->SetAutoFocusSpeed(Render::DepthOfField::AutoFocusSpeedMax); - dofSettings->SetAutoFocusDelay(0.2f); - dofSettings->SetCameraEntityId(GetCameraEntityId()); - dofSettings->SetEnabled(true); - dofSettings->OnConfigChanged(); - - // associate a setting to the primary view - AZ::RPI::ViewPtr cameraView; - AZ::RPI::ViewProviderBus::EventResult(cameraView, GetCameraEntityId(), &AZ::RPI::ViewProvider::GetView); - AZ::Render::PostProcessSettingsInterface::ViewBlendWeightMap perViewBlendWeights; - perViewBlendWeights[cameraView.get()] = 1.0; - postProcessSettings->CopyViewToBlendWeightSettings(perViewBlendWeights); - } - } - - void MultiRenderToTextureExampleComponent::DisableDepthOfField() - { - if (m_postProcessFeatureProcessor) - { - auto* postProcessSettings = m_postProcessFeatureProcessor->GetOrCreateSettingsInterface(GetCameraEntityId()); - auto* dofSettings = postProcessSettings->GetOrCreateDepthOfFieldSettingsInterface(); - dofSettings->SetEnabled(false); - dofSettings->OnConfigChanged(); - } - } - - void MultiRenderToTextureExampleComponent::AddDirectionalLight() - { - if (m_directionalLightHandle.IsValid()) - { - return; - } - - auto& featureProcessor = m_directionalLightFeatureProcessor; - - DirectionalLightHandle handle = featureProcessor->AcquireLight(); - - const auto lightTransform = Transform::CreateLookAt( - Vector3(100, 100, 100), - Vector3::CreateZero()); - - featureProcessor->SetDirection(handle, lightTransform.GetBasis(1)); - AZ::Render::PhotometricColor lightColor(Color::CreateOne() * 5.0f); - featureProcessor->SetRgbIntensity(handle, lightColor); - featureProcessor->SetCascadeCount(handle, 4); - featureProcessor->SetShadowmapSize(handle, Render::ShadowmapSize::Size2048); - featureProcessor->SetViewFrustumCorrectionEnabled(handle, true); - featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast(m_shadowFilteringMethod)); - featureProcessor->SetFilteringSampleCount(handle, 32); - featureProcessor->SetGroundHeight(handle, 0.f); - featureProcessor->SetShadowFarClipDistance(handle, 100.f); - - m_directionalLightHandle = handle; - } - - void MultiRenderToTextureExampleComponent::RemoveDirectionalLight() - { - if (m_directionalLightHandle.IsValid()) - { - m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle); - } - } - - void MultiRenderToTextureExampleComponent::AddDiskLight() - { - Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor; - - const DiskLightHandle handle = featureProcessor->AcquireLight(); - - AZ::Render::PhotometricColor lightColor(Colors::Green * 500.0f); - featureProcessor->SetRgbIntensity(handle, lightColor); - featureProcessor->SetAttenuationRadius(handle, 30.0f); - featureProcessor->SetConeAngles(handle, DegToRad(17.5f * 0.9f), DegToRad(17.5f)); - featureProcessor->SetShadowsEnabled(handle, true); - featureProcessor->SetShadowmapMaxResolution(handle, Render::ShadowmapSize::Size1024); - Vector3 position(0, 5, 7); - Vector3 direction = -position; - direction.Normalize(); - featureProcessor->SetPosition(handle, position); - featureProcessor->SetDirection(handle, direction); - - m_diskLightHandle = handle; - } - - void MultiRenderToTextureExampleComponent::RemoveDiskLight() - { - if (m_diskLightHandle.IsValid()) - { - m_diskLightFeatureProcessor->ReleaseLight(m_diskLightHandle); - } - } - - void MultiRenderToTextureExampleComponent::EnableSkybox() - { - m_skyboxFeatureProcessor->SetSkyboxMode(AZ::Render::SkyBoxMode::PhysicalSky); - m_skyboxFeatureProcessor->Enable(true); - } - - void MultiRenderToTextureExampleComponent::DisableSkybox() - { - if (m_skyboxFeatureProcessor) - { - m_skyboxFeatureProcessor->Enable(false); - } - } - - void MultiRenderToTextureExampleComponent::AddIBL() - { - m_ibl.Init(m_scene); - } - - void MultiRenderToTextureExampleComponent::RemoveIBL() - { - m_ibl.Reset(); - } - - void MultiRenderToTextureExampleComponent::AddRenderToTextureCamera() - { - const uint32_t width = 640; - const uint32_t height = 480; - uint32_t renderIndex = aznumeric_cast(m_renderToTextureContexts.size()); - RenderToTextureContext rttc; - AZStd::string pipelineName = AZStd::string::format("RenderToTexture_pipeline%d", renderIndex+1); - AZ_TracePrintf("AtomSampleViewer", "Initializing pipeline for %s\n", pipelineName.c_str()); - AZ::Name viewName = AZ::Name(AZStd::string::format("RTT_Camera_%d", renderIndex).c_str()); - rttc.m_view = AZ::RPI::View::CreateView(viewName, AZ::RPI::View::UsageCamera); - float aspectRatio = static_cast(width)/static_cast(height); - - AZ::Vector3 camPos = AZ::Matrix4x4::CreateRotationZ(AZ::DegToRad(19.0f * static_cast(renderIndex))) * Vector3(-2.15f, -5.25f, 1.6f); - AZ::Matrix3x4 cameraLookat = Matrix3x4::CreateLookAt(camPos, Vector3(0.f, 0.f, 0.f)); - rttc.m_view->SetCameraTransform(cameraLookat); - - AZ::Matrix4x4 viewToClipMatrix; - AZ::MakePerspectiveFovMatrixRH(viewToClipMatrix, AZ::DegToRad(90.0f), aspectRatio, 0.1f, 100.0f, true); - rttc.m_view->SetViewToClipMatrix(viewToClipMatrix); - - AZ::RPI::RenderPipelineDescriptor pipelineDesc; - pipelineDesc.m_mainViewTagName = "MainCamera"; - pipelineDesc.m_name = pipelineName; - pipelineDesc.m_rootPassTemplate = "MainPipelineRenderToTexture"; - pipelineDesc.m_renderSettings.m_multisampleState.m_samples = 4; - rttc.m_pipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); - rttc.m_pipeline->RemoveFromRenderTick(); - - if (auto renderToTexturePass = azrtti_cast(rttc.m_pipeline->GetRootPass().get())) - { - renderToTexturePass->ResizeOutput(width, height); - } - - auto pass = rttc.m_pipeline->FindFirstPass(AZ::Name("SlowClearPass")); - if (auto slowClearPass = azrtti_cast(pass)) - { - slowClearPass->SetClearValue( - static_cast(renderIndex==0), - static_cast(renderIndex==1), - static_cast(renderIndex==2), - 1 - ); - } - - m_scene->AddRenderPipeline(rttc.m_pipeline); - - rttc.m_passHierarchy.push_back(pipelineName); - rttc.m_passHierarchy.push_back("CopyToSwapChain"); - - rttc.m_pipeline->SetDefaultView(rttc.m_view); - rttc.m_targetView = m_scene->GetDefaultRenderPipeline()->GetDefaultView(); - if (auto* fp = m_scene->GetFeatureProcessor()) - { - fp->SetViewAlias(rttc.m_view, rttc.m_targetView); - } - - m_renderToTextureContexts.push_back(rttc); - } - - void MultiRenderToTextureExampleComponent::DestroyRenderToTextureCamera(uint32_t index) - { - RenderToTextureContext& rttc = m_renderToTextureContexts[index]; - if (auto* fp = m_scene->GetFeatureProcessor()) - { - fp->RemoveViewAlias(rttc.m_view); - } - m_scene->RemoveRenderPipeline(rttc.m_pipeline->GetId()); - rttc.m_passHierarchy.clear(); - rttc.m_pipeline.reset(); - rttc.m_view.reset(); - rttc.m_targetView.reset(); -} - - - void MultiRenderToTextureExampleComponent::CleanUpScene() - { - RemoveIBL(); - DisableSkybox(); - RemoveDiskLight(); - RemoveDirectionalLight(); - DisableDepthOfField(); - - for (uint32_t index = 0; index < m_renderToTextureContexts.size(); ++index) - { - DestroyRenderToTextureCamera(index); - } - - GetMeshFeatureProcessor()->ReleaseMesh(m_floorMeshHandle); - for (auto index = 0; index < BunnyCount; index++) - { - GetMeshFeatureProcessor()->ReleaseMesh(m_bunnyMeshHandles[index]); - } - } - - void MultiRenderToTextureExampleComponent::Deactivate() - { - m_imguiSidebar.Deactivate(); - AZ::TickBus::Handler::BusDisconnect(); - - CleanUpScene(); - - m_directionalLightFeatureProcessor = nullptr; - m_diskLightFeatureProcessor = nullptr; - m_skyboxFeatureProcessor = nullptr; - m_scene = nullptr; - } - - void MultiRenderToTextureExampleComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint timePoint) - { - if (m_hasDirectionalLight) - { - auto& featureProcessor = m_directionalLightFeatureProcessor; - Transform cameraTransform = Transform::CreateIdentity(); - TransformBus::EventResult( - cameraTransform, - GetCameraEntityId(), - &TransformBus::Events::GetWorldTM); - featureProcessor->SetCameraTransform( - m_directionalLightHandle, - cameraTransform); - } - - if (m_imguiSidebar.Begin()) - { - ImGui::Spacing(); - - ImGui::Text("Second RenderPipeline"); - - m_imguiSidebar.End(); - } - - for (uint32_t index = 0; index < m_renderToTextureContexts.size(); ++index) - { - RenderToTextureContext& rttc = m_renderToTextureContexts[index]; - rttc.m_pipeline->AddToRenderTickOnce(); - AZStd::string outputImageName = AZStd::string::format("MultiRenderToTextureImage_cam%d_image%d.png", index, rttc.m_imageCount++); - AZ::Render::FrameCaptureRequestBus::Broadcast( - &AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachment, - rttc.m_passHierarchy, - AZStd::string("Output"), - outputImageName, - AZ::RPI::PassAttachmentReadbackOption::Output); - - } - } - - -} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/MultiRenderToTextureExampleComponent.h b/Gem/Code/Source/MultiRenderToTextureExampleComponent.h deleted file mode 100644 index 9137f1c8..00000000 --- a/Gem/Code/Source/MultiRenderToTextureExampleComponent.h +++ /dev/null @@ -1,140 +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 - * - */ - -#pragma once - -#include - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -struct ImGuiContext; - -namespace AtomSampleViewer -{ - //! A sample component which render the same scene with different render pipelines in different windows - //! It has a imgui menu to switch on/off the second render pipeline as well as turn on/off different graphics features - //! There is also an option to have the second render pipeline to use the second camera. - class MultiRenderToTextureExampleComponent final - : public CommonSampleComponentBase - , public AZ::TickBus::Handler - { - public: - AZ_COMPONENT(MultiRenderToTextureExampleComponent, "{C9602E16-8D75-481D-B430-6C0622AD1E6D}", CommonSampleComponentBase); - - static void Reflect(AZ::ReflectContext* context); - - MultiRenderToTextureExampleComponent(); - ~MultiRenderToTextureExampleComponent() final = default; - - // AZ::Component - void Activate() override; - void Deactivate() override; - - private: - // AZ::TickBus::Handler overrides ... - void OnTick(float deltaTime, AZ::ScriptTimePoint timePoint) override; - - // CommonSampleComponentBase overrides... - void OnAllAssetsReadyActivate() override; - - // Add render content to the scene - void SetupScene(); - // Clean up render content in the scene - void CleanUpScene(); - - // enable/disable different features for the second render pipeline - void EnableDepthOfField(); - void DisableDepthOfField(); - - void AddDirectionalLight(); - void RemoveDirectionalLight(); - - void AddDiskLight(); - void RemoveDiskLight(); - - void EnableSkybox(); - void DisableSkybox(); - - void AddIBL(); - void RemoveIBL(); - - void AddRenderToTextureCamera(); - void DestroyRenderToTextureCamera(uint32_t index); - - // For draw menus of selecting pipelines - ImGuiSidebar m_imguiSidebar; - - // For scene content - using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle; - using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle; - using MeshHandle = AZ::Render::MeshFeatureProcessorInterface::MeshHandle; - - // Directional light - AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr; - DirectionalLightHandle m_directionalLightHandle; - // Disk light - AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr; - DiskLightHandle m_diskLightHandle; - // Meshes - MeshHandle m_floorMeshHandle; - - static const uint32_t BunnyCount = 5; - MeshHandle m_bunnyMeshHandles[BunnyCount]; - // Skybox - AZ::Render::SkyBoxFeatureProcessorInterface* m_skyboxFeatureProcessor = nullptr; - // IBL - Utils::DefaultIBL m_ibl; - // Post Process - AZ::Render::PostProcessFeatureProcessorInterface* m_postProcessFeatureProcessor = nullptr; - AZ::Entity* m_depthOfFieldEntity = nullptr; - - // flags of features enabled - bool m_enabledDepthOfField = true; - bool m_hasDirectionalLight = true; - bool m_hasDiskLight = true; - bool m_enabledSkybox = true; - bool m_hasIBL = true; - bool m_enableSecondRenderPipeline = true; - bool m_useSecondCamera = false; - - // for directional light - int m_shadowFilteringMethod = aznumeric_cast(AZ::Render::ShadowFilterMethod::EsmPcf); - - // For second render pipeline - AZStd::shared_ptr m_secondWindow; - AZStd::shared_ptr m_secondWindowContext; - - struct RenderToTextureContext - { - AZStd::vector m_passHierarchy; - AZ::RPI::RenderPipelinePtr m_pipeline; - AZ::RPI::ViewPtr m_view; - AZ::RPI::ViewPtr m_targetView; - - uint32_t m_imageCount = 0; - }; - AZStd::vector m_renderToTextureContexts; - }; - -} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 25cd71f7..e5748e6b 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -88,7 +88,6 @@ #include #include #include -#include #include #include #include @@ -289,7 +288,6 @@ namespace AtomSampleViewer NewRPISample("Mesh"), NewRPISample("MSAA"), NewRPISample("MultiRenderPipeline"), - NewRPISample("MultiRenderToTexture"), NewRPISample("MultiScene"), NewRPISample("MultiViewSingleSceneAuxGeom"), NewRPISample("Readback"), diff --git a/Gem/Code/atomsampleviewergem_private_files.cmake b/Gem/Code/atomsampleviewergem_private_files.cmake index 049fef1f..f8be2522 100644 --- a/Gem/Code/atomsampleviewergem_private_files.cmake +++ b/Gem/Code/atomsampleviewergem_private_files.cmake @@ -139,8 +139,6 @@ set(FILES Source/MSAA_RPI_ExampleComponent.h Source/MultiRenderPipelineExampleComponent.cpp Source/MultiRenderPipelineExampleComponent.h - Source/MultiRenderToTextureExampleComponent.cpp - Source/MultiRenderToTextureExampleComponent.h Source/MultiSceneExampleComponent.cpp Source/MultiSceneExampleComponent.h Source/MultiViewSingleSceneAuxGeomExampleComponent.cpp From 99d9fd9227faa3d408bda91bccced4af964a3281 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 29 Jun 2022 15:39:25 -0500 Subject: [PATCH 52/81] Cleanup code commented out for debug Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index e8f0efe6..0271b624 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -320,18 +320,16 @@ namespace AtomSampleViewer if (m_scriptPaused) { - // Remove while debugging script screencaps - - //m_scriptPauseTimeout -= deltaTime; - //if (m_scriptPauseTimeout < 0) - //{ - // AZ_Error("Automation", false, "Script pause timed out. Continuing..."); - // m_scriptPaused = false; - //} - //else - //{ + m_scriptPauseTimeout -= deltaTime; + if (m_scriptPauseTimeout < 0) + { + AZ_Error("Automation", false, "Script pause timed out. Continuing..."); + m_scriptPaused = false; + } + else + { break; - //} + } } if (m_waitForAssetTracker) From f2c593ee96300d52ac3112c4ee75405f283b968d Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:26:03 -0700 Subject: [PATCH 53/81] Removing SwapChainOutput uses in favor of more generic PipelineOutput Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Passes/CheckerboardPipeline.pass | 16 +++++------ Passes/ComplexPipeline.pass | 8 +++--- Passes/Fullscreen.pass | 4 +-- Passes/FullscreenPipeline.pass | 4 +-- Passes/ImGuiOnlyPipeline.pass | 8 +++--- Passes/RHISamplePass.pass | 2 +- Passes/RHISamplePipeline.pass | 8 +++--- Passes/RayTracingAmbientOcclusion.pass | 4 +-- Passes/ReadbackPipeline.pass | 8 +++--- Passes/SsaoPipeline.pass | 38 +++++++++++++------------- 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Passes/CheckerboardPipeline.pass b/Passes/CheckerboardPipeline.pass index 4a685731..55ae1387 100644 --- a/Passes/CheckerboardPipeline.pass +++ b/Passes/CheckerboardPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -733,10 +733,10 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] @@ -754,10 +754,10 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] @@ -873,7 +873,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] diff --git a/Passes/ComplexPipeline.pass b/Passes/ComplexPipeline.pass index 4e6964ec..6fc3da6a 100644 --- a/Passes/ComplexPipeline.pass +++ b/Passes/ComplexPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -302,7 +302,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] diff --git a/Passes/Fullscreen.pass b/Passes/Fullscreen.pass index 7f5a11d3..99805a23 100644 --- a/Passes/Fullscreen.pass +++ b/Passes/Fullscreen.pass @@ -30,12 +30,12 @@ "SizeSource": { "Source": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } }, "FormatSource": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], diff --git a/Passes/FullscreenPipeline.pass b/Passes/FullscreenPipeline.pass index 6027b440..1ca9843e 100644 --- a/Passes/FullscreenPipeline.pass +++ b/Passes/FullscreenPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput", "ScopeAttachmentUsage": "RenderTarget" } @@ -59,7 +59,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] diff --git a/Passes/ImGuiOnlyPipeline.pass b/Passes/ImGuiOnlyPipeline.pass index fdabca7c..07aa9f46 100644 --- a/Passes/ImGuiOnlyPipeline.pass +++ b/Passes/ImGuiOnlyPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -30,7 +30,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], diff --git a/Passes/RHISamplePass.pass b/Passes/RHISamplePass.pass index e9045146..d65ad135 100644 --- a/Passes/RHISamplePass.pass +++ b/Passes/RHISamplePass.pass @@ -30,7 +30,7 @@ "SizeSource": { "Source": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } }, "ImageDescriptor": { diff --git a/Passes/RHISamplePipeline.pass b/Passes/RHISamplePipeline.pass index 3cb5e3b3..ea64a71a 100644 --- a/Passes/RHISamplePipeline.pass +++ b/Passes/RHISamplePipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -60,7 +60,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] diff --git a/Passes/RayTracingAmbientOcclusion.pass b/Passes/RayTracingAmbientOcclusion.pass index bac7ff5f..a3eff68c 100644 --- a/Passes/RayTracingAmbientOcclusion.pass +++ b/Passes/RayTracingAmbientOcclusion.pass @@ -49,12 +49,12 @@ "SizeSource": { "Source": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } }, "FormatSource": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], diff --git a/Passes/ReadbackPipeline.pass b/Passes/ReadbackPipeline.pass index bef2abbf..72222b69 100644 --- a/Passes/ReadbackPipeline.pass +++ b/Passes/ReadbackPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -31,7 +31,7 @@ "LocalSlot": "InputOutput", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], diff --git a/Passes/SsaoPipeline.pass b/Passes/SsaoPipeline.pass index 3e058bca..cc1796af 100644 --- a/Passes/SsaoPipeline.pass +++ b/Passes/SsaoPipeline.pass @@ -8,7 +8,7 @@ "PassClass": "ParentPass", "Slots": [ { - "Name": "SwapChainOutput", + "Name": "PipelineOutput", "SlotType": "InputOutput" } ], @@ -16,8 +16,8 @@ "$type": "PassData", "PipelineGlobalConnections": [ { - "GlobalName": "SwapChainOutput", - "Slot": "SwapChainOutput" + "GlobalName": "PipelineOutput", + "Slot": "PipelineOutput" } ] }, @@ -55,10 +55,10 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "PipelineGlobal", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] @@ -82,16 +82,16 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] }, { - "Name": "ShadowPass", + "Name": "Shadows", "TemplateName": "ShadowParentTemplate", "Connections": [ { @@ -102,10 +102,10 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "PipelineGlobal", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } }, { @@ -125,28 +125,28 @@ { "LocalSlot": "DirectionalLightShadowmap", "AttachmentRef": { - "Pass": "ShadowPass", + "Pass": "Shadows", "Attachment": "DirectionalShadowmap" } }, { "LocalSlot": "ExponentialShadowmapDirectional", "AttachmentRef": { - "Pass": "ShadowPass", + "Pass": "Shadows", "Attachment": "DirectionalESM" } }, { "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { - "Pass": "ShadowPass", + "Pass": "Shadows", "Attachment": "ProjectedShadowmap" } }, { "LocalSlot": "ExponentialShadowmapProjected", "AttachmentRef": { - "Pass": "ShadowPass", + "Pass": "Shadows", "Attachment": "ProjectedESM" } }, @@ -211,12 +211,12 @@ "SizeSource": { "Source": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } }, "FormatSource": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], @@ -291,10 +291,10 @@ } }, { - "LocalSlot": "SwapChainOutput", + "LocalSlot": "PipelineOutput", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ], @@ -366,7 +366,7 @@ "LocalSlot": "Output", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SwapChainOutput" + "Attachment": "PipelineOutput" } } ] From 73f2bb938de9fee199e7810968848369d6dc9008 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:35:26 -0700 Subject: [PATCH 54/81] SwapChainOutput -> PipelineOutput Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Gem/Code/Source/ReadbackExampleComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/ReadbackExampleComponent.cpp b/Gem/Code/Source/ReadbackExampleComponent.cpp index af0a4eac..93d5b6f2 100644 --- a/Gem/Code/Source/ReadbackExampleComponent.cpp +++ b/Gem/Code/Source/ReadbackExampleComponent.cpp @@ -219,7 +219,7 @@ namespace AtomSampleViewer createPassRequest.m_passData = AZStd::move(passData); // Create the connection for the output slot - AZ::RPI::PassConnection outputConnection = { AZ::Name("Output"), {AZ::Name("Parent"), AZ::Name("SwapChainOutput")} }; + AZ::RPI::PassConnection outputConnection = { AZ::Name("Output"), {AZ::Name("Parent"), AZ::Name("PipelineOutput")} }; createPassRequest.m_connections.push_back(outputConnection); AZ::RPI::PassConnection inputConnection = { AZ::Name("Input"), {AZ::Name("This"), AZ::Name(s_previewImageName)} }; createPassRequest.m_connections.push_back(inputConnection); From ae1c4fd7991bfc826c536a7af0f6c0eaa285de61 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Thu, 30 Jun 2022 23:19:34 -0700 Subject: [PATCH 55/81] Updated samples to use the submit range from the FrameGraphExecuteContext. Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../RHI/AlphaToCoverageExampleComponent.cpp | 2 +- .../RHI/AsyncComputeExampleComponent.cpp | 140 ++++++++++-------- .../RHI/BindlessPrototypeExampleComponent.cpp | 8 +- .../RHI/IndirectRenderingExampleComponent.cpp | 1 - .../RHI/InputAssemblyExampleComponent.cpp | 33 +++-- Gem/Code/Source/RHI/MultiThreadComponent.cpp | 11 +- Gem/Code/Source/RHI/QueryExampleComponent.cpp | 2 + .../Source/RHI/StencilExampleComponent.cpp | 40 +++-- .../Source/RHI/SubpassExampleComponent.cpp | 33 +++-- Gem/Code/Source/RHI/SubpassExampleComponent.h | 1 + 10 files changed, 148 insertions(+), 123 deletions(-) diff --git a/Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp b/Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp index b816d4a2..18c8bc5f 100644 --- a/Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp +++ b/Gem/Code/Source/RHI/AlphaToCoverageExampleComponent.cpp @@ -386,7 +386,7 @@ namespace AtomSampleViewer drawIndexed.m_indexCount = 6; drawIndexed.m_instanceCount = 1; - for (uint32_t rectIndex = 0; rectIndex < s_numRectangles; ++rectIndex) + for (uint32_t rectIndex = context.GetSubmitRange().m_startIndex; rectIndex < context.GetSubmitRange().m_endIndex; ++rectIndex) { const RHI::ShaderResourceGroup* shaderResourceGroups[] = {m_shaderResourceGroups[typeIndex][rectIndex]->GetRHIShaderResourceGroup()}; diff --git a/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp b/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp index 86793d3b..e00186e4 100644 --- a/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp +++ b/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp @@ -867,42 +867,47 @@ namespace AtomSampleViewer commandList->SetViewports(&viewport, 1); commandList->SetScissors(&scissor, 1); + for(uint32_t i = context.GetSubmitRange().m_startIndex; i < context.GetSubmitRange().m_endIndex; ++i) { - // Terrain - RHI::DrawIndexed drawIndexed; - drawIndexed.m_indexCount = 6; - drawIndexed.m_instanceCount = 1; + if (i == 0) + { + // Terrain + RHI::DrawIndexed drawIndexed; + drawIndexed.m_indexCount = 6; + drawIndexed.m_instanceCount = 1; - const RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[ShadowScope][0]->GetRHIShaderResourceGroup() }; + const RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[ShadowScope][0]->GetRHIShaderResourceGroup() }; - RHI::DrawItem drawItem; - drawItem.m_arguments = drawIndexed; - drawItem.m_pipelineState = m_terrainPipelineStates[ShadowScope].get(); - drawItem.m_indexBufferView = &m_quadIndexBufferView; - drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); - drawItem.m_shaderResourceGroups = shaderResourceGroups; - drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ShadowScope].size()); - drawItem.m_streamBufferViews = m_quadStreamBufferViews[ShadowScope].data(); - commandList->Submit(drawItem); - } - - for(size_t i = 1; i < m_shaderResourceGroups[ShadowScope].size(); ++i) - { - // Models - const RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[ShadowScope][i]->GetRHIShaderResourceGroup() }; - for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) - { RHI::DrawItem drawItem; - drawItem.m_arguments = mesh.m_drawArguments; - drawItem.m_pipelineState = m_modelPipelineStates[ShadowScope].get(); - drawItem.m_indexBufferView = &mesh.m_indexBufferView; + drawItem.m_submitIndex = i; + drawItem.m_arguments = drawIndexed; + drawItem.m_pipelineState = m_terrainPipelineStates[ShadowScope].get(); + drawItem.m_indexBufferView = &m_quadIndexBufferView; drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); drawItem.m_shaderResourceGroups = shaderResourceGroups; - drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ShadowScope].size()); - drawItem.m_streamBufferViews = m_modelStreamBufferViews[ShadowScope].data(); - + drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ShadowScope].size()); + drawItem.m_streamBufferViews = m_quadStreamBufferViews[ShadowScope].data(); commandList->Submit(drawItem); } + else + { + // Models + const RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[ShadowScope][i]->GetRHIShaderResourceGroup() }; + for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) + { + RHI::DrawItem drawItem; + drawItem.m_submitIndex = i; + drawItem.m_arguments = mesh.m_drawArguments; + drawItem.m_pipelineState = m_modelPipelineStates[ShadowScope].get(); + drawItem.m_indexBufferView = &mesh.m_indexBufferView; + drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); + drawItem.m_shaderResourceGroups = shaderResourceGroups; + drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ShadowScope].size()); + drawItem.m_streamBufferViews = m_modelStreamBufferViews[ShadowScope].data(); + + commandList->Submit(drawItem); + } + } } }; @@ -978,52 +983,57 @@ namespace AtomSampleViewer commandList->SetViewports(&viewport, 1); commandList->SetScissors(&scissor, 1); + for (uint32_t i = context.GetSubmitRange().m_startIndex; i < context.GetSubmitRange().m_endIndex; ++i) { - // Terrain - const RHI::ShaderResourceGroup* shaderResourceGroups[] = + if (i == 0) { - m_shaderResourceGroups[ForwardScope][0]->GetRHIShaderResourceGroup(), - m_viewShaderResourceGroup->GetRHIShaderResourceGroup() - }; - - RHI::DrawIndexed drawIndexed; - drawIndexed.m_indexCount = 6; - drawIndexed.m_instanceCount = 1; + // Terrain + const RHI::ShaderResourceGroup* shaderResourceGroups[] = + { + m_shaderResourceGroups[ForwardScope][0]->GetRHIShaderResourceGroup(), + m_viewShaderResourceGroup->GetRHIShaderResourceGroup() + }; - RHI::DrawItem drawItem; - drawItem.m_arguments = drawIndexed; - drawItem.m_pipelineState = m_terrainPipelineStates[ForwardScope].get(); - drawItem.m_indexBufferView = &m_quadIndexBufferView; - drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); - drawItem.m_shaderResourceGroups = shaderResourceGroups; - drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ForwardScope].size()); - drawItem.m_streamBufferViews = m_quadStreamBufferViews[ForwardScope].data(); + RHI::DrawIndexed drawIndexed; + drawIndexed.m_indexCount = 6; + drawIndexed.m_instanceCount = 1; - commandList->Submit(drawItem); - } - - for (size_t i = 1; i < m_shaderResourceGroups[ShadowScope].size(); ++i) - { - // Model - const RHI::ShaderResourceGroup* shaderResourceGroups[] = - { - m_shaderResourceGroups[ForwardScope][i]->GetRHIShaderResourceGroup(), - m_viewShaderResourceGroup->GetRHIShaderResourceGroup() - }; - - for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) - { RHI::DrawItem drawItem; - drawItem.m_arguments = mesh.m_drawArguments; - drawItem.m_pipelineState = m_modelPipelineStates[ForwardScope].get(); - drawItem.m_indexBufferView = &mesh.m_indexBufferView; + drawItem.m_submitIndex = i; + drawItem.m_arguments = drawIndexed; + drawItem.m_pipelineState = m_terrainPipelineStates[ForwardScope].get(); + drawItem.m_indexBufferView = &m_quadIndexBufferView; drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); drawItem.m_shaderResourceGroups = shaderResourceGroups; - drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ForwardScope].size()); - drawItem.m_streamBufferViews = m_modelStreamBufferViews[ForwardScope].data(); + drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ForwardScope].size()); + drawItem.m_streamBufferViews = m_quadStreamBufferViews[ForwardScope].data(); commandList->Submit(drawItem); - } + } + else + { + // Model + const RHI::ShaderResourceGroup* shaderResourceGroups[] = + { + m_shaderResourceGroups[ForwardScope][i]->GetRHIShaderResourceGroup(), + m_viewShaderResourceGroup->GetRHIShaderResourceGroup() + }; + + for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) + { + RHI::DrawItem drawItem; + drawItem.m_submitIndex = i; + drawItem.m_arguments = mesh.m_drawArguments; + drawItem.m_pipelineState = m_modelPipelineStates[ForwardScope].get(); + drawItem.m_indexBufferView = &mesh.m_indexBufferView; + drawItem.m_shaderResourceGroupCount = static_cast(RHI::ArraySize(shaderResourceGroups)); + drawItem.m_shaderResourceGroups = shaderResourceGroups; + drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ForwardScope].size()); + drawItem.m_streamBufferViews = m_modelStreamBufferViews[ForwardScope].data(); + + commandList->Submit(drawItem); + } + } } }; diff --git a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp index 39f6e7dc..0f76e55c 100644 --- a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp +++ b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp @@ -558,13 +558,8 @@ namespace AtomSampleViewer commandList->SetViewports(&m_viewport, 1u); commandList->SetScissors(&m_scissor, 1u); - // Split the drawcommands depending on the CommandList index. - const uint32_t drawInstancePerContext = (static_cast(m_subMeshInstanceArray.size()) + 1) / context.GetCommandListCount(); - const uint32_t drawInstanceStart = context.GetCommandListIndex() * drawInstancePerContext; - const uint32_t drawInstanceCount = AZStd::min(drawInstanceStart + drawInstancePerContext, static_cast(m_subMeshInstanceArray.size())); - // Submit the drawcommands to the CommandList. - for (uint32_t instanceIdx = drawInstanceStart; instanceIdx < drawInstanceCount; instanceIdx++) + for (uint32_t instanceIdx = context.GetSubmitRange().m_startIndex; instanceIdx < context.GetSubmitRange().m_endIndex; instanceIdx++) { const SubMeshInstance& subMesh = m_subMeshInstanceArray[instanceIdx]; @@ -574,6 +569,7 @@ namespace AtomSampleViewer m_bindlessSrg->GetSrg(m_floatBufferSrgName)->GetRHIShaderResourceGroup(), }; RHI::DrawItem drawItem; + drawItem.m_submitIndex = instanceIdx; drawItem.m_arguments = subMesh.m_mesh->m_drawArguments; drawItem.m_pipelineState = m_pipelineState.get(); drawItem.m_indexBufferView = &subMesh.m_mesh->m_indexBufferView; diff --git a/Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp b/Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp index f7ed1780..6df70ffe 100644 --- a/Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp +++ b/Gem/Code/Source/RHI/IndirectRenderingExampleComponent.cpp @@ -820,7 +820,6 @@ namespace AtomSampleViewer const auto executeFunction = [this, maxIndirectDrawCount](const RHI::FrameGraphExecuteContext& context, [[maybe_unused]] const ScopeData& scopeData) { - RHI::CommandList* commandList = context.GetCommandList(); // Set persistent viewport and scissor state. diff --git a/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp b/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp index 2a9b6b3f..c21daac9 100644 --- a/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp +++ b/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp @@ -259,7 +259,7 @@ namespace AtomSampleViewer frameGraph.UseShaderAttachment(attachmentDescriptor, RHI::ScopeAttachmentAccess::ReadWrite); } - frameGraph.SetEstimatedItemCount(1); + frameGraph.SetEstimatedItemCount(2); }; const auto compileFunction = [this](const RHI::FrameGraphCompileContext& context, const ScopeData& scopeData) @@ -298,11 +298,13 @@ namespace AtomSampleViewer dispatchItem.m_arguments = dispatchArgs; dispatchItem.m_pipelineState = m_dispatchPipelineState.get(); dispatchItem.m_shaderResourceGroupCount = 1; - dispatchItem.m_shaderResourceGroups[0] = m_dispatchSRG[0]->GetRHIShaderResourceGroup(); - commandList->Submit(dispatchItem); - dispatchItem.m_shaderResourceGroups[0] = m_dispatchSRG[1]->GetRHIShaderResourceGroup(); - commandList->Submit(dispatchItem); + for (uint32_t index = context.GetSubmitRange().m_startIndex; index < context.GetSubmitRange().m_endIndex; ++index) + { + dispatchItem.m_submitIndex = index; + dispatchItem.m_shaderResourceGroups[0] = m_dispatchSRG[index]->GetRHIShaderResourceGroup(); + commandList->Submit(dispatchItem); + } }; m_scopeProducers.emplace_back( @@ -358,7 +360,7 @@ namespace AtomSampleViewer } // We will submit a single draw item. - frameGraph.SetEstimatedItemCount(1); + frameGraph.SetEstimatedItemCount(2); }; const auto compileFunction = [this](const RHI::FrameGraphCompileContext& context, const ScopeData& scopeData) @@ -397,24 +399,23 @@ namespace AtomSampleViewer RHI::DrawLinear drawLinear; drawLinear.m_vertexCount = BufferData::array_size; - RHI::ShaderResourceGroup* rhiSRGS[] = { m_drawSRG[0]->GetRHIShaderResourceGroup() }; - RHI::DrawItem drawItem; drawItem.m_arguments = drawLinear; drawItem.m_pipelineState = m_drawPipelineState.get(); drawItem.m_indexBufferView = nullptr; drawItem.m_streamBufferViewCount = 1; - drawItem.m_streamBufferViews = &m_streamBufferView[0]; drawItem.m_shaderResourceGroupCount = 1; - drawItem.m_shaderResourceGroups = rhiSRGS; - // Submit the draw item. - commandList->Submit(drawItem); + for (uint32_t index = context.GetSubmitRange().m_startIndex; index < context.GetSubmitRange().m_endIndex; ++index) + { + drawItem.m_submitIndex = index; + drawItem.m_streamBufferViews = &m_streamBufferView[index]; + + RHI::ShaderResourceGroup* rhiSRGS[] = { m_drawSRG[index]->GetRHIShaderResourceGroup() }; + drawItem.m_shaderResourceGroups = rhiSRGS; - rhiSRGS[0] = { m_drawSRG[1]->GetRHIShaderResourceGroup() }; - drawItem.m_streamBufferViews = &m_streamBufferView[1]; - drawItem.m_shaderResourceGroups = rhiSRGS; - commandList->Submit(drawItem); + commandList->Submit(drawItem); + } }; m_scopeProducers.emplace_back( diff --git a/Gem/Code/Source/RHI/MultiThreadComponent.cpp b/Gem/Code/Source/RHI/MultiThreadComponent.cpp index 1170dd8d..1f041500 100644 --- a/Gem/Code/Source/RHI/MultiThreadComponent.cpp +++ b/Gem/Code/Source/RHI/MultiThreadComponent.cpp @@ -316,27 +316,20 @@ namespace AtomSampleViewer drawIndexed.m_indexCount = s_geometryIndexCount; drawIndexed.m_instanceCount = 1; - // Dividing s_numberOfCubes by context.GetCommandListCount() to balance to number - // of draw call equally between each thread. - uint32_t numberOfCubesPerCommandList = s_numberOfCubes / context.GetCommandListCount(); - uint32_t indexStart = context.GetCommandListIndex() * numberOfCubesPerCommandList; - uint32_t indexEnd = indexStart + numberOfCubesPerCommandList; - if (context.GetCommandListIndex() == context.GetCommandListCount() - 1) { - indexEnd = s_numberOfCubes; - #if defined(AZ_DEBUG_BUILD) AZ_Printf("MultiThread", "Draw Calls: %d \n", s_numberOfCubes); AZ_Printf("MultiThread", "Num CommandLists: %d \n", context.GetCommandListCount()); #endif } - for (uint32_t i = indexStart; i < indexEnd; ++i) + for (uint32_t i = context.GetSubmitRange().m_startIndex; i < context.GetSubmitRange().m_endIndex; ++i) { const AZ::RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[i]->GetRHIShaderResourceGroup() }; AZ::RHI::DrawItem drawItem; + drawItem.m_submitIndex = i; drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_pipelineState.get(); drawItem.m_indexBufferView = &m_indexBufferView; diff --git a/Gem/Code/Source/RHI/QueryExampleComponent.cpp b/Gem/Code/Source/RHI/QueryExampleComponent.cpp index b06bf883..2df0d5bd 100644 --- a/Gem/Code/Source/RHI/QueryExampleComponent.cpp +++ b/Gem/Code/Source/RHI/QueryExampleComponent.cpp @@ -505,10 +505,12 @@ namespace AtomSampleViewer } // Draw occluding quad + drawItem.m_submitIndex++; shaderResourceGroups[0] = m_shaderResourceGroups[1]->GetRHIShaderResourceGroup(); commandList->Submit(drawItem); // Draw quad to use for the oclussion query + drawItem.m_submitIndex++; drawItem.m_pipelineState = m_boudingBoxPipelineState.get(); shaderResourceGroups[0] = m_shaderResourceGroups[2]->GetRHIShaderResourceGroup(); auto& queryEntry = m_occlusionQueries[m_currentOcclusionQueryIndex]; diff --git a/Gem/Code/Source/RHI/StencilExampleComponent.cpp b/Gem/Code/Source/RHI/StencilExampleComponent.cpp index 5aa8e551..9ed4224f 100644 --- a/Gem/Code/Source/RHI/StencilExampleComponent.cpp +++ b/Gem/Code/Source/RHI/StencilExampleComponent.cpp @@ -212,29 +212,39 @@ namespace AtomSampleViewer }; RHI::DrawIndexed drawIndexed; - drawIndexed.m_indexCount = s_numberOfVertices / 2; drawIndexed.m_instanceCount = 1; - // Draw color triangles RHI::DrawItem drawItem; - drawItem.m_arguments = drawIndexed; - drawItem.m_pipelineState = m_pipelineStateBasePass.get(); drawItem.m_indexBufferView = &indexBufferView; drawItem.m_streamBufferViewCount = static_cast(m_streamBufferViews.size()); drawItem.m_streamBufferViews = m_streamBufferViews.data(); - commandList->Submit(drawItem); - // Draw white triangles - drawIndexed.m_indexOffset = s_numberOfVertices / 2; - drawIndexed.m_indexCount = 3; - drawItem.m_stencilRef = 1; - for (int i = 0; i < m_pipelineStateStencil.size(); ++i) + for (uint32_t i = context.GetSubmitRange().m_startIndex; i < context.GetSubmitRange().m_endIndex; ++i) { - drawItem.m_arguments = drawIndexed; - drawItem.m_pipelineState = m_pipelineStateStencil[i].get(); - commandList->Submit(drawItem); - - drawIndexed.m_indexOffset += 3; + drawItem.m_submitIndex = i; + + if (i == 0) + { + drawIndexed.m_indexCount = s_numberOfVertices / 2; + + // Draw color triangles + drawItem.m_arguments = drawIndexed; + drawItem.m_pipelineState = m_pipelineStateBasePass.get(); + commandList->Submit(drawItem); + } + else + { + // Draw white triangles + drawIndexed.m_indexOffset = s_numberOfVertices / 2; + drawIndexed.m_indexCount = 3; + drawItem.m_stencilRef = 1; + + drawItem.m_arguments = drawIndexed; + drawItem.m_pipelineState = m_pipelineStateStencil[i-1].get(); + commandList->Submit(drawItem); + + drawIndexed.m_indexOffset += 3; + } } }; diff --git a/Gem/Code/Source/RHI/SubpassExampleComponent.cpp b/Gem/Code/Source/RHI/SubpassExampleComponent.cpp index 19aa6ed5..0078daac 100644 --- a/Gem/Code/Source/RHI/SubpassExampleComponent.cpp +++ b/Gem/Code/Source/RHI/SubpassExampleComponent.cpp @@ -186,16 +186,29 @@ namespace AtomSampleViewer ModelType_Suzanne, }; - auto setModelType = [](AZStd::span types, AZStd::vector& modelDataList) - { - modelDataList.resize(types.size()); - for (uint32_t i = 0; i < modelDataList.size(); ++i) - { - modelDataList[i].m_modelType = types[i]; - } - }; + //auto setModelType = [](AZStd::span types, AZStd::vector& modelDataList) + //{ + // modelDataList.resize(types.size()); + // + // uint32_t meshCount = 0; + // for (uint32_t i = 0; i < modelDataList.size(); ++i) + // { + // modelDataList[i].m_modelType = types[i]; + // meshCount += m_models[modelDataList[i].m_modelType]->GetLods()[0]->GetMeshes().size(); + // } + //}; + // + //setModelType(AZStd::span(&opaqueModels[0], AZ_ARRAY_SIZE(opaqueModels)), m_opaqueModelsData); + + + AZStd::span types(&opaqueModels[0], AZ_ARRAY_SIZE(opaqueModels)); + m_opaqueModelsData.resize(types.size()); - setModelType(AZStd::span(&opaqueModels[0], AZ_ARRAY_SIZE(opaqueModels)), m_opaqueModelsData); + for (uint32_t i = 0; i < m_opaqueModelsData.size(); ++i) + { + m_opaqueModelsData[i].m_modelType = types[i]; + m_meshCount += aznumeric_cast(m_models[m_opaqueModelsData[i].m_modelType]->GetLods()[0]->GetMeshes().size()); + } } void SubpassExampleComponent::LoadShaders() @@ -381,7 +394,7 @@ namespace AtomSampleViewer frameGraph.UseDepthStencilAttachment(dsDesc, RHI::ScopeAttachmentAccess::Write); } - frameGraph.SetEstimatedItemCount(static_cast(m_opaqueModelsData.size())); + frameGraph.SetEstimatedItemCount(m_meshCount); }; RHI::EmptyCompileFunction compileFunction; diff --git a/Gem/Code/Source/RHI/SubpassExampleComponent.h b/Gem/Code/Source/RHI/SubpassExampleComponent.h index 34ea3ea8..46ae037b 100644 --- a/Gem/Code/Source/RHI/SubpassExampleComponent.h +++ b/Gem/Code/Source/RHI/SubpassExampleComponent.h @@ -101,6 +101,7 @@ namespace AtomSampleViewer AZStd::array, ModelType_Count> m_models; AZStd::vector m_opaqueModelsData; + uint32_t m_meshCount = 0; AZStd::vector> m_shaders; From e23e86d7d4443228b191ab12deda82247dbaa85b Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Fri, 1 Jul 2022 17:33:23 -0700 Subject: [PATCH 56/81] Removing unused passes Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Passes/ASV/PassTemplates.azasset | 16 - Passes/CheckerboardPipeline.pass | 22 +- Passes/ColorInvertCS.pass | 65 ---- Passes/ColorblindnessSimulation.pass | 62 ---- Passes/ComplexPipeline.pass | 313 ------------------ Passes/Monochrome.pass | 75 ----- Passes/SsaoPipeline.pass | 10 +- .../ColorblindnessSimulation.azsl | 75 ----- .../ColorblindnessSimulation.shader | 22 -- Shaders/PostProcessing/Monochrome.azsl | 46 --- Shaders/PostProcessing/Monochrome.shader | 22 -- atomsampleviewer_asset_files.cmake | 8 - 12 files changed, 16 insertions(+), 720 deletions(-) delete mode 100644 Passes/ColorInvertCS.pass delete mode 100644 Passes/ColorblindnessSimulation.pass delete mode 100644 Passes/ComplexPipeline.pass delete mode 100644 Passes/Monochrome.pass delete mode 100644 Shaders/PostProcessing/ColorblindnessSimulation.azsl delete mode 100644 Shaders/PostProcessing/ColorblindnessSimulation.shader delete mode 100644 Shaders/PostProcessing/Monochrome.azsl delete mode 100644 Shaders/PostProcessing/Monochrome.shader diff --git a/Passes/ASV/PassTemplates.azasset b/Passes/ASV/PassTemplates.azasset index e5821b8c..5e862924 100644 --- a/Passes/ASV/PassTemplates.azasset +++ b/Passes/ASV/PassTemplates.azasset @@ -12,14 +12,6 @@ "Name": "ImGuiNoInputPassTemplate", "Path": "Passes/ImGuiNoInput.pass" }, - { - "Name": "ColorBlindPassTemplate", - "Path": "Passes/ColorblindnessSimulation.pass" - }, - { - "Name": "ComplexPipeline", - "Path": "Passes/ComplexPipeline.pass" - }, { "Name": "CheckerboardResolveColorTemplate", "Path": "Passes/CheckerboardResolveColor.pass" @@ -40,14 +32,6 @@ "Name": "CheckerboardPipeline", "Path": "Passes/CheckerboardPipeline.pass" }, - { - "Name": "MonochromeTemplate", - "Path": "Passes/Monochrome.pass" - }, - { - "Name": "ColorInvertCS", - "Path": "Passes/ColorInvertCS.pass" - }, { "Name": "RenderTextureTemplate", "Path": "Passes/RenderTexture.pass" diff --git a/Passes/CheckerboardPipeline.pass b/Passes/CheckerboardPipeline.pass index 55ae1387..2ff2406a 100644 --- a/Passes/CheckerboardPipeline.pass +++ b/Passes/CheckerboardPipeline.pass @@ -231,7 +231,7 @@ ] }, { - "Name": "ForwardMSAAPass", + "Name": "Forward", "TemplateName": "ForwardCheckerboardPassTemplate", "Connections": [ { @@ -300,28 +300,28 @@ { "LocalSlot": "DiffuseInputOutput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "DiffuseOutput" } }, { "LocalSlot": "AlbedoInput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "AlbedoOutput" } }, { "LocalSlot": "NormalInput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "NormalOutput" } }, { "LocalSlot": "DepthStencilInputOutput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "DepthStencilInputOutput" } } @@ -335,35 +335,35 @@ { "LocalSlot": "NormalInput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "NormalOutput" } }, { "LocalSlot": "SpecularF0Input", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "SpecularF0Output" } }, { "LocalSlot": "AlbedoInput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "AlbedoOutput" } }, { "LocalSlot": "DepthStencilInputOutput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "DepthStencilInputOutput" } }, { "LocalSlot": "SpecularInputOutput", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "SpecularOutput" } } @@ -460,7 +460,7 @@ { "LocalSlot": "InputColor2_curr", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "ScatterDistanceOutput" } } diff --git a/Passes/ColorInvertCS.pass b/Passes/ColorInvertCS.pass deleted file mode 100644 index 37afd970..00000000 --- a/Passes/ColorInvertCS.pass +++ /dev/null @@ -1,65 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "ColorInvertCS", - "PassClass": "ComputePass", - "Slots": [ - { - "Name": "Input", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "Output", - "SlotType": "Output", - "ScopeAttachmentUsage": "Shader", - "LoadStoreAction": { - "LoadAction": "Clear" - } - } - ], - "ImageAttachments": [ - { - "Name": "InvertedColor", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "Input" - } - }, - "FormatSource": { - "Pass": "This", - "Attachment": "Input" - }, - "ImageDescriptor": { - "BindFlags": [ - "CopyRead", - "ShaderReadWrite", - "ShaderWrite", - "ShaderRead" - ] - } - } - ], - "Connections": [ - { - "LocalSlot": "Output", - "AttachmentRef": { - "Pass": "This", - "Attachment": "InvertedColor" - } - } - ], - "PassData": { - "$type": "ComputePassData", - "ShaderAsset": { - "FilePath": "Shaders/PostProcessing/ColorInvertCS.shader" - }, - "Make Fullscreen Pass": true - } - } - } -} \ No newline at end of file diff --git a/Passes/ColorblindnessSimulation.pass b/Passes/ColorblindnessSimulation.pass deleted file mode 100644 index 42ed6aba..00000000 --- a/Passes/ColorblindnessSimulation.pass +++ /dev/null @@ -1,62 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "ColorBlindPassTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "Input", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "Output", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget" - } - ], - "ImageAttachments": [ - { - "Name": "ColorCorrectedImage", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "Input" - } - }, - "FormatSource": { - "Pass": "This", - "Attachment": "Input" - }, - "ImageDescriptor": { - "BindFlags": [ - "CopyRead", - "Color", - "ShaderReadWrite", - "ShaderWrite", - "ShaderRead" - ] - } - } - ], - "Connections": [ - { - "LocalSlot": "Output", - "AttachmentRef": { - "Pass": "This", - "Attachment": "ColorCorrectedImage" - } - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderAsset": { - "FilePath": "Shaders/PostProcessing/ColorblindnessSimulation.shader" - } - } - } - } -} \ No newline at end of file diff --git a/Passes/ComplexPipeline.pass b/Passes/ComplexPipeline.pass deleted file mode 100644 index 6fc3da6a..00000000 --- a/Passes/ComplexPipeline.pass +++ /dev/null @@ -1,313 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "ComplexPipeline", - "PassClass": "ParentPass", - "Slots": [ - { - "Name": "PipelineOutput", - "SlotType": "InputOutput" - } - ], - "PassData": { - "$type": "PassData", - "PipelineGlobalConnections": [ - { - "GlobalName": "PipelineOutput", - "Slot": "PipelineOutput" - } - ] - }, - "PassRequests": [ - { - "Name": "MorphTargetPass", - "TemplateName": "MorphTargetPassTemplate" - }, - { - "Name": "SkinningPass", - "TemplateName": "SkinningPassTemplate", - "Connections": [ - { - "LocalSlot": "SkinnedMeshOutputStream", - "AttachmentRef": { - "Pass": "MorphTargetPass", - "Attachment": "MorphTargetDeltaOutput" - } - } - ] - }, - { - "Name": "CascadedShadowmapsPass", - "TemplateName": "CascadedShadowmapsTemplate", - "PassData": { - "$type": "RasterPassData", - "DrawListTag": "shadow", - "PipelineViewTag": "DirectionalLightView" - }, - "Connections": [ - { - "LocalSlot": "SkinnedMeshes", - "AttachmentRef": { - "Pass": "SkinningPass", - "Attachment": "SkinnedMeshOutputStream" - } - } - ] - }, - { - "Name": "ProjectedShadowmapsPass", - "TemplateName": "ProjectedShadowmapsTemplate", - "PassData": { - "$type": "RasterPassData", - "DrawListTag": "shadow", - "PipelineViewTag": "ProjectedShadowView" - }, - "Connections": [ - { - "LocalSlot": "SkinnedMeshes", - "AttachmentRef": { - "Pass": "SkinningPass", - "Attachment": "SkinnedMeshOutputStream" - } - } - ] - }, - { - "Name": "EsmShadowmapsPassDirectional", - "TemplateName": "EsmShadowmapsTemplate", - "PassData": { - "$type": "EsmShadowmapsPassData", - "LightType": "directional" - }, - "Connections": [ - { - "LocalSlot": "DepthShadowmaps", - "AttachmentRef": { - "Pass": "CascadedShadowmapsPass", - "Attachment": "Shadowmap" - } - } - ] - }, - { - "Name": "EsmShadowmapsPassProjected", - "TemplateName": "EsmShadowmapsTemplate", - "PassData": { - "$type": "EsmShadowmapsPassData", - "LightType": "projected" - }, - "Connections": [ - { - "LocalSlot": "DepthShadowmaps", - "AttachmentRef": { - "Pass": "ProjectedShadowmapsPass", - "Attachment": "Shadowmap" - } - } - ] - }, - { - "Name": "DepthMSAAPass", - "TemplateName": "DepthMSAA4xPassTemplate", - "PassData": { - "$type": "RasterPassData", - "DrawListTag": "depth", - "PipelineViewTag": "MainCamera" - }, - "Connections": [ - { - "LocalSlot": "SkinnedMeshes", - "AttachmentRef": { - "Pass": "SkinningPass", - "Attachment": "SkinnedMeshOutputStream" - } - } - ] - }, - { - "Name": "LightCullingTilePreparePass", - "TemplateName": "LightCullingTilePrepareMSAATemplate", - "Connections": [ - { - "LocalSlot": "Depth", - "AttachmentRef": { - "Pass": "DepthMSAAPass", - "Attachment": "Output" - } - } - ] - }, - { - "Name": "LightCullingPass", - "TemplateName": "LightCullingTemplate", - "Connections": [ - { - "LocalSlot": "TileLightData", - "AttachmentRef": { - "Pass": "LightCullingTilePreparePass", - "Attachment": "TileLightData" - } - } - ] - }, - { - "Name": "LightCullingRemapPass", - "TemplateName": "LightCullingRemapTemplate", - "Connections": [ - { - "LocalSlot": "TileLightData", - "AttachmentRef": { - "Pass": "LightCullingTilePreparePass", - "Attachment": "TileLightData" - } - }, - { - "LocalSlot": "LightCount", - "AttachmentRef": { - "Pass": "LightCullingPass", - "Attachment": "LightCount" - } - }, - { - "LocalSlot": "LightList", - "AttachmentRef": { - "Pass": "LightCullingPass", - "Attachment": "LightList" - } - } - ] - }, - { - "Name": "ForwardMSAAPass", - "TemplateName": "ForwardMSAAPassTemplate", - "Connections": [ - { - "LocalSlot": "DirectionalLightShadowmap", - "AttachmentRef": { - "Pass": "CascadedShadowmapsPass", - "Attachment": "Shadowmap" - } - }, - { - "LocalSlot": "ExponentialShadowmapDirectional", - "AttachmentRef": { - "Pass": "EsmShadowmapsPassDirectional", - "Attachment": "EsmShadowmaps" - } - }, - { - "LocalSlot": "ProjectedLightShadowmap", - "AttachmentRef": { - "Pass": "ProjectedShadowmapsPass", - "Attachment": "Shadowmap" - } - }, - { - "LocalSlot": "ExponentialShadowmapProjected", - "AttachmentRef": { - "Pass": "EsmShadowmapsPassProjected", - "Attachment": "EsmShadowmaps" - } - }, - { - "LocalSlot": "DepthStencilInputOutput", - "AttachmentRef": { - "Pass": "DepthMSAAPass", - "Attachment": "Output" - } - }, - { - "LocalSlot": "TileLightData", - "AttachmentRef": { - "Pass": "LightCullingTilePreparePass", - "Attachment": "TileLightData" - } - }, - { - "LocalSlot": "LightListRemapped", - "AttachmentRef": { - "Pass": "LightCullingRemapPass", - "Attachment": "LightListRemapped" - } - } - ], - "PassData": { - "$type": "RasterPassData", - "DrawListTag": "forward", - "PipelineViewTag": "MainCamera", - "PassSrgShaderAsset": { - "FilePath": "Shaders/ForwardPassSrg.shader" - } - } - }, - { - "Name": "MSAAResolveColorPass", - "TemplateName": "MSAAResolveColorTemplate", - "Connections": [ - { - "LocalSlot": "Input", - "AttachmentRef": { - "Pass": "ForwardMSAAPass", - "Attachment": "DiffuseOutput" - } - } - ] - }, - { - "Name": "MeshMotionVectorPass", - "TemplateName": "MeshMotionVectorPassTemplate", - "PassData": { - "$type": "RasterPassData", - "DrawListTag": "motion", - "PipelineViewTag": "MainCamera" - }, - "Connections": [ - { - "LocalSlot": "SkinnedMeshes", - "AttachmentRef": { - "Pass": "SkinningPass", - "Attachment": "SkinnedMeshOutputStream" - } - } - ] - }, - { - "Name": "MonochromePass", - "TemplateName": "MonochromeTemplate", - "Connections": [ - { - "LocalSlot": "Input", - "AttachmentRef": { - "Pass": "MSAAResolveColorPass", - "Attachment": "Output" - } - } - ] - }, - { - "Name": "CopyToSwapChain", - "TemplateName": "FullscreenCopyTemplate", - "Connections": [ - { - "LocalSlot": "Input", - "AttachmentRef": { - "Pass": "MonochromePass", - "Attachment": "Output" - } - }, - { - "LocalSlot": "Output", - "AttachmentRef": { - "Pass": "Parent", - "Attachment": "PipelineOutput" - } - } - ] - } - ] - } - } -} \ No newline at end of file diff --git a/Passes/Monochrome.pass b/Passes/Monochrome.pass deleted file mode 100644 index 81fa9e1b..00000000 --- a/Passes/Monochrome.pass +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "MonochromeTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "Input", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "Output", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget" - } - ], - "ImageAttachments": [ - { - "Name": "MonochromeImage", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "Input" - } - }, - "FormatSource": { - "Pass": "This", - "Attachment": "Input" - }, - "ImageDescriptor": { - "BindFlags": [ - "CopyRead", - "Color", - "ShaderReadWrite", - "ShaderWrite", - "ShaderRead" - ] - } - } - ], - "Connections": [ - { - "LocalSlot": "Output", - "AttachmentRef": { - "Pass": "This", - "Attachment": "MonochromeImage" - } - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderDataMappings": { - "ColorMappings": [ - { - "Name": "m_colorTint", - "Value": [ - 1.0, - 1.0, - 0.0, - 1.0 - ] - } - ] - }, - "ShaderAsset": { - "FilePath": "Shaders/PostProcessing/Monochrome.shader" - } - } - } - } -} \ No newline at end of file diff --git a/Passes/SsaoPipeline.pass b/Passes/SsaoPipeline.pass index cc1796af..7ff61bf7 100644 --- a/Passes/SsaoPipeline.pass +++ b/Passes/SsaoPipeline.pass @@ -45,7 +45,7 @@ }, { "Name": "DepthPrePass", - "TemplateName": "DepthMSAAParentTemplate", + "TemplateName": "DepthParentTemplate", "Connections": [ { "LocalSlot": "SkinnedMeshes", @@ -118,8 +118,8 @@ ] }, { - "Name": "ForwardMSAAPass", - "TemplateName": "ForwardMSAAPassTemplate", + "Name": "Forward", + "TemplateName": "ForwardPassTemplate", "Connections": [ // Inputs... { @@ -189,14 +189,14 @@ { "LocalSlot": "InputDepth", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "DepthStencilInputOutput" } }, { "LocalSlot": "WorldNormal", "AttachmentRef": { - "Pass": "ForwardMSAAPass", + "Pass": "Forward", "Attachment": "NormalOutput" } } diff --git a/Shaders/PostProcessing/ColorblindnessSimulation.azsl b/Shaders/PostProcessing/ColorblindnessSimulation.azsl deleted file mode 100644 index 3c0f0be2..00000000 --- a/Shaders/PostProcessing/ColorblindnessSimulation.azsl +++ /dev/null @@ -1,75 +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 - * - */ - -#include - -#include -#include -#include - -ShaderResourceGroup PassSrg : SRG_PerPass -{ - Texture2D m_framebuffer; - Sampler LinearSampler - { - MinFilter = Linear; - MagFilter = Linear; - MipFilter = Linear; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; - - //float4x4 m_simulationMatrix; - //float4 m_simulationParams; -} - -#define BLINDNESS_STRENGTH 1.0h //PassSrg.m_simulationParams.x - -PSOutput MainPS(VSOutput IN) -{ - float3x4 simulationMatrix = float3x4(0, 1.05118294, -0.05116099, 0, - 0, 1, 0, 0, - 0, 0, 1, 0); - - PSOutput OUT; - - // This texture sample will be in sRGB since HDR post process should happen before this - half3 srgbColor = half3(PassSrg::m_framebuffer.Sample(PassSrg::LinearSampler, IN.m_texCoord).rgb); - - half3 linearColor = half3(SRGBToLinear(srgbColor)); - - // LMS Transformation matrix and inverse described in http://ixora.io/projects/colorblindness/color-blindness-simulation-research/ - half3x3 lmsTransformation = half3x3(0.31399022, 0.63951294, 0.04649755, - 0.15537241, 0.75789446, 0.08670142, - 0.01775239, 0.10944209, 0.87256922); - - half3x3 inverseLmsTransformation = half3x3(5.47221206, -4.6419601, 0.16963708, - -1.1252419, 2.29317094, -0.1678952, - 0.02980165, -0.19318073, 1.16364789); - - // Linear to LMS - half3 lmsColor = mul(lmsTransformation, linearColor); - - // Apply given simulation matrix to adjust colors to be what a colorblind person would see - lmsColor = half3(mul(simulationMatrix, float4(lmsColor, 1.000)).rgb); - - // LMS back into Linear - half3 simulatedLinearColor = mul(inverseLmsTransformation, lmsColor); - - // Linear interpolation between true color and color blindness based on blindness strength - simulatedLinearColor = lerp(linearColor, simulatedLinearColor, BLINDNESS_STRENGTH); - - // Linear to sRGB - float3 simulatedsRGBColor = LinearToSRGB(simulatedLinearColor); - - OUT.m_color.rgb = simulatedsRGBColor; - OUT.m_color.w = 1; - - return OUT; -} \ No newline at end of file diff --git a/Shaders/PostProcessing/ColorblindnessSimulation.shader b/Shaders/PostProcessing/ColorblindnessSimulation.shader deleted file mode 100644 index aeee0955..00000000 --- a/Shaders/PostProcessing/ColorblindnessSimulation.shader +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Source" : "ColorblindnessSimulation.azsl", - - "DepthStencilState" : { - "Depth" : { "Enable" : false } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Shaders/PostProcessing/Monochrome.azsl b/Shaders/PostProcessing/Monochrome.azsl deleted file mode 100644 index a396f90e..00000000 --- a/Shaders/PostProcessing/Monochrome.azsl +++ /dev/null @@ -1,46 +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 - * - */ - -#include - -#include -#include -#include - -ShaderResourceGroup PassSrg : SRG_PerPass -{ - Texture2D m_framebuffer; - Sampler LinearSampler - { - MinFilter = Linear; - MagFilter = Linear; - MipFilter = Linear; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; - - float4 m_colorTint; -} - -PSOutput MainPS(VSOutput IN) -{ - PSOutput OUT; - - float3 color = PassSrg::m_framebuffer.Sample(PassSrg::LinearSampler, IN.m_texCoord).rgb; - - float average = color.r + color.g + color.b; - average /= 3.0f; - - OUT.m_color.rgb = float3(average, average, average); - OUT.m_color.w = 1; - - OUT.m_color.rgb *= PassSrg::m_colorTint.rgb; - - return OUT; -} \ No newline at end of file diff --git a/Shaders/PostProcessing/Monochrome.shader b/Shaders/PostProcessing/Monochrome.shader deleted file mode 100644 index 28e9b364..00000000 --- a/Shaders/PostProcessing/Monochrome.shader +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Source" : "Monochrome.azsl", - - "DepthStencilState" : { - "Depth" : { "Enable" : false } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/atomsampleviewer_asset_files.cmake b/atomsampleviewer_asset_files.cmake index 0d64296b..1d86b20a 100644 --- a/atomsampleviewer_asset_files.cmake +++ b/atomsampleviewer_asset_files.cmake @@ -15,14 +15,10 @@ set(FILES Materials/Types/MinimalMultilayerPBR_ForwardPass.azsl Materials/Types/MinimalMultilayerPBR_ForwardPass.shader Passes/CheckerboardPipeline.pass - Passes/ColorblindnessSimulation.pass - Passes/ColorInvertCS.pass - Passes/ComplexPipeline.pass Passes/Fullscreen.pass Passes/FullscreenPipeline.pass Passes/ImGuiNoInput.pass Passes/ImGuiOnlyPipeline.pass - Passes/Monochrome.pass Passes/RayTracingAmbientOcclusion.pass Passes/ReadbackFiller.pass Passes/ReadbackPipeline.pass @@ -76,12 +72,8 @@ set(FILES Shaders/DynamicDraw/DynamicDrawExample.shader Shaders/OptimizationTests/DummyTransformColor.azsl Shaders/OptimizationTests/DummyTransformColor.shader - Shaders/PostProcessing/ColorblindnessSimulation.azsl - Shaders/PostProcessing/ColorblindnessSimulation.shader Shaders/PostProcessing/ColorInvertCS.azsl Shaders/PostProcessing/ColorInvertCS.shader - Shaders/PostProcessing/Monochrome.azsl - Shaders/PostProcessing/Monochrome.shader Shaders/RayTracing/RTAOClosestHit.azsl Shaders/RayTracing/RTAOClosestHit.shader Shaders/RayTracing/RTAODefines.azsli From a0786361fe507beb48a799be904b7aa5361a21eb Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Fri, 1 Jul 2022 18:08:48 -0700 Subject: [PATCH 57/81] Removed commented code Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- Gem/Code/Source/RHI/SubpassExampleComponent.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Gem/Code/Source/RHI/SubpassExampleComponent.cpp b/Gem/Code/Source/RHI/SubpassExampleComponent.cpp index 0078daac..0809d4b6 100644 --- a/Gem/Code/Source/RHI/SubpassExampleComponent.cpp +++ b/Gem/Code/Source/RHI/SubpassExampleComponent.cpp @@ -186,21 +186,6 @@ namespace AtomSampleViewer ModelType_Suzanne, }; - //auto setModelType = [](AZStd::span types, AZStd::vector& modelDataList) - //{ - // modelDataList.resize(types.size()); - // - // uint32_t meshCount = 0; - // for (uint32_t i = 0; i < modelDataList.size(); ++i) - // { - // modelDataList[i].m_modelType = types[i]; - // meshCount += m_models[modelDataList[i].m_modelType]->GetLods()[0]->GetMeshes().size(); - // } - //}; - // - //setModelType(AZStd::span(&opaqueModels[0], AZ_ARRAY_SIZE(opaqueModels)), m_opaqueModelsData); - - AZStd::span types(&opaqueModels[0], AZ_ARRAY_SIZE(opaqueModels)); m_opaqueModelsData.resize(types.size()); From dbeb75b6c9d99338994da42f933e4649ceb64833 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 8 Jul 2022 21:10:16 -0700 Subject: [PATCH 58/81] Added photosensitive seizure warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new AtomSampleComponent base class is shared by all ASV samples. If any sample needs to warn the user about its content, there is a ContentWarning variable that can be overridden. The SampleComponentManager will display the warning before opening that sample. I also added similar warnings when opening the Script Runner and Pre-Commit Wizard dialogs, because any automation script is likely to cause flashing images. Note that I also remove the ability to use Ctrl-0 through Ctrl-9 to open samples. It only worked for the first 10 samples, and was useful in the early days of AtomSampleViewer when we couldn’t show ImGui during RHI samples. Now that all samples keep ImGui visible, we can stop maintaining this feature. Fixes https://github.com/o3de/o3de-atom-sampleviewer/issues/398 Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/AtomSampleComponent.cpp | 14 ++++ Gem/Code/Source/AtomSampleComponent.h | 31 +++++++ Gem/Code/Source/CommonSampleComponentBase.h | 6 +- Gem/Code/Source/RHI/BasicRHIComponent.h | 6 +- .../RHI/MultiViewportSwapchainComponent.h | 2 + .../Source/RHI/SwapchainExampleComponent.h | 2 + Gem/Code/Source/SampleComponentManager.cpp | 80 ++++++++----------- Gem/Code/Source/SampleComponentManager.h | 8 +- .../Source/SceneReloadSoakTestComponent.h | 5 ++ Gem/Code/Source/ShaderReloadTestComponent.h | 4 +- .../atomsampleviewergem_private_files.cmake | 2 + 11 files changed, 103 insertions(+), 57 deletions(-) create mode 100644 Gem/Code/Source/AtomSampleComponent.cpp create mode 100644 Gem/Code/Source/AtomSampleComponent.h diff --git a/Gem/Code/Source/AtomSampleComponent.cpp b/Gem/Code/Source/AtomSampleComponent.cpp new file mode 100644 index 00000000..bdae3417 --- /dev/null +++ b/Gem/Code/Source/AtomSampleComponent.cpp @@ -0,0 +1,14 @@ +/* + * 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 + * + */ + +#include + +namespace AtomSampleViewer +{ + +} diff --git a/Gem/Code/Source/AtomSampleComponent.h b/Gem/Code/Source/AtomSampleComponent.h new file mode 100644 index 00000000..eb7d5ab9 --- /dev/null +++ b/Gem/Code/Source/AtomSampleComponent.h @@ -0,0 +1,31 @@ +/* + * 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 + * + */ + +#pragma once + +#include + +namespace AtomSampleViewer +{ + class AtomSampleComponent + : public AZ::Component + { + public: + AZ_RTTI(AtomSampleComponent, "{2318DFD6-BC6B-4335-9F25-8E270A10CA81}", AZ::Component); + + AtomSampleComponent() = default; + ~AtomSampleComponent() override = default; + + // Redefine this string in the sample component subclass to provide a sample-specific warning message. + // Any non-empty string will automatically cause a warning message to be displayed before opening the sample. + static constexpr const char* ContentWarning = ""; + + // This is a common photosensitive/seizure warning that could be used for the above ContentWarning in specific samples as needed. + static constexpr const char CommonPhotosensitiveWarning[] = "This sample includes flashing images that could cause seizures or other adverse effects in photosensitive individuals."; + }; +} // namespace AtomSampleViewer diff --git a/Gem/Code/Source/CommonSampleComponentBase.h b/Gem/Code/Source/CommonSampleComponentBase.h index a1e2deda..7b78c167 100644 --- a/Gem/Code/Source/CommonSampleComponentBase.h +++ b/Gem/Code/Source/CommonSampleComponentBase.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -25,12 +25,12 @@ namespace AtomSampleViewer { class CommonSampleComponentBase - : public AZ::Component + : public AtomSampleComponent , public AZ::TransformNotificationBus::MultiHandler , public AZ::EntityBus::MultiHandler { public: - AZ_TYPE_INFO(CommonSampleComponentBase, "{7EECDF09-B774-46C1-AD6E-060CE5717C05}"); + AZ_RTTI(CommonSampleComponentBase, "{7EECDF09-B774-46C1-AD6E-060CE5717C05}", AtomSampleComponent); static void Reflect(AZ::ReflectContext* context); diff --git a/Gem/Code/Source/RHI/BasicRHIComponent.h b/Gem/Code/Source/RHI/BasicRHIComponent.h index 308d743e..20cc10fa 100644 --- a/Gem/Code/Source/RHI/BasicRHIComponent.h +++ b/Gem/Code/Source/RHI/BasicRHIComponent.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include #include #include @@ -81,13 +81,13 @@ namespace AtomSampleViewer }; class BasicRHIComponent - : public AZ::Component + : public AtomSampleComponent , public AZ::RHI::RHISystemNotificationBus::Handler { friend class RHISamplePass; public: - AZ_RTTI(BasicRHIComponent, "{FAB340E4-2D91-48CD-A7BC-81ED25721415}", AZ::Component); + AZ_RTTI(BasicRHIComponent, "{FAB340E4-2D91-48CD-A7BC-81ED25721415}", AtomSampleComponent); BasicRHIComponent() = default; ~BasicRHIComponent() override = default; diff --git a/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h b/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h index 5ec73cd2..2d65ab85 100644 --- a/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h +++ b/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h @@ -30,6 +30,8 @@ namespace AtomSampleViewer , public AzFramework::WindowNotificationBus::Handler { public: + static constexpr const char* ContentWarning = CommonPhotosensitiveWarning; + AZ_COMPONENT(MultiViewportSwapchainComponent, "{45118741-F7DB-4EE0-9EBF-59B85D7F6194}", AZ::Component); AZ_DISABLE_COPY(MultiViewportSwapchainComponent); diff --git a/Gem/Code/Source/RHI/SwapchainExampleComponent.h b/Gem/Code/Source/RHI/SwapchainExampleComponent.h index b98ea635..67804dca 100644 --- a/Gem/Code/Source/RHI/SwapchainExampleComponent.h +++ b/Gem/Code/Source/RHI/SwapchainExampleComponent.h @@ -18,6 +18,8 @@ namespace AtomSampleViewer , public AZ::TickBus::Handler { public: + static constexpr const char* ContentWarning = CommonPhotosensitiveWarning; + AZ_COMPONENT(SwapchainExampleComponent, "{F8A990AD-63C0-43D8-AE9B-FB9D84CB58E2}", AZ::Component); static void Reflect(AZ::ReflectContext* context); diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index e5748e6b..969b9a10 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -165,6 +165,7 @@ namespace AtomSampleViewer entry.m_componentDescriptor = T::CreateDescriptor(); entry.m_parentMenuName = menuName; entry.m_fullName = entry.m_parentMenuName + '/' + entry.m_sampleName; + entry.m_contentWarning = T::ContentWarning; return entry; } @@ -333,8 +334,6 @@ namespace AtomSampleViewer m_exampleEntity = aznew AZ::Entity(); m_entityContextId = AzFramework::EntityContextId::CreateNull(); - - memset(m_alphanumericNumbersDown, 0, s_alphanumericCount); } SampleComponentManager::~SampleComponentManager() @@ -556,16 +555,6 @@ namespace AtomSampleViewer { screenshotRequest = true; } - - for (size_t i = 0; i < m_availableSamples.size(); ++i) - { - if (m_alphanumericNumbersDown[i] && i < s_alphanumericCount && m_isSampleSupported[i]) - { - m_sampleChangeRequest = true; - m_selectedSampleIndex = static_cast(i); - break; - } - } } // Request a frame capture only once per key press, even if the keys are held down for multiple ticks. @@ -705,14 +694,6 @@ namespace AtomSampleViewer m_escapeDown = true; } - for (size_t i = 0; i < samplesAvailableCount; ++i) - { - if ((i < s_alphanumericCount) && (inputChannelId == sampleInputMapping[i])) - { - m_alphanumericNumbersDown[i] = true; - } - } - break; } case AzFramework::InputChannel::State::Ended: @@ -742,14 +723,6 @@ namespace AtomSampleViewer m_escapeDown = false; } - for (size_t i = 0; i < samplesAvailableCount; ++i) - { - if ((i < s_alphanumericCount) && (inputChannelId == sampleInputMapping[i])) - { - m_alphanumericNumbersDown[i] = false; - } - } - break; } default: @@ -852,6 +825,7 @@ namespace AtomSampleViewer m_scriptManager->TickImGui(); + m_contentWarningDialog.TickPopup(); } void SampleComponentManager::ShowMenuBar() @@ -928,35 +902,37 @@ namespace AtomSampleViewer SampleEntry& sample = m_availableSamples[index]; const char* sampleName = sample.m_sampleName.c_str(); bool enabled = m_isSampleSupported[index]; - if (index < s_alphanumericCount) + + if (ImGui::MenuItem(sampleName, nullptr, false, enabled)) { - const AZStd::string hotkeyName = AZStd::string::format("Ctrl-%d: ", (index + 1) % 10); + Utils::ReportScriptableAction("OpenSample('%s')", sample.m_sampleName.c_str()); - if (ImGui::MenuItem(sampleName, hotkeyName.c_str(), false, enabled)) + if (sample.m_contentWarning.empty()) { - m_selectedSampleIndex = index; m_sampleChangeRequest = true; + m_selectedSampleIndex = index; } - } - else - { - if (ImGui::MenuItem(sampleName, nullptr, false, enabled)) + else { - m_selectedSampleIndex = index; - m_sampleChangeRequest = true; + m_contentWarningDialog.OpenPopupConfirmation( + "Sample Content Warning", + sample.m_contentWarning, + [this, index]() { + m_sampleChangeRequest = true; + m_selectedSampleIndex = index; + }); } + } + + + } ImGui::EndMenu(); } } - if (m_sampleChangeRequest) - { - Utils::ReportScriptableAction("OpenSample('%s')", m_availableSamples[m_selectedSampleIndex].m_sampleName.c_str()); - } - ImGui::EndMenu(); } #ifdef AZ_PROFILE_TELEMETRY @@ -972,13 +948,27 @@ namespace AtomSampleViewer if (ImGui::BeginMenu("Automation")) { + const char* AutomationContentWarningTitle = "Sample Content Warning"; + const char* AutomationContentWarning = "Running automated scripts will trigger flashing images that could cause seizures or other adverse effects in photosensitive individuals."; + if (ImGui::MenuItem("Run Script...")) { - m_scriptManager->OpenScriptRunnerDialog(); + m_contentWarningDialog.OpenPopupConfirmation( + AutomationContentWarningTitle, + AutomationContentWarning, + [this]() { + m_scriptManager->OpenScriptRunnerDialog(); + }); + } if (ImGui::MenuItem("Run Precommit Wizard...")) { - m_scriptManager->OpenPrecommitWizard(); + m_contentWarningDialog.OpenPopupConfirmation( + AutomationContentWarningTitle, + AutomationContentWarning, + [this]() { + m_scriptManager->OpenPrecommitWizard(); + }); } ImGui::EndMenu(); diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index 60a42620..41ee5180 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -40,6 +40,7 @@ #include #include +#include namespace AZ { @@ -67,6 +68,7 @@ namespace AtomSampleViewer AZStd::function m_isSupportedFunc; SamplePipelineType m_pipelineType = SamplePipelineType::RHI; AZ::ComponentDescriptor* m_componentDescriptor; + AZStd::string m_contentWarning; bool operator==(const SampleEntry& other) { @@ -200,6 +202,8 @@ namespace AtomSampleViewer static constexpr uint32_t FrameTimeLogSize = 30; ImGuiHistogramQueue m_imGuiFrameTimer; + ImGuiMessageBox m_contentWarningDialog; + bool m_showImGuiMetrics = false; bool m_showSampleHelper = false; bool m_showResizeViewportDialog = false; @@ -228,10 +232,6 @@ namespace AtomSampleViewer bool m_canSwitchSample = true; bool m_canCaptureRADTM = true; - // 10 number keys 0-9 - static constexpr size_t s_alphanumericCount = 10; - bool m_alphanumericNumbersDown[s_alphanumericCount]; - bool m_exitRequested = false; AzFramework::EntityContextId m_entityContextId; diff --git a/Gem/Code/Source/SceneReloadSoakTestComponent.h b/Gem/Code/Source/SceneReloadSoakTestComponent.h index 6d9352ce..af851863 100644 --- a/Gem/Code/Source/SceneReloadSoakTestComponent.h +++ b/Gem/Code/Source/SceneReloadSoakTestComponent.h @@ -27,6 +27,11 @@ namespace AtomSampleViewer using Base = EntityLatticeTestComponent; public: AZ_COMPONENT(SceneReloadSoakTestComponent, "{5D0B03A6-F7B9-4952-90AB-C91306229964}", EntityLatticeTestComponent); + + // Instead of using the CommonPhotosensitiveWarning, I used a custom message here that specifically calls out headaches and nausea + // as I've personally experienced those while looking at this sample, even though I don't otherwise consider myself to be photosensitive. + static constexpr const char ContentWarning[] = "This sample has lots of flashing, may cause headaches and nausea, or may cause seizures for people with certain photosensitivity."; + SceneReloadSoakTestComponent() = default; static void Reflect(AZ::ReflectContext* context); diff --git a/Gem/Code/Source/ShaderReloadTestComponent.h b/Gem/Code/Source/ShaderReloadTestComponent.h index 0970a650..549abfd5 100644 --- a/Gem/Code/Source/ShaderReloadTestComponent.h +++ b/Gem/Code/Source/ShaderReloadTestComponent.h @@ -8,10 +8,10 @@ #pragma once +#include #include #include -#include #include #include @@ -28,7 +28,7 @@ namespace AtomSampleViewer // to render a FullscreenTrianglePass, with the purpose on validating that the // shader reload notification events work properly. class ShaderReloadTestComponent final - : public AZ::Component + : public AtomSampleComponent , public AZ::Render::Bootstrap::DefaultWindowNotificationBus::Handler , public AZ::TickBus::Handler { diff --git a/Gem/Code/atomsampleviewergem_private_files.cmake b/Gem/Code/atomsampleviewergem_private_files.cmake index f8be2522..a9ca85b8 100644 --- a/Gem/Code/atomsampleviewergem_private_files.cmake +++ b/Gem/Code/atomsampleviewergem_private_files.cmake @@ -7,6 +7,8 @@ # set(FILES + Source/AtomSampleComponent.cpp + Source/AtomSampleComponent.h Source/AtomSampleViewerOptions.h Source/AtomSampleViewerSystemComponent.cpp Source/AtomSampleViewerSystemComponent.h From 7a4e207211ab1fa2cd2525cb17983dce512ab22e Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 15 Jul 2022 19:16:55 -0500 Subject: [PATCH 59/81] Fix PassTree automation script failing to screen capture, also update some other uses of ForwardMSAAPass -> Forward Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../BakedShaderVariantExampleComponent_Traits_Platform.h | 2 +- .../Mac/BakedShaderVariantExampleComponent_Traits_Platform.h | 2 +- .../BakedShaderVariantExampleComponent_Traits_Platform.h | 2 +- .../iOS/BakedShaderVariantExampleComponent_Traits_Platform.h | 2 +- Scripts/PassTree.bv.lua | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gem/Code/Source/Platform/Linux/BakedShaderVariantExampleComponent_Traits_Platform.h b/Gem/Code/Source/Platform/Linux/BakedShaderVariantExampleComponent_Traits_Platform.h index 38795b76..564a8aeb 100644 --- a/Gem/Code/Source/Platform/Linux/BakedShaderVariantExampleComponent_Traits_Platform.h +++ b/Gem/Code/Source/Platform/Linux/BakedShaderVariantExampleComponent_Traits_Platform.h @@ -6,4 +6,4 @@ * */ -#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "ForwardMSAAPass" \ No newline at end of file +#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "Forward" \ No newline at end of file diff --git a/Gem/Code/Source/Platform/Mac/BakedShaderVariantExampleComponent_Traits_Platform.h b/Gem/Code/Source/Platform/Mac/BakedShaderVariantExampleComponent_Traits_Platform.h index 38795b76..564a8aeb 100644 --- a/Gem/Code/Source/Platform/Mac/BakedShaderVariantExampleComponent_Traits_Platform.h +++ b/Gem/Code/Source/Platform/Mac/BakedShaderVariantExampleComponent_Traits_Platform.h @@ -6,4 +6,4 @@ * */ -#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "ForwardMSAAPass" \ No newline at end of file +#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "Forward" \ No newline at end of file diff --git a/Gem/Code/Source/Platform/Windows/BakedShaderVariantExampleComponent_Traits_Platform.h b/Gem/Code/Source/Platform/Windows/BakedShaderVariantExampleComponent_Traits_Platform.h index 38795b76..564a8aeb 100644 --- a/Gem/Code/Source/Platform/Windows/BakedShaderVariantExampleComponent_Traits_Platform.h +++ b/Gem/Code/Source/Platform/Windows/BakedShaderVariantExampleComponent_Traits_Platform.h @@ -6,4 +6,4 @@ * */ -#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "ForwardMSAAPass" \ No newline at end of file +#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "Forward" \ No newline at end of file diff --git a/Gem/Code/Source/Platform/iOS/BakedShaderVariantExampleComponent_Traits_Platform.h b/Gem/Code/Source/Platform/iOS/BakedShaderVariantExampleComponent_Traits_Platform.h index 38795b76..564a8aeb 100644 --- a/Gem/Code/Source/Platform/iOS/BakedShaderVariantExampleComponent_Traits_Platform.h +++ b/Gem/Code/Source/Platform/iOS/BakedShaderVariantExampleComponent_Traits_Platform.h @@ -6,4 +6,4 @@ * */ -#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "ForwardMSAAPass" \ No newline at end of file +#define ATOMSAMPLEVIEWER_TRAIT_BAKED_SHADERVARIANT_SAMPLE_PASS_NAME "Forward" \ No newline at end of file diff --git a/Scripts/PassTree.bv.lua b/Scripts/PassTree.bv.lua index b9f2d943..cfe4e501 100644 --- a/Scripts/PassTree.bv.lua +++ b/Scripts/PassTree.bv.lua @@ -47,8 +47,8 @@ SetImguiValue('Preview Attachment', true) SetShowImGui(false) -- capture image attachment previews and capture them for different formats -TestAttachment('ForwardMSAAPass/[Input] [BRDFTextureInput] [Image] BRDFTexture [R16G16_FLOAT] [256x256]', 'brdf.png') -TestAttachment('ForwardMSAAPass/[Output] [AlbedoOutput] [Image] AlbedoImage [R8G8B8A8_UNORM] [800x600] [MSAA_4x]', 'albedo.png') +TestAttachment('Forward/[Input] [BRDFTextureInput] [Image] BRDFTexture [R16G16_FLOAT] [256x256]', 'brdf.png') +TestAttachment('Forward/[Output] [AlbedoOutput] [Image] AlbedoImage [R8G8B8A8_UNORM] [800x600] [MSAA_4x]', 'albedo.png') TestAttachment('MSAAResolveDepthPass/[Input] [Input] [Image] DepthStencil [D32_FLOAT_S8X24_UINT] [800x600] [MSAA_4x]', 'depthStencilMs.png') TestAttachment('MSAAResolveDepthPass/[Output] [Output] [Image] ResolvedDepthOutput [D32_FLOAT_S8X24_UINT] [800x600]', 'depthStencilResolve.png') TestAttachment('DepthDownsample/[Input] [FullResDepth] [Image] LinearDepth [R32_FLOAT] [800x600]', 'linearDepth.png') From 4512f8062502357763cf737fd3ef9b52fc205a09 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 18 Jul 2022 16:58:37 -0700 Subject: [PATCH 60/81] Fixed error counter issue that can occur when a screenshot file doesn't exist. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptReporter.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Gem/Code/Source/Automation/ScriptReporter.cpp b/Gem/Code/Source/Automation/ScriptReporter.cpp index d3bd09f4..4da7945f 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.cpp +++ b/Gem/Code/Source/Automation/ScriptReporter.cpp @@ -911,6 +911,12 @@ namespace AtomSampleViewer AZ::RHI::Format actualImageFormat; if (!LoadPngData(imageComparisonResult, actualImageFilePath, actualImageBuffer, actualImageSize, actualImageFormat, traceLevel)) { + // Even though LoadPngData might have reported an error, we need to report our own here with the "Screenshot check failed" string + // because the error handler in ScriptReporter::ScriptReport is looking for that. + ReportScreenshotComparisonIssue("Screenshot check failed. 'Actual' file not loaded.", + expectedImageFilePath, + actualImageFilePath, + traceLevel); return false; } @@ -919,6 +925,12 @@ namespace AtomSampleViewer AZ::RHI::Format expectedImageFormat; if (!LoadPngData(imageComparisonResult, expectedImageFilePath, expectedImageBuffer, expectedImageSize, expectedImageFormat, traceLevel)) { + // Even though LoadPngData might have reported an error, we need to report our own here with the "Screenshot check failed" string + // because the error handler in ScriptReporter::ScriptReport is looking for that. + ReportScreenshotComparisonIssue("Screenshot check failed. 'Expected' file not loaded.", + expectedImageFilePath, + actualImageFilePath, + traceLevel); return false; } From 8b2668d77db6c10e794e4bcb7a2f06bf053a36d1 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 19 Jul 2022 09:57:09 -0700 Subject: [PATCH 61/81] Made the --sample command line option also show the content warnings. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/SampleComponentManager.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 969b9a10..da012dfb 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -461,9 +461,23 @@ namespace AtomSampleViewer { if (m_isSampleSupported[i]) { + if (m_availableSamples[i].m_contentWarning.empty()) + { + m_selectedSampleIndex = i; + m_sampleChangeRequest = true; + } + else + { + m_contentWarningDialog.OpenPopupConfirmation( + "Sample Content Warning", + m_availableSamples[i].m_contentWarning, + [this, i]() { + m_selectedSampleIndex = i; + m_sampleChangeRequest = true; + }); + } + targetSampleFound = true; - m_selectedSampleIndex = i; - m_sampleChangeRequest = true; } break; @@ -922,11 +936,7 @@ namespace AtomSampleViewer m_selectedSampleIndex = index; }); } - } - - - } ImGui::EndMenu(); From bfa6b8c7ba1fa1023a9dc6070498ff54929a9b5d Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 20 Jul 2022 13:31:47 -0700 Subject: [PATCH 62/81] Made the content warning dialog's title configurable as well. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Gem/Code/Source/AtomSampleComponent.h | 5 +++++ Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h | 1 + Gem/Code/Source/RHI/SwapchainExampleComponent.h | 1 + Gem/Code/Source/SampleComponentManager.cpp | 7 ++++--- Gem/Code/Source/SampleComponentManager.h | 1 + Gem/Code/Source/SceneReloadSoakTestComponent.h | 3 ++- 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Gem/Code/Source/AtomSampleComponent.h b/Gem/Code/Source/AtomSampleComponent.h index eb7d5ab9..71f22036 100644 --- a/Gem/Code/Source/AtomSampleComponent.h +++ b/Gem/Code/Source/AtomSampleComponent.h @@ -24,8 +24,13 @@ namespace AtomSampleViewer // Redefine this string in the sample component subclass to provide a sample-specific warning message. // Any non-empty string will automatically cause a warning message to be displayed before opening the sample. static constexpr const char* ContentWarning = ""; + + // If the above ContentWarning is overridden with a non-empty value, this string will be used as the message box's title. + // Redefine this string in the sample component subclass to provide a custom title. + static constexpr const char* ContentWarningTitle = "Content Warning"; // This is a common photosensitive/seizure warning that could be used for the above ContentWarning in specific samples as needed. static constexpr const char CommonPhotosensitiveWarning[] = "This sample includes flashing images that could cause seizures or other adverse effects in photosensitive individuals."; + static constexpr const char CommonPhotosensitiveWarningTitle[] = "Photosensitive Seizure Warning"; }; } // namespace AtomSampleViewer diff --git a/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h b/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h index 2d65ab85..97e928df 100644 --- a/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h +++ b/Gem/Code/Source/RHI/MultiViewportSwapchainComponent.h @@ -31,6 +31,7 @@ namespace AtomSampleViewer { public: static constexpr const char* ContentWarning = CommonPhotosensitiveWarning; + static constexpr const char* ContentWarningTitle = CommonPhotosensitiveWarningTitle; AZ_COMPONENT(MultiViewportSwapchainComponent, "{45118741-F7DB-4EE0-9EBF-59B85D7F6194}", AZ::Component); AZ_DISABLE_COPY(MultiViewportSwapchainComponent); diff --git a/Gem/Code/Source/RHI/SwapchainExampleComponent.h b/Gem/Code/Source/RHI/SwapchainExampleComponent.h index 67804dca..00b93100 100644 --- a/Gem/Code/Source/RHI/SwapchainExampleComponent.h +++ b/Gem/Code/Source/RHI/SwapchainExampleComponent.h @@ -19,6 +19,7 @@ namespace AtomSampleViewer { public: static constexpr const char* ContentWarning = CommonPhotosensitiveWarning; + static constexpr const char* ContentWarningTitle = CommonPhotosensitiveWarningTitle; AZ_COMPONENT(SwapchainExampleComponent, "{F8A990AD-63C0-43D8-AE9B-FB9D84CB58E2}", AZ::Component); diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index da012dfb..4ae03e1b 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -166,6 +166,7 @@ namespace AtomSampleViewer entry.m_parentMenuName = menuName; entry.m_fullName = entry.m_parentMenuName + '/' + entry.m_sampleName; entry.m_contentWarning = T::ContentWarning; + entry.m_contentWarningTitle = T::ContentWarningTitle; return entry; } @@ -469,7 +470,7 @@ namespace AtomSampleViewer else { m_contentWarningDialog.OpenPopupConfirmation( - "Sample Content Warning", + m_availableSamples[i].m_contentWarningTitle, m_availableSamples[i].m_contentWarning, [this, i]() { m_selectedSampleIndex = i; @@ -929,7 +930,7 @@ namespace AtomSampleViewer else { m_contentWarningDialog.OpenPopupConfirmation( - "Sample Content Warning", + sample.m_contentWarningTitle, sample.m_contentWarning, [this, index]() { m_sampleChangeRequest = true; @@ -958,7 +959,7 @@ namespace AtomSampleViewer if (ImGui::BeginMenu("Automation")) { - const char* AutomationContentWarningTitle = "Sample Content Warning"; + const char* AutomationContentWarningTitle = AtomSampleComponent::CommonPhotosensitiveWarningTitle; const char* AutomationContentWarning = "Running automated scripts will trigger flashing images that could cause seizures or other adverse effects in photosensitive individuals."; if (ImGui::MenuItem("Run Script...")) diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index 41ee5180..716b6edc 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -69,6 +69,7 @@ namespace AtomSampleViewer SamplePipelineType m_pipelineType = SamplePipelineType::RHI; AZ::ComponentDescriptor* m_componentDescriptor; AZStd::string m_contentWarning; + AZStd::string m_contentWarningTitle; bool operator==(const SampleEntry& other) { diff --git a/Gem/Code/Source/SceneReloadSoakTestComponent.h b/Gem/Code/Source/SceneReloadSoakTestComponent.h index af851863..9e0aaab7 100644 --- a/Gem/Code/Source/SceneReloadSoakTestComponent.h +++ b/Gem/Code/Source/SceneReloadSoakTestComponent.h @@ -30,7 +30,8 @@ namespace AtomSampleViewer // Instead of using the CommonPhotosensitiveWarning, I used a custom message here that specifically calls out headaches and nausea // as I've personally experienced those while looking at this sample, even though I don't otherwise consider myself to be photosensitive. - static constexpr const char ContentWarning[] = "This sample has lots of flashing, may cause headaches and nausea, or may cause seizures for people with certain photosensitivity."; + static constexpr const char* ContentWarning = "This sample has lots of flashing, may cause headaches and nausea, or may cause seizures for people with certain photosensitivity."; + static constexpr const char* ContentWarningTitle = CommonPhotosensitiveWarningTitle; SceneReloadSoakTestComponent() = default; From 11e80af058867ed2f5553cee70ca478fca7b7672 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 22 Jul 2022 10:46:52 -0500 Subject: [PATCH 63/81] Updating the ScriptReporter.cpp to no longer use the zero parameter push_back() extension. (#480) It now uses emplace_back() Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptReporter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gem/Code/Source/Automation/ScriptReporter.cpp b/Gem/Code/Source/Automation/ScriptReporter.cpp index 4da7945f..0035f06e 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.cpp +++ b/Gem/Code/Source/Automation/ScriptReporter.cpp @@ -178,8 +178,7 @@ namespace AtomSampleViewer } m_currentScriptIndexStack.push_back(m_scriptReports.size()); - m_scriptReports.push_back(); - m_scriptReports.back().m_scriptAssetPath = scriptAssetPath; + m_scriptReports.emplace_back().m_scriptAssetPath = scriptAssetPath; m_scriptReports.back().BusConnect(); } From 770fbfba22d40b5944c688e6727c648e9cc8aa62 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:22:08 -0500 Subject: [PATCH 64/81] More accurate FrameTime stats (#454) * More accurate FrameTime stats Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * ASV More Accurate Frame Time Stats, make the count of frames to average time over command line configurable Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * More Accurate Frame Time Stats, update PR with @moudgils & @gadams3's feedback Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/SampleComponentManager.cpp | 22 +++++++++++++++---- Gem/Code/Source/SampleComponentManager.h | 7 ++++-- Gem/Code/Source/Utils/ImGuiHistogramQueue.cpp | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 4ae03e1b..08680b3e 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -330,8 +330,9 @@ namespace AtomSampleViewer SampleComponentManager::SampleComponentManager() : m_imguiFrameCaptureSaver("@user@/frame_capture.xml") - , m_imGuiFrameTimer(FrameTimeLogSize, FrameTimeLogSize, 250.0f) { + m_imGuiFrameTimer = AZStd::make_unique(FrameTimeDefaultLogSize, FrameTimeDefaultLogSize, 250.0f); + m_exampleEntity = aznew AZ::Entity(); m_entityContextId = AzFramework::EntityContextId::CreateNull(); @@ -486,6 +487,16 @@ namespace AtomSampleViewer } AZ_Warning("SampleComponentManager", targetSampleFound, "Failed find target sample %s", targetSampleName.c_str()); } + if (commandLine->HasSwitch("timingSamples")) + { + AZStd::string timingSamplesStr = commandLine->GetSwitchValue("timingSamples", 0); + int timingSamplesCount = 0; + if (AZ::StringFunc::LooksLikeInt(timingSamplesStr.c_str(), &timingSamplesCount)) + { + timingSamplesCount = AZStd::clamp(timingSamplesCount, FrameTimeMinLogSize, FrameTimeMaxLogSize); + m_imGuiFrameTimer = AZStd::make_unique(timingSamplesCount, timingSamplesCount, 250.0f); + } + } // Set default screenshot folder to relative path 'Screenshots' AZ::IO::Path screenshotFolder = "Screenshots"; @@ -543,7 +554,10 @@ namespace AtomSampleViewer void SampleComponentManager::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - m_imGuiFrameTimer.PushValue(deltaTime * 1000.0f); + if (m_imGuiFrameTimer) + { + m_imGuiFrameTimer->PushValue(deltaTime * 1000.0f); + } bool screenshotRequest = false; @@ -1191,12 +1205,12 @@ namespace AtomSampleViewer void SampleComponentManager::ShowFramerateHistogram(float deltaTime) { - if (ImGui::Begin("Frame Time Histogram", &m_showFramerateHistogram, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings)) + if (m_imGuiFrameTimer && ImGui::Begin("Frame Time Histogram", &m_showFramerateHistogram, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings)) { ImGuiHistogramQueue::WidgetSettings settings; settings.m_reportInverse = false; settings.m_units = "ms"; - m_imGuiFrameTimer.Tick(deltaTime * 1000.0f, settings); + m_imGuiFrameTimer->Tick(deltaTime * 1000.0f, settings); } ImGui::End(); } diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index 716b6edc..fe28a7b1 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -200,8 +201,10 @@ namespace AtomSampleViewer int32_t m_selectedSampleIndex = -1; - static constexpr uint32_t FrameTimeLogSize = 30; - ImGuiHistogramQueue m_imGuiFrameTimer; + static constexpr uint32_t FrameTimeDefaultLogSize = 100; + static constexpr uint32_t FrameTimeMinLogSize = FrameTimeDefaultLogSize; + static constexpr uint32_t FrameTimeMaxLogSize = 1000000; // 1M + AZStd::unique_ptr m_imGuiFrameTimer; ImGuiMessageBox m_contentWarningDialog; diff --git a/Gem/Code/Source/Utils/ImGuiHistogramQueue.cpp b/Gem/Code/Source/Utils/ImGuiHistogramQueue.cpp index 18249dcd..44c36150 100644 --- a/Gem/Code/Source/Utils/ImGuiHistogramQueue.cpp +++ b/Gem/Code/Source/Utils/ImGuiHistogramQueue.cpp @@ -69,7 +69,7 @@ namespace AtomSampleViewer // Calculate average for numeric display if (m_timeSinceLastDisplayUpdate >= m_numericDisplayDelay || m_samplesSinceLastDisplayUpdate >= m_maxSamples) { - m_displayedAverage = UpdateDisplayedValues(m_samplesSinceLastDisplayUpdate, m_displayedMinimum, m_displayedMaximum); + m_displayedAverage = UpdateDisplayedValues(m_maxSamples, m_displayedMinimum, m_displayedMaximum); m_timeSinceLastDisplayUpdate = 0.0f; m_samplesSinceLastDisplayUpdate = 0; From c9f6ae4507da48fe35a1400095ad44047cb9d771 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Tue, 26 Jul 2022 21:46:21 -0700 Subject: [PATCH 65/81] Changed the DiffuseGI sample to use the new DiffuseProbeGrid gem, and made minor changes to the sample settings Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- Gem/Code/CMakeLists.txt | 1 + Gem/Code/Source/DiffuseGIExampleComponent.cpp | 4 ++-- Gem/Code/Source/DiffuseGIExampleComponent.h | 6 +++--- Gem/Code/enabled_gems.cmake | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index c0d6a818..23a1ce96 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -45,6 +45,7 @@ ly_add_target( Gem::Atom_Component_DebugCamera.Static Gem::AtomSampleViewer.Lib.Static Gem::Profiler.Static + Gem::DiffuseProbeGrid.Static ) ly_add_target( diff --git a/Gem/Code/Source/DiffuseGIExampleComponent.cpp b/Gem/Code/Source/DiffuseGIExampleComponent.cpp index d2aaec5e..fd0a6494 100644 --- a/Gem/Code/Source/DiffuseGIExampleComponent.cpp +++ b/Gem/Code/Source/DiffuseGIExampleComponent.cpp @@ -384,8 +384,8 @@ namespace AtomSampleViewer m_directionalLightPitch = AZ::DegToRad(-65.0f); m_directionalLightYaw = AZ::DegToRad(65.0f); - m_directionalLightColor = AZ::Color(0.92f, 0.78f, 0.35f, 1.0f); - m_directionalLightIntensity = 30.0f; + m_directionalLightColor = AZ::Color(1.0f, 0.9f, 0.6f, 1.0f); + m_directionalLightIntensity = 20.0f; m_pointLightPos = AZ::Vector3(9.2f, -3.7f, 1.0f); m_pointLightColor = AZ::Color(1.0f, 0.0f, 0.0f, 1.0f); diff --git a/Gem/Code/Source/DiffuseGIExampleComponent.h b/Gem/Code/Source/DiffuseGIExampleComponent.h index 93c0e198..0222ea79 100644 --- a/Gem/Code/Source/DiffuseGIExampleComponent.h +++ b/Gem/Code/Source/DiffuseGIExampleComponent.h @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include namespace AtomSampleViewer { @@ -164,7 +164,7 @@ namespace AtomSampleViewer // diffuse IBL (Sponza only) bool m_useDiffuseIbl = true; AZ::Data::Asset m_diffuseImageAsset; - float m_diffuseIblExposure = 2.0f; + float m_diffuseIblExposure = 1.0f; // shadow settings static const AZ::Render::ShadowmapSize s_shadowmapSizes[]; diff --git a/Gem/Code/enabled_gems.cmake b/Gem/Code/enabled_gems.cmake index 9f4b804e..87d24256 100644 --- a/Gem/Code/enabled_gems.cmake +++ b/Gem/Code/enabled_gems.cmake @@ -23,4 +23,5 @@ set(ENABLED_GEMS MaterialEditor UiBasics StreamerProfiler + DiffuseProbeGrid ) From 5f218576c27aa64bdf38e9f6600139c44abfe5e2 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:12:48 -0700 Subject: [PATCH 66/81] Moved the submit index to a separate parameter in CommandList::Submit Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp | 12 ++++-------- .../Source/RHI/BindlessPrototypeExampleComponent.cpp | 3 +-- .../Source/RHI/InputAssemblyExampleComponent.cpp | 6 ++---- Gem/Code/Source/RHI/MultiThreadComponent.cpp | 3 +-- Gem/Code/Source/RHI/QueryExampleComponent.cpp | 10 ++++------ Gem/Code/Source/RHI/StencilExampleComponent.cpp | 6 ++---- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp b/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp index e00186e4..57c13383 100644 --- a/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp +++ b/Gem/Code/Source/RHI/AsyncComputeExampleComponent.cpp @@ -879,7 +879,6 @@ namespace AtomSampleViewer const RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[ShadowScope][0]->GetRHIShaderResourceGroup() }; RHI::DrawItem drawItem; - drawItem.m_submitIndex = i; drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_terrainPipelineStates[ShadowScope].get(); drawItem.m_indexBufferView = &m_quadIndexBufferView; @@ -887,7 +886,7 @@ namespace AtomSampleViewer drawItem.m_shaderResourceGroups = shaderResourceGroups; drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ShadowScope].size()); drawItem.m_streamBufferViews = m_quadStreamBufferViews[ShadowScope].data(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } else { @@ -896,7 +895,6 @@ namespace AtomSampleViewer for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) { RHI::DrawItem drawItem; - drawItem.m_submitIndex = i; drawItem.m_arguments = mesh.m_drawArguments; drawItem.m_pipelineState = m_modelPipelineStates[ShadowScope].get(); drawItem.m_indexBufferView = &mesh.m_indexBufferView; @@ -905,7 +903,7 @@ namespace AtomSampleViewer drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ShadowScope].size()); drawItem.m_streamBufferViews = m_modelStreamBufferViews[ShadowScope].data(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } } } @@ -999,7 +997,6 @@ namespace AtomSampleViewer drawIndexed.m_instanceCount = 1; RHI::DrawItem drawItem; - drawItem.m_submitIndex = i; drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_terrainPipelineStates[ForwardScope].get(); drawItem.m_indexBufferView = &m_quadIndexBufferView; @@ -1008,7 +1005,7 @@ namespace AtomSampleViewer drawItem.m_streamBufferViewCount = static_cast(m_quadStreamBufferViews[ForwardScope].size()); drawItem.m_streamBufferViews = m_quadStreamBufferViews[ForwardScope].data(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } else { @@ -1022,7 +1019,6 @@ namespace AtomSampleViewer for (const auto& mesh : m_model->GetLods()[0]->GetMeshes()) { RHI::DrawItem drawItem; - drawItem.m_submitIndex = i; drawItem.m_arguments = mesh.m_drawArguments; drawItem.m_pipelineState = m_modelPipelineStates[ForwardScope].get(); drawItem.m_indexBufferView = &mesh.m_indexBufferView; @@ -1031,7 +1027,7 @@ namespace AtomSampleViewer drawItem.m_streamBufferViewCount = static_cast(m_modelStreamBufferViews[ForwardScope].size()); drawItem.m_streamBufferViews = m_modelStreamBufferViews[ForwardScope].data(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } } } diff --git a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp index 0f76e55c..95637312 100644 --- a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp +++ b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp @@ -569,7 +569,6 @@ namespace AtomSampleViewer m_bindlessSrg->GetSrg(m_floatBufferSrgName)->GetRHIShaderResourceGroup(), }; RHI::DrawItem drawItem; - drawItem.m_submitIndex = instanceIdx; drawItem.m_arguments = subMesh.m_mesh->m_drawArguments; drawItem.m_pipelineState = m_pipelineState.get(); drawItem.m_indexBufferView = &subMesh.m_mesh->m_indexBufferView; @@ -579,7 +578,7 @@ namespace AtomSampleViewer drawItem.m_streamBufferViews = subMesh.bufferStreamViewArray.data(); // Submit the triangle draw item. - commandList->Submit(drawItem); + commandList->Submit(drawItem, instanceIdx); } }; diff --git a/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp b/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp index c21daac9..f000319c 100644 --- a/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp +++ b/Gem/Code/Source/RHI/InputAssemblyExampleComponent.cpp @@ -301,9 +301,8 @@ namespace AtomSampleViewer for (uint32_t index = context.GetSubmitRange().m_startIndex; index < context.GetSubmitRange().m_endIndex; ++index) { - dispatchItem.m_submitIndex = index; dispatchItem.m_shaderResourceGroups[0] = m_dispatchSRG[index]->GetRHIShaderResourceGroup(); - commandList->Submit(dispatchItem); + commandList->Submit(dispatchItem, index); } }; @@ -408,13 +407,12 @@ namespace AtomSampleViewer for (uint32_t index = context.GetSubmitRange().m_startIndex; index < context.GetSubmitRange().m_endIndex; ++index) { - drawItem.m_submitIndex = index; drawItem.m_streamBufferViews = &m_streamBufferView[index]; RHI::ShaderResourceGroup* rhiSRGS[] = { m_drawSRG[index]->GetRHIShaderResourceGroup() }; drawItem.m_shaderResourceGroups = rhiSRGS; - commandList->Submit(drawItem); + commandList->Submit(drawItem, index); } }; diff --git a/Gem/Code/Source/RHI/MultiThreadComponent.cpp b/Gem/Code/Source/RHI/MultiThreadComponent.cpp index 1f041500..701030d5 100644 --- a/Gem/Code/Source/RHI/MultiThreadComponent.cpp +++ b/Gem/Code/Source/RHI/MultiThreadComponent.cpp @@ -329,7 +329,6 @@ namespace AtomSampleViewer const AZ::RHI::ShaderResourceGroup* shaderResourceGroups[] = { m_shaderResourceGroups[i]->GetRHIShaderResourceGroup() }; AZ::RHI::DrawItem drawItem; - drawItem.m_submitIndex = i; drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_pipelineState.get(); drawItem.m_indexBufferView = &m_indexBufferView; @@ -338,7 +337,7 @@ namespace AtomSampleViewer drawItem.m_streamBufferViewCount = static_cast(m_streamBufferViews.size()); drawItem.m_streamBufferViews = m_streamBufferViews.data(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } }; diff --git a/Gem/Code/Source/RHI/QueryExampleComponent.cpp b/Gem/Code/Source/RHI/QueryExampleComponent.cpp index 2df0d5bd..4129da92 100644 --- a/Gem/Code/Source/RHI/QueryExampleComponent.cpp +++ b/Gem/Code/Source/RHI/QueryExampleComponent.cpp @@ -478,14 +478,14 @@ namespace AtomSampleViewer if (occlusionResults) { - commandList->Submit(drawItem); + commandList->Submit(drawItem, 0); } break; } case QueryType::Predication: { commandList->BeginPredication(*m_predicationBuffer, 0, RHI::PredicationOp::EqualZero); - commandList->Submit(drawItem); + commandList->Submit(drawItem, 0); commandList->EndPredication(); break; } @@ -505,17 +505,15 @@ namespace AtomSampleViewer } // Draw occluding quad - drawItem.m_submitIndex++; shaderResourceGroups[0] = m_shaderResourceGroups[1]->GetRHIShaderResourceGroup(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, 1); // Draw quad to use for the oclussion query - drawItem.m_submitIndex++; drawItem.m_pipelineState = m_boudingBoxPipelineState.get(); shaderResourceGroups[0] = m_shaderResourceGroups[2]->GetRHIShaderResourceGroup(); auto& queryEntry = m_occlusionQueries[m_currentOcclusionQueryIndex]; queryEntry.m_query->Begin(*commandList, m_precisionOcclusionEnabled ? RHI::QueryControlFlags::PreciseOcclusion : RHI::QueryControlFlags::None); - commandList->Submit(drawItem); + commandList->Submit(drawItem, 2); queryEntry.m_query->End(*commandList); queryEntry.m_isValid = true; } diff --git a/Gem/Code/Source/RHI/StencilExampleComponent.cpp b/Gem/Code/Source/RHI/StencilExampleComponent.cpp index 9ed4224f..bfc1ca71 100644 --- a/Gem/Code/Source/RHI/StencilExampleComponent.cpp +++ b/Gem/Code/Source/RHI/StencilExampleComponent.cpp @@ -221,8 +221,6 @@ namespace AtomSampleViewer for (uint32_t i = context.GetSubmitRange().m_startIndex; i < context.GetSubmitRange().m_endIndex; ++i) { - drawItem.m_submitIndex = i; - if (i == 0) { drawIndexed.m_indexCount = s_numberOfVertices / 2; @@ -230,7 +228,7 @@ namespace AtomSampleViewer // Draw color triangles drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_pipelineStateBasePass.get(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); } else { @@ -241,7 +239,7 @@ namespace AtomSampleViewer drawItem.m_arguments = drawIndexed; drawItem.m_pipelineState = m_pipelineStateStencil[i-1].get(); - commandList->Submit(drawItem); + commandList->Submit(drawItem, i); drawIndexed.m_indexOffset += 3; } From eef03a872b475904f3b624aec066c21aa248feb4 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:19:49 -0700 Subject: [PATCH 67/81] Matching pass name to name used for ImGui lookup, which fixes imgui for ShaderReloadTestComponent Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- Gem/Code/Source/ShaderReloadTestComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/ShaderReloadTestComponent.cpp b/Gem/Code/Source/ShaderReloadTestComponent.cpp index 95d4ddfc..27652cfb 100644 --- a/Gem/Code/Source/ShaderReloadTestComponent.cpp +++ b/Gem/Code/Source/ShaderReloadTestComponent.cpp @@ -200,7 +200,7 @@ namespace AtomSampleViewer m_scene->RemoveRenderPipeline(m_originalPipeline->GetId()); // add the checker board pipeline - const AZStd::string pipelineName("Fullscreen"); + const AZStd::string pipelineName("FullscreenPipeline"); AZ::RPI::RenderPipelineDescriptor pipelineDesc; pipelineDesc.m_mainViewTagName = "MainCamera"; pipelineDesc.m_name = pipelineName; From 4952eb262e888c15ad00cba542933b3b293b4ebb Mon Sep 17 00:00:00 2001 From: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:23:12 -0700 Subject: [PATCH 68/81] Update ASV material versions so warnings should be gone (#484) Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> --- Materials/Decal/airship_nose_number_decal.material | 4 ++-- Materials/Decal/airship_symbol_decal.material | 4 ++-- Materials/Decal/airship_tail_01_decal.material | 4 ++-- Materials/Decal/airship_tail_02_decal.material | 4 ++-- Materials/Decal/am_mud_decal.material | 4 ++-- Materials/Decal/am_road_dust_decal.material | 4 ++-- Materials/Decal/brushstoke_01_decal.material | 4 ++-- Materials/Decal/scorch_01_decal.material | 4 ++-- Materials/DefaultPBR.material | 2 +- Materials/DefaultPBRTransparent.material | 2 +- Materials/DiffuseGIExample/blue.material | 4 ++-- Materials/DiffuseGIExample/green.material | 4 ++-- Materials/DiffuseGIExample/red.material | 4 ++-- Materials/DiffuseGIExample/white.material | 4 ++-- Materials/DiffuseGIExample/yellow.material | 4 ++-- .../TestData/VariantSelection_FullyBaked.material | 4 ++-- .../HotReloadTest/TestData/VariantSelection_Root.material | 4 ++-- Materials/SSRExample/Cube.material | 2 +- Materials/SSRExample/GroundPlaneAluminum.material | 2 +- Materials/SSRExample/GroundPlaneChrome.material | 2 +- Materials/SSRExample/GroundPlaneMirror.material | 2 +- Materials/SSRExample/GroundPlaneWood.material | 2 +- Materials/SSRExample/ShaderBall.material | 4 ++-- Materials/TransparentDoubleSide.material | 4 ++-- 24 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Materials/Decal/airship_nose_number_decal.material b/Materials/Decal/airship_nose_number_decal.material index 5d8cf0a0..eb5ccb2e 100644 --- a/Materials/Decal/airship_nose_number_decal.material +++ b/Materials/Decal/airship_nose_number_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/airship_nose_number_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/airship_nose_number_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/airship_nose_number_decal.tif", diff --git a/Materials/Decal/airship_symbol_decal.material b/Materials/Decal/airship_symbol_decal.material index 015b1f6a..ad87e988 100644 --- a/Materials/Decal/airship_symbol_decal.material +++ b/Materials/Decal/airship_symbol_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/airship_symbol_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/airship_symbol_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/airship_symbol_decal.tif", diff --git a/Materials/Decal/airship_tail_01_decal.material b/Materials/Decal/airship_tail_01_decal.material index ca8a93cd..6062037c 100644 --- a/Materials/Decal/airship_tail_01_decal.material +++ b/Materials/Decal/airship_tail_01_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/airship_tail_01_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/airship_tail_01_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/airship_tail_01_decal_nrm.tif", diff --git a/Materials/Decal/airship_tail_02_decal.material b/Materials/Decal/airship_tail_02_decal.material index 2cc0af69..c6706dde 100644 --- a/Materials/Decal/airship_tail_02_decal.material +++ b/Materials/Decal/airship_tail_02_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/airship_tail_02_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/airship_tail_02_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/airship_tail_02_decal.tif", diff --git a/Materials/Decal/am_mud_decal.material b/Materials/Decal/am_mud_decal.material index 08781d80..f409111d 100644 --- a/Materials/Decal/am_mud_decal.material +++ b/Materials/Decal/am_mud_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/am_mud_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/am_mud_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/am_mud_decal.tif", diff --git a/Materials/Decal/am_road_dust_decal.material b/Materials/Decal/am_road_dust_decal.material index 4153e961..6a4bf027 100644 --- a/Materials/Decal/am_road_dust_decal.material +++ b/Materials/Decal/am_road_dust_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/am_road_dust_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/am_road_dust_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/am_road_dust_decal.tif", diff --git a/Materials/Decal/brushstoke_01_decal.material b/Materials/Decal/brushstoke_01_decal.material index 8bda9f15..5990ba38 100644 --- a/Materials/Decal/brushstoke_01_decal.material +++ b/Materials/Decal/brushstoke_01_decal.material @@ -1,13 +1,13 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/brushstoke_01_decal.tif", "general.applySpecularAA": false, + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/brushstoke_01_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/brushstoke_01_decal.tif", diff --git a/Materials/Decal/scorch_01_decal.material b/Materials/Decal/scorch_01_decal.material index a1407435..5e0a2168 100644 --- a/Materials/Decal/scorch_01_decal.material +++ b/Materials/Decal/scorch_01_decal.material @@ -1,12 +1,12 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/Decal/scorch_01_decal.tif", + "general.doubleSided": true, "metallic.useTexture": false, "normal.textureMap": "Materials/Decal/scorch_01_decal_nrm.tif", "opacity.alphaSource": "Split", - "opacity.doubleSided": true, "opacity.factor": 0.6899999976158142, "opacity.mode": "Cutout", "opacity.textureMap": "Materials/Decal/scorch_01_decal.tif", diff --git a/Materials/DefaultPBR.material b/Materials/DefaultPBR.material index 1c1257ec..f9cec717 100644 --- a/Materials/DefaultPBR.material +++ b/Materials/DefaultPBR.material @@ -1,5 +1,5 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "parentMaterial": "Materials/Presets/PBR/default_grid.material" } \ No newline at end of file diff --git a/Materials/DefaultPBRTransparent.material b/Materials/DefaultPBRTransparent.material index 9a0c3ba3..f7866212 100644 --- a/Materials/DefaultPBRTransparent.material +++ b/Materials/DefaultPBRTransparent.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "parentMaterial": "Materials/Presets/PBR/default_grid.material", "propertyValues": { "opacity.mode": "Blended" diff --git a/Materials/DiffuseGIExample/blue.material b/Materials/DiffuseGIExample/blue.material index 7ae465c3..708cadde 100644 --- a/Materials/DiffuseGIExample/blue.material +++ b/Materials/DiffuseGIExample/blue.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 0.0, 0.0, 1.0, diff --git a/Materials/DiffuseGIExample/green.material b/Materials/DiffuseGIExample/green.material index c4d0e039..679d8703 100644 --- a/Materials/DiffuseGIExample/green.material +++ b/Materials/DiffuseGIExample/green.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 0.0, 1.0, 0.0, diff --git a/Materials/DiffuseGIExample/red.material b/Materials/DiffuseGIExample/red.material index 50d83f70..6bc39f61 100644 --- a/Materials/DiffuseGIExample/red.material +++ b/Materials/DiffuseGIExample/red.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 1.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 1.0, 0.0, 0.0, diff --git a/Materials/DiffuseGIExample/white.material b/Materials/DiffuseGIExample/white.material index f2b52266..ebaf08b1 100644 --- a/Materials/DiffuseGIExample/white.material +++ b/Materials/DiffuseGIExample/white.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 1.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 1.0, 1.0, 1.0, diff --git a/Materials/DiffuseGIExample/yellow.material b/Materials/DiffuseGIExample/yellow.material index e3cc9ac3..eeadf193 100644 --- a/Materials/DiffuseGIExample/yellow.material +++ b/Materials/DiffuseGIExample/yellow.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 1.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 1.0, 1.0, 0.0, diff --git a/Materials/HotReloadTest/TestData/VariantSelection_FullyBaked.material b/Materials/HotReloadTest/TestData/VariantSelection_FullyBaked.material index 1c97e9d0..06197d59 100644 --- a/Materials/HotReloadTest/TestData/VariantSelection_FullyBaked.material +++ b/Materials/HotReloadTest/TestData/VariantSelection_FullyBaked.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.0, @@ -17,6 +17,6 @@ "emissive.enable": true, "emissive.intensity": 3.0, "emissive.textureMap": "Materials/HotReloadTest/TestData/VariantSelection_FullyBaked.png", - "opacity.doubleSided": true + "general.doubleSided": true } } \ No newline at end of file diff --git a/Materials/HotReloadTest/TestData/VariantSelection_Root.material b/Materials/HotReloadTest/TestData/VariantSelection_Root.material index 482927db..e1638247 100644 --- a/Materials/HotReloadTest/TestData/VariantSelection_Root.material +++ b/Materials/HotReloadTest/TestData/VariantSelection_Root.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.0, @@ -16,6 +16,6 @@ ], "emissive.enable": true, "emissive.textureMap": "Materials/HotReloadTest/TestData/VariantSelection_Root.png", - "opacity.doubleSided": true + "general.doubleSided": true } } \ No newline at end of file diff --git a/Materials/SSRExample/Cube.material b/Materials/SSRExample/Cube.material index 5074bd4b..6623a26f 100644 --- a/Materials/SSRExample/Cube.material +++ b/Materials/SSRExample/Cube.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 1.0, diff --git a/Materials/SSRExample/GroundPlaneAluminum.material b/Materials/SSRExample/GroundPlaneAluminum.material index 1ee8a43f..90573d61 100644 --- a/Materials/SSRExample/GroundPlaneAluminum.material +++ b/Materials/SSRExample/GroundPlaneAluminum.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.9130998849868774, diff --git a/Materials/SSRExample/GroundPlaneChrome.material b/Materials/SSRExample/GroundPlaneChrome.material index 8892d56b..ba21b4a9 100644 --- a/Materials/SSRExample/GroundPlaneChrome.material +++ b/Materials/SSRExample/GroundPlaneChrome.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.5529412031173706, diff --git a/Materials/SSRExample/GroundPlaneMirror.material b/Materials/SSRExample/GroundPlaneMirror.material index 5308cb5d..55ed5905 100644 --- a/Materials/SSRExample/GroundPlaneMirror.material +++ b/Materials/SSRExample/GroundPlaneMirror.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 1.0, diff --git a/Materials/SSRExample/GroundPlaneWood.material b/Materials/SSRExample/GroundPlaneWood.material index d0544510..7d0df2c2 100644 --- a/Materials/SSRExample/GroundPlaneWood.material +++ b/Materials/SSRExample/GroundPlaneWood.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.textureMap": "Materials/SSRExample/wood_planks_512_diff.tif", "metallic.factor": 0.0, diff --git a/Materials/SSRExample/ShaderBall.material b/Materials/SSRExample/ShaderBall.material index af59ecf1..cadfc3c7 100644 --- a/Materials/SSRExample/ShaderBall.material +++ b/Materials/SSRExample/ShaderBall.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "propertyValues": { "baseColor.color": [ 0.0, @@ -9,7 +9,7 @@ 1.0 ], "baseColor.useTexture": false, - "irradiance.color": [ + "irradiance.manualColor": [ 0.0, 0.0, 1.0, diff --git a/Materials/TransparentDoubleSide.material b/Materials/TransparentDoubleSide.material index 887bda20..38da9d97 100644 --- a/Materials/TransparentDoubleSide.material +++ b/Materials/TransparentDoubleSide.material @@ -1,9 +1,9 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 3, + "materialTypeVersion": 5, "parentMaterial": "Materials/Presets/PBR/default_grid.material", "propertyValues": { - "opacity.doubleSided": true, + "general.doubleSided": true, "opacity.mode": "Blended" } } \ No newline at end of file From 5811bb7fbb78df3632e6b05edb204a73cd41692d Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 10 Aug 2022 13:08:56 -0500 Subject: [PATCH 69/81] Scene reset and multiscene fixes Fixes the multi-scene example component using the wrong name for requesting the reflection probe feature processor. Also fixes ResetScene() so it actually gets the new scene instead of holding onto a possibly stale pointer. Signed-off-by: Ken Pruiksma --- Gem/Code/Source/CommonSampleComponentBase.cpp | 1 + Gem/Code/Source/MultiSceneExampleComponent.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Gem/Code/Source/CommonSampleComponentBase.cpp b/Gem/Code/Source/CommonSampleComponentBase.cpp index 4ce45c9a..9e4234ce 100644 --- a/Gem/Code/Source/CommonSampleComponentBase.cpp +++ b/Gem/Code/Source/CommonSampleComponentBase.cpp @@ -307,6 +307,7 @@ namespace AtomSampleViewer void CommonSampleComponentBase::ResetScene() { m_meshFeatureProcessor = nullptr; + m_scene = RPI::RPISystemInterface::Get()->GetSceneByName(AZ::Name("RPI")); } } // namespace AtomSampleViewer diff --git a/Gem/Code/Source/MultiSceneExampleComponent.cpp b/Gem/Code/Source/MultiSceneExampleComponent.cpp index 16e59768..b75e85f6 100644 --- a/Gem/Code/Source/MultiSceneExampleComponent.cpp +++ b/Gem/Code/Source/MultiSceneExampleComponent.cpp @@ -82,7 +82,7 @@ namespace AtomSampleViewer sceneDesc.m_featureProcessorNames.push_back("AZ::Render::PointLightFeatureProcessor"); sceneDesc.m_featureProcessorNames.push_back("AZ::Render::PostProcessFeatureProcessor"); sceneDesc.m_featureProcessorNames.push_back("AZ::Render::QuadLightFeatureProcessor"); - sceneDesc.m_featureProcessorNames.push_back("ReflectionProbeFeatureProcessor"); + sceneDesc.m_featureProcessorNames.push_back("AZ::Render::ReflectionProbeFeatureProcessor"); sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SkyBoxFeatureProcessor"); sceneDesc.m_featureProcessorNames.push_back("AZ::Render::TransformServiceFeatureProcessor"); sceneDesc.m_featureProcessorNames.push_back("AZ::Render::ProjectedShadowFeatureProcessor"); From 58c82018b6b44b92d5f1732e14737908432d5963 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 11 Aug 2022 15:49:22 -0500 Subject: [PATCH 70/81] Fix aux geom feature processor in rhi samples. The rtti for aux geom was updated to include the namespace (which is standard) so this place needs to be updated to reference that namespace as well. Signed-off-by: Ken Pruiksma --- Gem/Code/Source/SampleComponentManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index 08680b3e..a868d467 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -1546,7 +1546,7 @@ namespace AtomSampleViewer // Create and register the rhi scene with only feature processors required for AtomShimRenderer (only for AtomSampleViewerLauncher) RPI::SceneDescriptor sceneDesc; sceneDesc.m_nameId = AZ::Name("RHI"); - sceneDesc.m_featureProcessorNames.push_back("AuxGeomFeatureProcessor"); + sceneDesc.m_featureProcessorNames.push_back("AZ::Render::AuxGeomFeatureProcessor"); m_rhiScene = RPI::Scene::CreateScene(sceneDesc); m_rhiScene->Activate(); From 0a97e27b0afec5dc38d02a5de2eee058d46d3a9f Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Thu, 11 Aug 2022 17:17:43 -0500 Subject: [PATCH 71/81] add settings registry query functionality to asv lua (#489) * Add SettingsRegistry BehaviorContext reflection plus add some test scripts Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Remove some debug #pragma's Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Delete test script Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 2 + Scripts/frametime.sa.lua | 81 ++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 Scripts/frametime.sa.lua diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index 0271b624..bf052a31 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -1058,6 +1059,7 @@ namespace AtomSampleViewer void ScriptManager::ReflectScriptContext(AZ::BehaviorContext* behaviorContext) { AZ::MathReflect(behaviorContext); + AZ::SettingsRegistryScriptUtils::ReflectSettingsRegistryToBehaviorContext(*behaviorContext); // Utilities... behaviorContext->Method("RunScript", &Script_RunScript); diff --git a/Scripts/frametime.sa.lua b/Scripts/frametime.sa.lua new file mode 100644 index 00000000..cd9401c5 --- /dev/null +++ b/Scripts/frametime.sa.lua @@ -0,0 +1,81 @@ +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- +-- values provided by the runtime +local ProjectUserPath = "/O3DE/Runtime/FilePaths/SourceProjectUserPath" + +-- optional settings +local AssetLoadFrameIdleCountRegistryKey = "/O3DE/ScriptAutomation/FrameTime/AssetFrameIdleCount" +local FrameIdleCountRegistryKey = "/O3DE/ScriptAutomation/FrameTime/IdleCount" +local FrameCaptureCountRegistryKey = "/O3DE/ScriptAutomation/FrameTime/CaptureCount" +local ViewportWidthRegistryKey = "/O3DE/ScriptAutomation/FrameTime/ViewportWidth" +local ViewportHeightRegistryKey = "/O3DE/ScriptAutomation/FrameTime/ViewportHeight" +local ProfileOutputPathKey = "/O3DE/ScriptAutomation/FrameTime/OutputPath" + +-- required settings +local ProfileNameRegistryKey = "/O3DE/ScriptAutomation/FrameTime/ProfileName" + +IdleFrames(100) -- wait for assets to load into the level + +function GetRequiredStringValue(valueKey, prettyName) + value = g_SettingsRegistry:GetString(valueKey) + if (not value:has_value()) then + Print('FrameTime script missing ' .. tostring(prettyName) .. ' settings registry entry, ending script early') + return false, nil + end + return true, value:value() +end + +function GetOptionalUIntValue(valueKey, defaultValue) + return g_SettingsRegistry:GetUInt(valueKey):value_or(defaultValue) +end +function GetOptionalStringValue(valueKey, defaultValue) + return g_SettingsRegistry:GetString(valueKey):value_or(defaultValue) +end + +-- default values +DEFAULT_ASSET_LOAD_FRAME_WAIT_COUNT = 100 +DEFAULT_IDLE_COUNT = 100 +DEFAULT_FRAME_COUNT = 100 +DEFAULT_VIEWPORT_WIDTH = 800 +DEFAULT_VIEWPORT_HEIGHT = 600 +DEFAULT_OUTPUT_PATH = "ScriptAutomation/Profiling" + +-- check for SettingsRegistry values that must exist +succeeded, userFolderPath = GetRequiredStringValue(ProjectUserPath, "Project User Path") +if (not succeeded) then return end +succeeded, profileName = GetRequiredStringValue(ProfileNameRegistryKey, "Profile Name") +if (not succeeded) then return end + +-- read optional SettingsRegistry values +local assetLoadIdleFrameCount = GetOptionalUIntValue(AssetLoadFrameIdleCountRegistryKey, DEFAULT_ASSET_LOAD_FRAME_WAIT_COUNT) +local frameIdleCount = GetOptionalUIntValue(FrameIdleCountRegistryKey, DEFAULT_IDLE_COUNT) +local frameCaptureCount = GetOptionalUIntValue(FrameCaptureCountRegistryKey, DEFAULT_FRAME_COUNT) +local viewportWidth = GetOptionalUIntValue(ViewportWidthRegistryKey, DEFAULT_VIEWPORT_WIDTH) +local viewportHeight = GetOptionalUIntValue(ViewportHeightRegistryKey, DEFAULT_VIEWPORT_HEIGHT) +local outputPath = GetOptionalStringValue(ProfileOutputPathKey, DEFAULT_OUTPUT_PATH) + +-- get the output folder path +g_profileOutputFolder = userFolderPath .. "/" .. tostring(outputPath) .. "/" .. tostring(profileName) +Print('Saving profile data to ' .. NormalizePath(g_profileOutputFolder)) + +-- Begin script execution +ResizeViewport(viewportWidth, viewportHeight) +ExecuteConsoleCommand("r_displayInfo=0") + +CaptureBenchmarkMetadata(tostring(profileName), g_profileOutputFolder .. '/benchmark_metadata.json') +Print('Idling for ' .. tostring(frameIdleCount) .. ' frames..') +IdleFrames(frameIdleCount) +Print('Capturing timestamps for ' .. tostring(frameCaptureCount) .. ' frames...') +for i = 1,frameCaptureCount do + cpu_timings = g_profileOutputFolder .. '/cpu_frame' .. tostring(i) .. '_time.json' + CaptureCpuFrameTime(cpu_timings) +end +Print('Capturing complete.') From 99963eda16ca31af97b846951edcb468b01db620 Mon Sep 17 00:00:00 2001 From: Bindless-Chicken <1039134+Bindless-Chicken@users.noreply.github.com> Date: Thu, 16 Jun 2022 09:31:39 +0100 Subject: [PATCH 72/81] Fix target blend state name Signed-off-by: Bindless-Chicken <1039134+Bindless-Chicken@users.noreply.github.com> --- Materials/HotReloadTest/TestData/Shader_BlendingOff.txt | 2 +- Materials/HotReloadTest/TestData/Shader_BlendingOn.txt | 2 +- Shaders/DynamicDraw/DynamicDrawExample.shader | 2 +- Shaders/Readback/Filler.shader | 2 +- Shaders/Readback/Preview.shader | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Materials/HotReloadTest/TestData/Shader_BlendingOff.txt b/Materials/HotReloadTest/TestData/Shader_BlendingOff.txt index 45fb0e61..155ab08b 100644 --- a/Materials/HotReloadTest/TestData/Shader_BlendingOff.txt +++ b/Materials/HotReloadTest/TestData/Shader_BlendingOff.txt @@ -8,7 +8,7 @@ } }, - "BlendState": { + "GlobalTargetBlendState": { "Enable": false, "BlendSource": "AlphaSource", "BlendDest": "AlphaSourceInverse", diff --git a/Materials/HotReloadTest/TestData/Shader_BlendingOn.txt b/Materials/HotReloadTest/TestData/Shader_BlendingOn.txt index b8b51ee7..08556266 100644 --- a/Materials/HotReloadTest/TestData/Shader_BlendingOn.txt +++ b/Materials/HotReloadTest/TestData/Shader_BlendingOn.txt @@ -8,7 +8,7 @@ } }, - "BlendState": { + "GlobalTargetBlendState": { "Enable": true, "BlendSource": "AlphaSource", "BlendDest": "AlphaSourceInverse", diff --git a/Shaders/DynamicDraw/DynamicDrawExample.shader b/Shaders/DynamicDraw/DynamicDrawExample.shader index 08e2bbd0..e1cd4846 100644 --- a/Shaders/DynamicDraw/DynamicDrawExample.shader +++ b/Shaders/DynamicDraw/DynamicDrawExample.shader @@ -13,7 +13,7 @@ "CullMode" : "None" }, - "BlendState" : { + "GlobalTargetBlendState" : { "Enable" : true, "BlendSource" : "One", "BlendDest" : "AlphaSourceInverse", diff --git a/Shaders/Readback/Filler.shader b/Shaders/Readback/Filler.shader index d6878016..a014aeb2 100644 --- a/Shaders/Readback/Filler.shader +++ b/Shaders/Readback/Filler.shader @@ -11,7 +11,7 @@ "DepthClipEnable" : false }, - "BlendState" : { + "GlobalTargetBlendState" : { "Enable" : false }, diff --git a/Shaders/Readback/Preview.shader b/Shaders/Readback/Preview.shader index a1cea3d0..a5b348ae 100644 --- a/Shaders/Readback/Preview.shader +++ b/Shaders/Readback/Preview.shader @@ -11,7 +11,7 @@ "DepthClipEnable" : false }, - "BlendState" : { + "GlobalTargetBlendState" : { "Enable" : false }, From 6dbfd3d91729a0d25986bd088a3961db15d7789b Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 15 Aug 2022 20:42:47 -0500 Subject: [PATCH 73/81] Changed the construction of divider string for the ImGuiShaderUtils. (#493) It was using curly braces, now it is using parenthesis. It was causing a compilation on a developers machine. ``` D:/github/AtomSampleViewer/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp(32,46): error C2398: Element '1': conversion from 'unsigned __int64' to '_Elem' requires a narrowing conversion 3> with 3> [ 3> _Elem=char 3> ] 3> AZStd::string divider{header.size(), '-'}; 3> ^ 3>D:/github/AtomSampleViewer/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp(32,53): warning C4267: 'initializing': conversion from 'size_t' to '_Elem', possible loss of data 3> with 3> [ 3> _Elem=char 3> ] 3> AZStd::string divider{header.size(), '-'}; ``` Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gem/Code/Source/Utils/ImGuiShaderUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp b/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp index 1cfc53a5..7e36d8bb 100644 --- a/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp +++ b/Gem/Code/Source/Utils/ImGuiShaderUtils.cpp @@ -29,7 +29,7 @@ namespace AtomSampleViewer } AZStd::string header = AZStd::string::format("%-*s | Bits | Requested | Selected", longestOptionNameLength, "Option Name"); - AZStd::string divider{header.size(), '-'}; + AZStd::string divider(header.size(), '-'); ImGui::Text("%s", header.c_str()); ImGui::Text("%s", divider.c_str()); From e7f176a846908f2eebfa6daefb47743e32634b02 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:15:34 -0700 Subject: [PATCH 74/81] Remove shader metrics menu for ASV (#494) Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Co-authored-by: Tobias Alexander Franke --- Gem/Code/Source/SampleComponentManager.cpp | 15 --------------- Gem/Code/Source/SampleComponentManager.h | 3 --- 2 files changed, 18 deletions(-) diff --git a/Gem/Code/Source/SampleComponentManager.cpp b/Gem/Code/Source/SampleComponentManager.cpp index a868d467..19d054e0 100644 --- a/Gem/Code/Source/SampleComponentManager.cpp +++ b/Gem/Code/Source/SampleComponentManager.cpp @@ -847,11 +847,6 @@ namespace AtomSampleViewer ShowTransientAttachmentProfilerWindow(); } - if (m_showShaderMetrics) - { - ShowShaderMetricsWindow(); - } - m_scriptManager->TickImGui(); m_contentWarningDialog.TickPopup(); @@ -913,11 +908,6 @@ namespace AtomSampleViewer m_showFrameGraphVisualizer = !m_showFrameGraphVisualizer; } - if (ImGui::MenuItem("Shader Metrics")) - { - m_showShaderMetrics = !m_showShaderMetrics; - } - ImGui::EndMenu(); } if (ImGui::BeginMenu("Samples")) @@ -1157,11 +1147,6 @@ namespace AtomSampleViewer } } - void SampleComponentManager::ShowShaderMetricsWindow() - { - m_imguiShaderMetrics.Draw(m_showShaderMetrics, AZ::RPI::ShaderMetricsSystemInterface::Get()->GetMetrics()); - } - void SampleComponentManager::ShowResizeViewportDialog() { static int size[2] = { 0, 0 }; diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index fe28a7b1..eca6e8b0 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -142,7 +142,6 @@ namespace AtomSampleViewer void ShowCpuProfilerWindow(); void ShowGpuProfilerWindow(); void ShowFileIoProfilerWindow(); - void ShowShaderMetricsWindow(); void ShowTransientAttachmentProfilerWindow(); void RequestExit(); @@ -221,7 +220,6 @@ namespace AtomSampleViewer bool m_showGpuProfiler = false; bool m_showFileIoProfiler = false; bool m_showTransientAttachmentProfiler = false; - bool m_showShaderMetrics = false; bool m_ctrlModifierLDown = false; bool m_ctrlModifierRDown = false; @@ -245,7 +243,6 @@ namespace AtomSampleViewer AZ::Render::ImGuiFrameVisualizer m_imguiFrameGraphVisualizer; AZ::Render::ImGuiGpuProfiler m_imguiGpuProfiler; AZ::Render::ImGuiTransientAttachmentProfiler m_imguiTransientAttachmentProfiler; - AZ::Render::ImGuiShaderMetrics m_imguiShaderMetrics; ImGuiSaveFilePath m_imguiFrameCaptureSaver; bool m_isFrameCapturePending = false; From 518fc6da59604c108798eea4b61b372959720f46 Mon Sep 17 00:00:00 2001 From: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Date: Tue, 16 Aug 2022 17:52:44 -0700 Subject: [PATCH 75/81] Fix the 15th screenshot having root variant instead of fully baked (#492) Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> --- Scripts/MaterialHotReloadTest.bv.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index 17aa0484..45e5bef5 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -156,9 +156,10 @@ CaptureScreenshot(g_screenshotOutputFolder .. '/14_HorizontalPattern.png') -- Test a specific scenario that was failing, where color changes fail to reload after making a shader change. SetBlendingOn() +IdleForReload() SetBlendingOff() +IdleForReload() SetColorRed() -IdleSeconds(4.0) IdleForReload() CaptureScreenshot(g_screenshotOutputFolder .. '/15_Red_AfterShaderReload.png') From ed962c5513322871571d788859e046ed9e424197 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 17 Aug 2022 02:36:20 -0500 Subject: [PATCH 76/81] Removing include paths to ImguiShaderMetrics which was removed. (#495) Signed-off-by: Ken Pruiksma --- Gem/Code/Source/AtomSampleViewerSystemComponent.cpp | 1 - Gem/Code/Source/SampleComponentManager.h | 1 - 2 files changed, 2 deletions(-) diff --git a/Gem/Code/Source/AtomSampleViewerSystemComponent.cpp b/Gem/Code/Source/AtomSampleViewerSystemComponent.cpp index 6e2936c3..7300fd3c 100644 --- a/Gem/Code/Source/AtomSampleViewerSystemComponent.cpp +++ b/Gem/Code/Source/AtomSampleViewerSystemComponent.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/Gem/Code/Source/SampleComponentManager.h b/Gem/Code/Source/SampleComponentManager.h index eca6e8b0..6f26c7bf 100644 --- a/Gem/Code/Source/SampleComponentManager.h +++ b/Gem/Code/Source/SampleComponentManager.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include From 8ad71acb4453369e8ba8414183cb1f53cee5fe92 Mon Sep 17 00:00:00 2001 From: jhmueller-huawei <101700150+jhmueller-huawei@users.noreply.github.com> Date: Mon, 22 Aug 2022 21:41:03 +0200 Subject: [PATCH 77/81] Fixed a unused variable compilation error. (#472) Happens with clang and gcc (on at least linux). Signed-off-by: Joerg H. Mueller Signed-off-by: Joerg H. Mueller --- .../Source/RHI/BindlessPrototypeExampleComponent.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp index 95637312..12e61a58 100644 --- a/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp +++ b/Gem/Code/Source/RHI/BindlessPrototypeExampleComponent.cpp @@ -666,11 +666,15 @@ namespace AtomSampleViewer // Update the worldToClipMatrix Matrix4x4 worldToClipMatrix = m_viewToClipMatrix * worldToViewMatrix; - bool set = m_floatBuffer->AllocateOrUpdateBuffer(m_worldToClipHandle, static_cast(&worldToClipMatrix), static_cast(sizeof(Matrix4x4))); - + m_floatBuffer->AllocateOrUpdateBuffer(m_worldToClipHandle, + static_cast(&worldToClipMatrix), + static_cast(sizeof(Matrix4x4))); + // Update the light direction - set = m_floatBuffer->AllocateOrUpdateBuffer(m_lightDirectionHandle, static_cast(&m_lightDir), static_cast(sizeof(Vector3))); - + m_floatBuffer->AllocateOrUpdateBuffer(m_lightDirectionHandle, + static_cast(&m_lightDir), + static_cast(sizeof(Vector3))); + BasicRHIComponent::OnFramePrepare(frameGraphBuilder); } From 0ac705842220dc74a02c63b32dbe93b1d96f0d88 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 23 Aug 2022 14:51:22 -0700 Subject: [PATCH 78/81] adjusting the timeout duration of the ASV suite job which has consistently timed out Signed-off-by: Scott Murray --- Standalone/PythonTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standalone/PythonTests/CMakeLists.txt b/Standalone/PythonTests/CMakeLists.txt index cafa73d9..3ea5cd0b 100644 --- a/Standalone/PythonTests/CMakeLists.txt +++ b/Standalone/PythonTests/CMakeLists.txt @@ -17,7 +17,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED) TEST_REQUIRES gpu TEST_SUITE main TEST_SERIAL - TIMEOUT 1200 + TIMEOUT 2400 RUNTIME_DEPENDENCIES AssetProcessor AssetProcessorBatch From 91f9667064378fed37753b4bf11559cceb153f02 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 23 Aug 2022 16:49:14 -0700 Subject: [PATCH 79/81] time-out 1500 appears to be the limit Signed-off-by: Scott Murray --- Standalone/PythonTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standalone/PythonTests/CMakeLists.txt b/Standalone/PythonTests/CMakeLists.txt index 3ea5cd0b..26a9ed22 100644 --- a/Standalone/PythonTests/CMakeLists.txt +++ b/Standalone/PythonTests/CMakeLists.txt @@ -17,7 +17,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED) TEST_REQUIRES gpu TEST_SUITE main TEST_SERIAL - TIMEOUT 2400 + TIMEOUT 1500 RUNTIME_DEPENDENCIES AssetProcessor AssetProcessorBatch From 6634711124b09765b1df5b4db1f0aa66ea001742 Mon Sep 17 00:00:00 2001 From: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Date: Fri, 26 Aug 2022 11:39:34 -0700 Subject: [PATCH 80/81] Screenshots stored from nightly Jenkins ASV "Test GPU Profile" only contain Vulkan versions, not DX12 versions (#496) * Add suffix to screenshot file name Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Update screenshot scripts Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Remove duplicated function Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Change to add the env info to a folder instead of the file name Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Optimize code Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptManager.cpp | 19 ++++++++----- Gem/Code/Source/Automation/ScriptManager.h | 6 +++- Gem/Code/Source/Automation/ScriptReporter.cpp | 28 ++++++++++++------- Gem/Code/Source/Automation/ScriptReporter.h | 6 ++-- Scripts/AreaLightTest.bv.lua | 4 ++- Scripts/AuxGeom.bv.lua | 4 ++- Scripts/CheckerboardTest.bv.lua | 4 ++- Scripts/CullingAndLod.bv.lua | 4 ++- Scripts/Decals.bv.lua | 4 ++- Scripts/DepthOfFieldTest.bv.lua | 4 ++- Scripts/DiffuseGITest.bv.lua | 4 ++- Scripts/DynamicDraw.bv.lua | 4 ++- Scripts/DynamicMaterialTest.bv.lua | 4 ++- Scripts/ExposureTest.bv.lua | 4 ++- Scripts/EyeMaterialTest.bv.lua | 15 +++++++++- Scripts/LightCulling.bv.lua | 4 ++- Scripts/MSAA_RPI_Test.bv.lua | 4 ++- Scripts/MaterialHotReloadTest.bv.lua | 4 ++- Scripts/MaterialScreenshotTests.bv.lua | 13 +++++---- Scripts/MultiRenderPipeline.bv.lua | 4 ++- Scripts/MultiScene.bv.lua | 4 ++- Scripts/ParallaxDepthArtifacts.bv.lua | 4 ++- Scripts/ParallaxTest.bv.lua | 4 ++- Scripts/PassTree.bv.lua | 4 ++- Scripts/ReadbackTest.bv.lua | 4 ++- Scripts/RenderTargetTexture.bv.lua | 4 ++- Scripts/SceneReloadSoakTest.bv.lua | 4 ++- Scripts/ShaderReloadSoakTest.bv.lua | 2 ++ Scripts/ShadowTest.bv.lua | 6 ++-- Scripts/ShadowedSponzaTest.bv.lua | 4 ++- Scripts/SkinnedMesh.bv.lua | 4 ++- Scripts/StreamingImageTest.bv.lua | 4 ++- Scripts/TestEnvironment.lua | 8 ++++++ Scripts/TransparentTest.bv.lua | 4 ++- atomsampleviewer_asset_files.cmake | 1 + 35 files changed, 150 insertions(+), 54 deletions(-) create mode 100644 Scripts/TestEnvironment.lua diff --git a/Gem/Code/Source/Automation/ScriptManager.cpp b/Gem/Code/Source/Automation/ScriptManager.cpp index bf052a31..d9219ba3 100644 --- a/Gem/Code/Source/Automation/ScriptManager.cpp +++ b/Gem/Code/Source/Automation/ScriptManager.cpp @@ -1089,6 +1089,7 @@ namespace AtomSampleViewer behaviorContext->Method("ShowTool", &Script_ShowTool); // Screenshots... + behaviorContext->Method("SetTestEnvPath", &Script_SetTestEnvPath); behaviorContext->Method("SelectImageComparisonToleranceLevel", &Script_SelectImageComparisonToleranceLevel); behaviorContext->Method("CaptureScreenshot", &Script_CaptureScreenshot); behaviorContext->Method("CaptureScreenshotWithImGui", &Script_CaptureScreenshotWithImGui); @@ -1405,9 +1406,8 @@ namespace AtomSampleViewer s_instance->m_scriptOperations.push(AZStd::move(operation)); } - bool ScriptManager::PrepareForScreenCapture(const AZStd::string& path) + bool ScriptManager::PrepareForScreenCapture(const AZStd::string& path, const AZStd::string& envPath) { - if (!Utils::IsFileUnderFolder(Utils::ResolvePath(path), ScreenshotPaths::GetScreenshotsFolder(true))) { // The main reason we require screenshots to be in a specific folder is to ensure we don't delete or replace some other important file. @@ -1425,7 +1425,7 @@ namespace AtomSampleViewer return false; } - s_instance->m_scriptReporter.AddScreenshotTest(path); + s_instance->m_scriptReporter.AddScreenshotTest(path, envPath); s_instance->m_isCapturePending = true; s_instance->AZ::Render::FrameCaptureNotificationBus::Handler::BusConnect(); @@ -1434,6 +1434,11 @@ namespace AtomSampleViewer return true; } + void ScriptManager::Script_SetTestEnvPath(const AZStd::string& envPath) + { + s_instance->m_envPath = envPath; + } + void ScriptManager::Script_SelectImageComparisonToleranceLevel(const AZStd::string& presetName) { auto operation = [presetName]() @@ -1451,7 +1456,7 @@ namespace AtomSampleViewer auto operation = [filePath]() { // Note this will pause the script until the capture is complete - if (PrepareForScreenCapture(filePath)) + if (PrepareForScreenCapture(filePath, s_instance->m_envPath)) { AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; @@ -1484,7 +1489,7 @@ namespace AtomSampleViewer auto operation = [filePath]() { // Note this will pause the script until the capture is complete - if (PrepareForScreenCapture(filePath)) + if (PrepareForScreenCapture(filePath, s_instance->m_envPath)) { AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; @@ -1514,7 +1519,7 @@ namespace AtomSampleViewer auto operation = [filePath]() { // Note this will pause the script until the capture is complete - if (PrepareForScreenCapture(filePath)) + if (PrepareForScreenCapture(filePath, s_instance->m_envPath)) { AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; @@ -1611,7 +1616,7 @@ namespace AtomSampleViewer auto operation = [passHierarchy, slot, outputFilePath, readbackOption]() { // Note this will pause the script until the capture is complete - if (PrepareForScreenCapture(outputFilePath)) + if (PrepareForScreenCapture(outputFilePath, s_instance->m_envPath)) { AZ_Assert(s_instance->m_frameCaptureId == AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId, "Attempting to start a capture while one is in progress"); uint32_t frameCaptureId = AZ::Render::FrameCaptureRequests::s_InvalidFrameCaptureId; diff --git a/Gem/Code/Source/Automation/ScriptManager.h b/Gem/Code/Source/Automation/ScriptManager.h index f7ceeadd..cd203d46 100644 --- a/Gem/Code/Source/Automation/ScriptManager.h +++ b/Gem/Code/Source/Automation/ScriptManager.h @@ -124,6 +124,8 @@ namespace AtomSampleViewer static void Script_ShowTool(const AZStd::string& toolName, bool enable); // Screenshots... + // Store the test environment path of the screenshots. It will be used to figure out the baseline path. + static void Script_SetTestEnvPath(const AZStd::string& envPath); // Call this function before capturing screenshots to indicate which comparison tolerance level should be used. // The list of available tolerance levels can be found in "AtomSampleViewer/Config/ImageComparisonToleranceLevels.azasset". @@ -233,7 +235,7 @@ namespace AtomSampleViewer // Validates the ScriptDataContext for ProfilingCapture script requests static bool ValidateProfilingCaptureScripContexts(AZ::ScriptDataContext& dc, AZStd::string& outputFilePath); - static bool PrepareForScreenCapture(const AZStd::string& path); + static bool PrepareForScreenCapture(const AZStd::string& path, const AZStd::string& envPath); // show/hide imgui void SetShowImGui(bool show); @@ -249,6 +251,8 @@ namespace AtomSampleViewer TestSuiteExecutionConfig m_testSuiteRunConfig; + AZStd::string m_envPath = ""; + static constexpr float DefaultPauseTimeout = 5.0f; int m_scriptIdleFrames = 0; diff --git a/Gem/Code/Source/Automation/ScriptReporter.cpp b/Gem/Code/Source/Automation/ScriptReporter.cpp index 0035f06e..74323cba 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.cpp +++ b/Gem/Code/Source/Automation/ScriptReporter.cpp @@ -45,7 +45,7 @@ namespace AtomSampleViewer AZStd::string GetLocalBaselineFolder(bool resolvePath) { - AZStd::string path = AZStd::string::format("@user@/scripts/screenshotslocalbaseline/%s", AZ::RHI::Factory::Get().GetName().GetCStr()); + AZStd::string path = AZStd::string::format("@user@/scripts/screenshotslocalbaseline/"); if (resolvePath) { @@ -76,10 +76,10 @@ namespace AtomSampleViewer { newPath = ""; } - return newPath; + return Utils::ResolvePath(newPath); } - AZStd::string GetOfficialBaseline(const AZStd::string& forScreenshotFile) + AZStd::string GetOfficialBaseline(const AZStd::string& forScreenshotFile, const AZStd::string& envPath) { AZStd::string path = forScreenshotFile; const AZStd::string userPath = Utils::ResolvePath("@user@"); @@ -96,6 +96,10 @@ namespace AtomSampleViewer return ""; } + if (!AzFramework::StringFunc::Replace(path, envPath.c_str(), "")) + { + return ""; + } // Turn it back into a full path path = Utils::ResolvePath("@projectroot@/" + path); @@ -204,12 +208,18 @@ namespace AtomSampleViewer return !m_currentScriptIndexStack.empty(); } - bool ScriptReporter::AddScreenshotTest(const AZStd::string& path) + ScriptReporter::ScreenshotTestInfo::ScreenshotTestInfo(const AZStd::string& screenshotFilePath, const AZStd::string& envPath) + : m_screenshotFilePath(Utils::ResolvePath(screenshotFilePath)) + { + m_officialBaselineScreenshotFilePath = ScreenshotPaths::GetOfficialBaseline(m_screenshotFilePath, envPath); + m_localBaselineScreenshotFilePath = ScreenshotPaths::GetLocalBaseline(m_screenshotFilePath); + } + + bool ScriptReporter::AddScreenshotTest(const AZStd::string& path, const AZStd::string& envPath) { AZ_Assert(GetCurrentScriptReport(), "There is no active script"); - ScreenshotTestInfo screenshotTestInfo; - screenshotTestInfo.m_screenshotFilePath = path; + ScreenshotTestInfo screenshotTestInfo(path, envPath); GetCurrentScriptReport()->m_screenshotTests.push_back(AZStd::move(screenshotTestInfo)); return true; @@ -1000,7 +1010,7 @@ namespace AtomSampleViewer bool ScriptReporter::UpdateLocalBaselineImage(ScreenshotTestInfo& screenshotTest, bool showResultDialog) { - const AZStd::string destinationFile = ScreenshotPaths::GetLocalBaseline(screenshotTest.m_screenshotFilePath); + const AZStd::string destinationFile = screenshotTest.m_localBaselineScreenshotFilePath; AZStd::string destinationFolder = destinationFile; AzFramework::StringFunc::Path::StripFullName(destinationFolder); @@ -1055,7 +1065,7 @@ namespace AtomSampleViewer } // Get official cache baseline file - const AZStd::string cacheFilePath = ScreenshotPaths::GetOfficialBaseline(screenshotTest.m_screenshotFilePath); + const AZStd::string cacheFilePath = screenshotTest.m_officialBaselineScreenshotFilePath; // Divide cache file path into components to we can access the file name and the parent folder AZStd::fixed_vector reversePathComponents; @@ -1160,7 +1170,6 @@ namespace AtomSampleViewer screenshotTestInfo.m_toleranceLevel = *toleranceLevel; - screenshotTestInfo.m_officialBaselineScreenshotFilePath = ScreenshotPaths::GetOfficialBaseline(screenshotTestInfo.m_screenshotFilePath); if (screenshotTestInfo.m_officialBaselineScreenshotFilePath.empty()) { ReportScriptError(AZStd::string::format("Screenshot check failed. Could not determine expected screenshot path for '%s'", screenshotTestInfo.m_screenshotFilePath.c_str())); @@ -1199,7 +1208,6 @@ namespace AtomSampleViewer } } - screenshotTestInfo.m_localBaselineScreenshotFilePath = ScreenshotPaths::GetLocalBaseline(screenshotTestInfo.m_screenshotFilePath); if (screenshotTestInfo.m_localBaselineScreenshotFilePath.empty()) { ReportScriptWarning(AZStd::string::format("Screenshot check failed. Could not determine local baseline screenshot path for '%s'", screenshotTestInfo.m_screenshotFilePath.c_str())); diff --git a/Gem/Code/Source/Automation/ScriptReporter.h b/Gem/Code/Source/Automation/ScriptReporter.h index 64077c6d..535bb184 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.h +++ b/Gem/Code/Source/Automation/ScriptReporter.h @@ -38,7 +38,7 @@ namespace AtomSampleViewer AZStd::string GetLocalBaseline(const AZStd::string& forScreenshotFile); //! Returns the path to the official baseline image that corresponds to @forScreenshotFile - AZStd::string GetOfficialBaseline(const AZStd::string& forScreenshotFile); + AZStd::string GetOfficialBaseline(const AZStd::string& forScreenshotFile, const AZStd::string& envPath); } //! Collects data about each script run by the ScriptManager. @@ -75,7 +75,7 @@ namespace AtomSampleViewer bool HasActiveScript() const; //! Indicates that a new screenshot is about to be captured. - bool AddScreenshotTest(const AZStd::string& path); + bool AddScreenshotTest(const AZStd::string& path, const AZStd::string& envPath); //! Check the latest screenshot using default thresholds. void CheckLatestScreenshot(const ImageComparisonToleranceLevel* comparisonPreset); @@ -139,6 +139,8 @@ namespace AtomSampleViewer ImageComparisonToleranceLevel m_toleranceLevel; //!< Tolerance for checking against the official baseline image ImageComparisonResult m_officialComparisonResult; //!< Result of comparing against the official baseline image, for reporting test failure ImageComparisonResult m_localComparisonResult; //!< Result of comparing against a local baseline, for reporting warnings + + ScreenshotTestInfo(const AZStd::string& screenshotFilePath, const AZStd::string& envPath); }; //! Records all the information about a single test script. diff --git a/Scripts/AreaLightTest.bv.lua b/Scripts/AreaLightTest.bv.lua index ddf7b28b..d4c4ebd4 100644 --- a/Scripts/AreaLightTest.bv.lua +++ b/Scripts/AreaLightTest.bv.lua @@ -9,6 +9,8 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function SetupPointLights() SetImguiValue('AreaLightSample/LightType/Point', true) SetImguiValue('AreaLightSample/Position Offset', Vector3(0.0, 0.0, 0.0)) @@ -109,7 +111,7 @@ function VaryMetallicOnly() SetImguiValue('AreaLightSample/Min Max Metallic', Vector2(0.0, 1.0)) end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/AreaLights/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/AreaLights/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) SelectImageComparisonToleranceLevel("Level E") diff --git a/Scripts/AuxGeom.bv.lua b/Scripts/AuxGeom.bv.lua index 90078cf6..5de4b776 100644 --- a/Scripts/AuxGeom.bv.lua +++ b/Scripts/AuxGeom.bv.lua @@ -9,6 +9,8 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function TakeScreenShotBoxes() NoClipCameraController_SetFov(DegToRad(70)) @@ -29,7 +31,7 @@ function TakeScreenShotShapes() CaptureScreenshot(g_screenshotOutputFolder .. '/auxgeom_shapes.png') end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/AuxGeom/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/AuxGeom/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/AuxGeom') diff --git a/Scripts/CheckerboardTest.bv.lua b/Scripts/CheckerboardTest.bv.lua index 6d6af576..2068bbbd 100644 --- a/Scripts/CheckerboardTest.bv.lua +++ b/Scripts/CheckerboardTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/Checkerboard/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/Checkerboard/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Checkerboard') diff --git a/Scripts/CullingAndLod.bv.lua b/Scripts/CullingAndLod.bv.lua index 940b5a28..ba61b091 100644 --- a/Scripts/CullingAndLod.bv.lua +++ b/Scripts/CullingAndLod.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/CullingAndLod/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/CullingAndLod/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/CullingAndLod') diff --git a/Scripts/Decals.bv.lua b/Scripts/Decals.bv.lua index 2dcd6c01..f9ef898c 100644 --- a/Scripts/Decals.bv.lua +++ b/Scripts/Decals.bv.lua @@ -9,11 +9,13 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function TakeScreenshots() CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_decals.png') end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/Decals/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/Decals/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/Decals') diff --git a/Scripts/DepthOfFieldTest.bv.lua b/Scripts/DepthOfFieldTest.bv.lua index 954bb628..bf3e1286 100644 --- a/Scripts/DepthOfFieldTest.bv.lua +++ b/Scripts/DepthOfFieldTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/DepthOfFieldTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/DepthOfFieldTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/DepthOfField') diff --git a/Scripts/DiffuseGITest.bv.lua b/Scripts/DiffuseGITest.bv.lua index 666d49e8..6927b353 100644 --- a/Scripts/DiffuseGITest.bv.lua +++ b/Scripts/DiffuseGITest.bv.lua @@ -9,10 +9,12 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + if GetRenderApiName() == "vulkan" or GetRenderApiName() == "metal" then Warning("Vulkan or metal is not supported by this test.") else - g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/DiffuseGITest/') + g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/DiffuseGITest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/DiffuseGI') diff --git a/Scripts/DynamicDraw.bv.lua b/Scripts/DynamicDraw.bv.lua index e8077de8..3916272a 100644 --- a/Scripts/DynamicDraw.bv.lua +++ b/Scripts/DynamicDraw.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/DynamicDraw/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/DynamicDraw/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/DynamicDraw') diff --git a/Scripts/DynamicMaterialTest.bv.lua b/Scripts/DynamicMaterialTest.bv.lua index 1ee68497..85d3a5f0 100644 --- a/Scripts/DynamicMaterialTest.bv.lua +++ b/Scripts/DynamicMaterialTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/DynamicMaterialTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/DynamicMaterialTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/DynamicMaterialTest') diff --git a/Scripts/ExposureTest.bv.lua b/Scripts/ExposureTest.bv.lua index 9c8fa121..6db7c08f 100644 --- a/Scripts/ExposureTest.bv.lua +++ b/Scripts/ExposureTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ExposureTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/ExposureTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Exposure') diff --git a/Scripts/EyeMaterialTest.bv.lua b/Scripts/EyeMaterialTest.bv.lua index 1b454c8d..a8e578c2 100644 --- a/Scripts/EyeMaterialTest.bv.lua +++ b/Scripts/EyeMaterialTest.bv.lua @@ -1,4 +1,17 @@ -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/EyeMaterial/') +---------------------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/EyeMaterial/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/EyeMaterial') diff --git a/Scripts/LightCulling.bv.lua b/Scripts/LightCulling.bv.lua index 6360002c..1e8e9d42 100644 --- a/Scripts/LightCulling.bv.lua +++ b/Scripts/LightCulling.bv.lua @@ -9,6 +9,8 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function ResetEntityCounts() SetImguiValue('Point Lights/Point light count', 0) SetImguiValue('Decals/Decal count', 0) @@ -103,7 +105,7 @@ function EnableOnlyTestHeatmap() SetImguiValue('Heatmap/Opacity', 1.0) end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/LightCulling/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/LightCulling/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) SelectImageComparisonToleranceLevel("Level E") diff --git a/Scripts/MSAA_RPI_Test.bv.lua b/Scripts/MSAA_RPI_Test.bv.lua index 5c40da52..6c913445 100644 --- a/Scripts/MSAA_RPI_Test.bv.lua +++ b/Scripts/MSAA_RPI_Test.bv.lua @@ -9,6 +9,8 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function TakeScreenShot4xCylinder() SetImguiValue('Mode/MSAA 4x', true) @@ -18,7 +20,7 @@ function TakeScreenShot4xCylinder() CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_msaa4x_cylinder.png') end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MSAA_RPI/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MSAA_RPI/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/MSAA') diff --git a/Scripts/MaterialHotReloadTest.bv.lua b/Scripts/MaterialHotReloadTest.bv.lua index 45e5bef5..6b2bfacf 100644 --- a/Scripts/MaterialHotReloadTest.bv.lua +++ b/Scripts/MaterialHotReloadTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MaterialHotReloadTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MaterialHotReloadTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) g_assetFolder = "materials/hotreloadtest/temp/"; diff --git a/Scripts/MaterialScreenshotTests.bv.lua b/Scripts/MaterialScreenshotTests.bv.lua index c8a83539..7c863058 100644 --- a/Scripts/MaterialScreenshotTests.bv.lua +++ b/Scripts/MaterialScreenshotTests.bv.lua @@ -9,6 +9,7 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") g_shaderballModel = 'materialeditor/viewportmodels/shaderball.azmodel' g_cubeModel = 'materialeditor/viewportmodels/cube.azmodel' @@ -92,7 +93,7 @@ SetImguiValue('Show Ground Plane', false) -- StandardPBR Materials... g_testMaterialsFolder = 'testdata/materials/standardpbrtestcases/' -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/StandardPBR/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/StandardPBR/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) GenerateMaterialScreenshot('Level C', '001_DefaultWhite') @@ -161,7 +162,7 @@ GenerateMaterialScreenshot('Level H', '105_DetailMaps_BlendMaskUsingDetailUVs', -- StandardMultilayerPBR Materials... g_testMaterialsFolder = 'testdata/materials/standardmultilayerpbrtestcases/' -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/StandardMultilayerPBR/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/StandardMultilayerPBR/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) GenerateMaterialScreenshot('Level I', '001_ManyFeatures', {model=g_cubeModel, cameraHeading=-125.0, cameraPitch=-16.0, cameraZ=0.12}) @@ -185,7 +186,7 @@ GenerateMaterialScreenshot('Level I', '005_UseDisplacement_With_BlendMaskTexture -- Skin Materials... g_testMaterialsFolder = 'testdata/materials/skintestcases/' -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/Skin/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/Skin/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) -- We should eventually replace this with realistic skin test cases, these are just placeholders for regression testing @@ -196,7 +197,7 @@ GenerateMaterialScreenshot('Level G', '002_wrinkle_regression_test', {model=g_mo -- MinimalPBR Materials... g_testMaterialsFolder = 'materials/minimalpbr/' -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MinimalPBR/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MinimalPBR/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) GenerateMaterialScreenshot('Level B', 'MinimalPbr_Default') @@ -208,7 +209,7 @@ GenerateMaterialScreenshot('Level D', 'MinimalPbr_RedDielectric') -- This test is here only temporarily for regression testing until StandardMultilayerPBR is refactored to use reused nested property groups. g_testMaterialsFolder = 'materials/types/' -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MinimalPBR/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MinimalPBR/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) GenerateMaterialScreenshot('Level G', 'MinimalMultilayerExample') @@ -216,7 +217,7 @@ GenerateMaterialScreenshot('Level G', 'MinimalMultilayerExample') ---------------------------------------------------------------------- -- AutoBrick Materials... -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/AutoBrick/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/AutoBrick/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) g_testMaterialsFolder = 'testdata/materials/autobrick/' diff --git a/Scripts/MultiRenderPipeline.bv.lua b/Scripts/MultiRenderPipeline.bv.lua index 0aa6bbe5..e3bdf0bc 100644 --- a/Scripts/MultiRenderPipeline.bv.lua +++ b/Scripts/MultiRenderPipeline.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MultiRenderPipeline/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MultiRenderPipeline/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) function TakeScreenShotForWindow1(fileName) diff --git a/Scripts/MultiScene.bv.lua b/Scripts/MultiScene.bv.lua index 67cdc1e4..dc22e583 100644 --- a/Scripts/MultiScene.bv.lua +++ b/Scripts/MultiScene.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/MultiScene/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/MultiScene/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) function TakeScreenShotFromPrimaryWindow(fileName) diff --git a/Scripts/ParallaxDepthArtifacts.bv.lua b/Scripts/ParallaxDepthArtifacts.bv.lua index fb9dd98f..e0f752e4 100644 --- a/Scripts/ParallaxDepthArtifacts.bv.lua +++ b/Scripts/ParallaxDepthArtifacts.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ParallaxDepthArtifacts/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/ParallaxDepthArtifacts/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Parallax') diff --git a/Scripts/ParallaxTest.bv.lua b/Scripts/ParallaxTest.bv.lua index 35f62e0e..883fd7dd 100644 --- a/Scripts/ParallaxTest.bv.lua +++ b/Scripts/ParallaxTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ParallaxTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/ParallaxTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Parallax') diff --git a/Scripts/PassTree.bv.lua b/Scripts/PassTree.bv.lua index cfe4e501..2e880b22 100644 --- a/Scripts/PassTree.bv.lua +++ b/Scripts/PassTree.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/PassTree/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/PassTree/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) -- Select an attachment; take a screenshot with preview output (used for screenshot comparison); capture and save the attachment. diff --git a/Scripts/ReadbackTest.bv.lua b/Scripts/ReadbackTest.bv.lua index a97a6607..fc5aea87 100644 --- a/Scripts/ReadbackTest.bv.lua +++ b/Scripts/ReadbackTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/Readback') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/Readback') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/Readback') diff --git a/Scripts/RenderTargetTexture.bv.lua b/Scripts/RenderTargetTexture.bv.lua index e2282c76..e08faea9 100644 --- a/Scripts/RenderTargetTexture.bv.lua +++ b/Scripts/RenderTargetTexture.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/RenderTargetTexture/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/RenderTargetTexture/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/RenderTargetTexture') diff --git a/Scripts/SceneReloadSoakTest.bv.lua b/Scripts/SceneReloadSoakTest.bv.lua index c22cfbbd..7572e2ac 100644 --- a/Scripts/SceneReloadSoakTest.bv.lua +++ b/Scripts/SceneReloadSoakTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/SceneReloadSoakTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/SceneReloadSoakTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) -- First we capture a screenshot to make sure everything is rendering correctly... diff --git a/Scripts/ShaderReloadSoakTest.bv.lua b/Scripts/ShaderReloadSoakTest.bv.lua index df5cfe8b..eb4a6a68 100644 --- a/Scripts/ShaderReloadSoakTest.bv.lua +++ b/Scripts/ShaderReloadSoakTest.bv.lua @@ -12,6 +12,8 @@ -- WARNING: This is a soak test, do not add this test to the fully automated -- test suites. +RunScript("scripts/TestEnvironment.luac") + OpenSample('RPI/ShaderReloadTest') ResizeViewport(500, 500) diff --git a/Scripts/ShadowTest.bv.lua b/Scripts/ShadowTest.bv.lua index 0c607e11..ed9ecbc6 100644 --- a/Scripts/ShadowTest.bv.lua +++ b/Scripts/ShadowTest.bv.lua @@ -9,6 +9,8 @@ -- ---------------------------------------------------------------------------------------------------- +RunScript("scripts/TestEnvironment.luac") + function EnablePositionalLights() SetImguiValue('Red', true) SetImguiValue('Intensity##Positional', 500.0) @@ -98,7 +100,7 @@ function TestDirectionalLight() -- Directional Light ESM+PCF SetImguiValue('Filter Method##Directional', 'ESM+PCF') IdleFrames(1) - CaptureScreenshot(g_screenshotOutputFolder .. '/directional_esm_pcf.png') + CaptureScreenshot(g_screenshotOutputFolder .. '/directional_esm_pcf.png') end function TestDiskLights() @@ -161,7 +163,7 @@ function TestPointLights() CaptureScreenshot(g_screenshotOutputFolder .. '/point_lights.png') end -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/Shadow/') +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/Shadow/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Shadow') diff --git a/Scripts/ShadowedSponzaTest.bv.lua b/Scripts/ShadowedSponzaTest.bv.lua index 39890e2b..a16e9192 100644 --- a/Scripts/ShadowedSponzaTest.bv.lua +++ b/Scripts/ShadowedSponzaTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/ShadowedSponza/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/ShadowedSponza/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) diff --git a/Scripts/SkinnedMesh.bv.lua b/Scripts/SkinnedMesh.bv.lua index d96f93c6..a455863c 100644 --- a/Scripts/SkinnedMesh.bv.lua +++ b/Scripts/SkinnedMesh.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/SkinnedMesh/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/SkinnedMesh/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/SkinnedMesh') diff --git a/Scripts/StreamingImageTest.bv.lua b/Scripts/StreamingImageTest.bv.lua index e0530f5a..856ced44 100644 --- a/Scripts/StreamingImageTest.bv.lua +++ b/Scripts/StreamingImageTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/StreamingImage/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/StreamingImage/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('RPI/StreamingImage') diff --git a/Scripts/TestEnvironment.lua b/Scripts/TestEnvironment.lua new file mode 100644 index 00000000..0db49662 --- /dev/null +++ b/Scripts/TestEnvironment.lua @@ -0,0 +1,8 @@ +g_renderApiName = GetRenderApiName() + +-- surround the actual env so that it won't match other part of the path when IO is operating the file path. +stringCollisionProtector = '___' + +g_testEnv = stringCollisionProtector .. g_renderApiName .. stringCollisionProtector; + +SetTestEnvPath(g_testEnv) \ No newline at end of file diff --git a/Scripts/TransparentTest.bv.lua b/Scripts/TransparentTest.bv.lua index 3e95276c..f64817ec 100644 --- a/Scripts/TransparentTest.bv.lua +++ b/Scripts/TransparentTest.bv.lua @@ -9,7 +9,9 @@ -- ---------------------------------------------------------------------------------------------------- -g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/TransparentTest/') +RunScript("scripts/TestEnvironment.luac") + +g_screenshotOutputFolder = ResolvePath('@user@/Scripts/Screenshots/' .. g_testEnv .. '/TransparentTest/') Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder)) OpenSample('Features/Transparency') diff --git a/atomsampleviewer_asset_files.cmake b/atomsampleviewer_asset_files.cmake index 1d86b20a..0d9cbd86 100644 --- a/atomsampleviewer_asset_files.cmake +++ b/atomsampleviewer_asset_files.cmake @@ -56,6 +56,7 @@ set(FILES Scripts/ShadowTest.bv.lua Scripts/SkinnedMesh.bv.lua Scripts/StreamingImageTest.bv.lua + Scripts/TestEnvironment.lua Scripts/TransparentTest.bv.lua Scripts/_AutomatedPeriodicBenchmarkSuite_.bv.lua Scripts/_FullTestSuite_.bv.lua From 6e9e09cabd0193b1dc69aa3ddefdc8a04dad7eca Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:49:35 -0500 Subject: [PATCH 81/81] Add `Debug::Tracer tracer` stack variable to main so that TraceMessageBus works (#503) (#505) Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gem/Code/Source/Automation/ScriptReporter.h | 5 +++++ Standalone/Platform/Common/AtomSampleViewerApplication.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/Gem/Code/Source/Automation/ScriptReporter.h b/Gem/Code/Source/Automation/ScriptReporter.h index 535bb184..47bf1bcc 100644 --- a/Gem/Code/Source/Automation/ScriptReporter.h +++ b/Gem/Code/Source/Automation/ScriptReporter.h @@ -146,6 +146,11 @@ namespace AtomSampleViewer //! Records all the information about a single test script. struct ScriptReport : public AZ::Debug::TraceMessageBus::Handler { + ScriptReport() + { + AZ::Debug::TraceMessageBus::Handler::BusConnect(); + } + ~ScriptReport() { AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); diff --git a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp index c0f459b2..b46049b2 100644 --- a/Standalone/Platform/Common/AtomSampleViewerApplication.cpp +++ b/Standalone/Platform/Common/AtomSampleViewerApplication.cpp @@ -331,6 +331,7 @@ namespace AtomSampleViewer int RunGameCommon(int argc, char** argv, AZStd::function customRunCode) { + const AZ::Debug::Trace tracer; AtomSampleViewer::AtomSampleViewerApplication app(&argc, &argv); const AzGameFramework::GameApplication::StartupParameters gameAppParams;