Kaynağa Gözat

Integrating github/staging through commit 5f214be

alexpete 4 yıl önce
ebeveyn
işleme
c4dedb08a5
58 değiştirilmiş dosya ile 615 ekleme ve 698 silme
  1. 6 14
      Gem/Code/CMakeLists.txt
  2. 1 3
      Gem/Code/Source/AreaLightExampleComponent.cpp
  3. 1 2
      Gem/Code/Source/Automation/ScriptReporter.cpp
  4. 65 65
      Gem/Code/Source/CullingAndLodExampleComponent.cpp
  5. 17 17
      Gem/Code/Source/CullingAndLodExampleComponent.h
  6. 2 2
      Gem/Code/Source/DecalExampleComponent.cpp
  7. 31 79
      Gem/Code/Source/LightCullingExampleComponent.cpp
  8. 4 14
      Gem/Code/Source/LightCullingExampleComponent.h
  9. 14 3
      Gem/Code/Source/MaterialHotReloadTestComponent.cpp
  10. 2 0
      Gem/Code/Source/MaterialHotReloadTestComponent.h
  11. 19 18
      Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp
  12. 8 8
      Gem/Code/Source/MultiRenderPipelineExampleComponent.h
  13. 16 14
      Gem/Code/Source/MultiSceneExampleComponent.cpp
  14. 4 4
      Gem/Code/Source/MultiSceneExampleComponent.h
  15. 17 16
      Gem/Code/Source/ParallaxMappingExampleComponent.cpp
  16. 5 5
      Gem/Code/Source/ParallaxMappingExampleComponent.h
  17. 6 6
      Gem/Code/Source/RHI/MRTExampleComponent.cpp
  18. 2 3
      Gem/Code/Source/SampleComponentManager.cpp
  19. 87 89
      Gem/Code/Source/ShadowExampleComponent.cpp
  20. 21 21
      Gem/Code/Source/ShadowExampleComponent.h
  21. 122 116
      Gem/Code/Source/ShadowedBistroExampleComponent.cpp
  22. 27 26
      Gem/Code/Source/ShadowedBistroExampleComponent.h
  23. 1 1
      Objects/Bistro/CHANGELOG.txt
  24. 3 3
      Objects/Bistro/README.txt
  25. 14 14
      Passes/CheckerboardPipeline.pass
  26. 10 10
      Passes/ComplexPipeline.pass
  27. 3 3
      Passes/MSAA_RPI_Pipeline_Core.pass
  28. 8 8
      Passes/MainPipeline.pass
  29. 14 14
      Passes/MainPipeline_Mobile.pass
  30. 3 3
      Passes/No_MSAA_RPI_Pipeline.pass
  31. 2 2
      Passes/PassTemplates.azasset
  32. 10 10
      Passes/SsaoPipeline.pass
  33. 0 10
      Scripts/AreaLightTest.bv.lua
  34. 0 3
      Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_metal.ppm
  35. 0 3
      Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_rough_metal.ppm
  36. 0 3
      Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_rough_nonmetal.ppm
  37. 1 1
      Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.ppm
  38. 1 1
      Scripts/ExpectedScreenshots/LightCulling/screenshot_capsulelights.ppm
  39. 1 1
      Scripts/ExpectedScreenshots/LightCulling/screenshot_decals.ppm
  40. 1 1
      Scripts/ExpectedScreenshots/LightCulling/screenshot_disklights.ppm
  41. 1 1
      Scripts/ExpectedScreenshots/LightCulling/screenshot_quadlights.ppm
  42. 0 3
      Scripts/ExpectedScreenshots/LightCulling/screenshot_spotlights.ppm
  43. 1 1
      Scripts/ExpectedScreenshots/ShadowedBistro/initial.ppm
  44. 1 1
      Scripts/ExpectedScreenshots/ShadowedBistro/spot_nofilter_table.ppm
  45. 0 14
      Scripts/LightCulling.bv.lua
  46. 2 1
      Scripts/MaterialHotReloadTest.bv.lua
  47. 27 27
      Scripts/ShadowTest.bv.lua
  48. 4 4
      Standalone/Platform/Mac/MacO3DEApplication.h
  49. 3 3
      Standalone/Platform/Mac/MacO3DEApplication.mm
  50. 3 3
      Standalone/Platform/Mac/MacO3DEApplicationDelegate.mm
  51. 4 4
      Standalone/Platform/Mac/main_mac.mm
  52. 3 3
      Standalone/Platform/Mac/platform_mac_files.cmake
  53. 3 3
      Standalone/Platform/iOS/IosO3DEApplication.mm
  54. 5 5
      Standalone/Platform/iOS/IosO3DEApplicationDelegate.mm
  55. 2 2
      Standalone/Platform/iOS/main_ios.mm
  56. 2 2
      Standalone/Platform/iOS/platform_ios_files.cmake
  57. 2 2
      Standalone/atomsample_viewer_ios_files.cmake
  58. 3 3
      Standalone/atomsample_viewer_mac_files.cmake

+ 6 - 14
Gem/Code/CMakeLists.txt

@@ -18,8 +18,7 @@ ly_add_target(
         atomsampleviewergem_lib_files.cmake
     INCLUDE_DIRECTORIES
         PUBLIC
-            Include
-                Lib
+            Lib
     BUILD_DEPENDENCIES
         PUBLIC
             AZ::AzGameFramework
@@ -36,10 +35,9 @@ ly_add_target(
         ${pal_dir}/atomsampleviewer_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
     INCLUDE_DIRECTORIES
         PUBLIC
-            Include
-                Lib
-                Source
-                ${pal_dir}
+            Lib
+            Source
+            ${pal_dir}
     BUILD_DEPENDENCIES
         PUBLIC
             AZ::AzGameFramework
@@ -55,9 +53,6 @@ ly_add_target(
     FILES_CMAKE
         atomsampleviewergem_private_shared_files.cmake
         ../../atomsampleviewer_asset_files.cmake
-    INCLUDE_DIRECTORIES
-        PUBLIC
-            Include
     PLATFORM_INCLUDE_FILES
         ${pal_dir}/additional_${PAL_PLATFORM_NAME_LOWERCASE}_runtime_library.cmake
     BUILD_DEPENDENCIES
@@ -77,9 +72,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
             atomsampleviewergem_tools_files.cmake
         INCLUDE_DIRECTORIES
             PUBLIC
-                Include
-                    .
-                    Tools
+                .
+                Tools
         BUILD_DEPENDENCIES
             PRIVATE
                 AZ::AzGameFramework
@@ -102,8 +96,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
                 .
                 Source
                 Source/Platform/${PAL_PLATFORM_NAME}
-            PUBLIC
-                Include
         BUILD_DEPENDENCIES
             PUBLIC
                 AZ::AzCore

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

@@ -314,8 +314,6 @@ namespace AtomSampleViewer
 
             float radius = GetLerpValue(m_config.m_radius, index, m_config.GetVaryRadius());
             m_diskLightFeatureProcessor->SetDiskRadius(handle, radius);
-
-            m_diskLightFeatureProcessor->SetLightEmitsBothDirections(handle, m_config.m_emitsBothDirections);
         }
     }
 
@@ -685,7 +683,7 @@ namespace AtomSampleViewer
             }
         }
 
-        if (m_config.m_lightType == Disk || m_config.m_lightType == Quad || m_config.m_lightType == Polygon)
+        if (m_config.m_lightType == Quad || m_config.m_lightType == Polygon)
         {
             if (ScriptableImGui::Checkbox("Emit Both Directions", &m_config.m_emitsBothDirections))
             {

+ 1 - 2
Gem/Code/Source/Automation/ScriptReporter.cpp

@@ -911,8 +911,7 @@ namespace AtomSampleViewer
         // Get source folder
         if (m_officialBaselineSourceFolder.empty())
         {
-            AZStd::string projectPath = AZ::Utils::GetProjectPath();
-            AzFramework::StringFunc::Path::Join(projectPath.c_str(), "Scripts/ExpectedScreenshots", m_officialBaselineSourceFolder);
+            m_officialBaselineSourceFolder = (AZ::IO::FixedMaxPath(AZ::Utils::GetProjectPath()) / "Scripts" / "ExpectedScreenshots").String();
 
             if (!io->Exists(m_officialBaselineSourceFolder.c_str()))
             {

+ 65 - 65
Gem/Code/Source/CullingAndLodExampleComponent.cpp

@@ -102,7 +102,7 @@ namespace AtomSampleViewer
         ClearMeshes();
 
         m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle);
-        UpdateSpotLightCount(0);
+        UpdateDiskLightCount(0);
     }
 
     void CullingAndLodExampleComponent::OnTick(float deltaTime, AZ::ScriptTimePoint timePoint)
@@ -209,14 +209,14 @@ namespace AtomSampleViewer
         using namespace AZ;
 
         m_directionalLightShadowmapSizeIndex = s_shadowmapSizeIndexDefault;
-        m_spotLightShadowmapSize = Render::ShadowmapSize::None; // random
+        m_diskLightShadowmapSize = Render::ShadowmapSize::None; // random
         m_cascadeCount = s_cascadesCountDefault;
         m_ratioLogarithmUniform = s_ratioLogarithmUniformDefault;
-        m_spotLightCount = 0;
+        m_diskLightCount = 0;
 
         RPI::Scene* scene = RPI::Scene::GetSceneForEntityContextId(GetEntityContextId());
         m_directionalLightFeatureProcessor = scene->GetFeatureProcessor<Render::DirectionalLightFeatureProcessorInterface>();
-        m_spotLightFeatureProcessor = scene->GetFeatureProcessor<Render::SpotLightFeatureProcessorInterface>();
+        m_diskLightFeatureProcessor = scene->GetFeatureProcessor<Render::DiskLightFeatureProcessorInterface>();
 
         // directional light
         {
@@ -245,57 +245,61 @@ namespace AtomSampleViewer
             m_directionalLightHandle = handle;
         }
 
-        // spot lights
+        // disk lights
         {
-            m_spotLights.clear();
-            m_spotLights.reserve(SpotLightCountMax);
-            const float spotlightSpacing = 10.0f;
-            const int spotLightsPerRow = 10;
+            m_diskLights.clear();
+            m_diskLights.reserve(DiskLightCountMax);
+            const float disklightSpacing = 10.0f;
+            const int diskLightsPerRow = 10;
             const Color colors[5] = {Colors::Red, Colors::Green, Colors::Blue, Colors::Orange, Colors::Pink};
-            for (int index = 0; index < SpotLightCountMax; ++index)
+            for (int index = 0; index < DiskLightCountMax; ++index)
             {
-                float xPos = (index % spotLightsPerRow) * spotlightSpacing;
-                float yPos = (index / spotLightsPerRow) * spotlightSpacing;
-                m_spotLights.emplace_back(
+                float xPos = (index % diskLightsPerRow) * disklightSpacing;
+                float yPos = (index / diskLightsPerRow) * disklightSpacing;
+                m_diskLights.emplace_back(
                     colors[index % 5],
                     Vector3(xPos, yPos, 10.0f),
                     Vector3(1.0f, 1.0f, -1.0f).GetNormalized(),
                     Render::ShadowmapSize::Size256);
             }
-            UpdateSpotLightCount(20);
+            UpdateDiskLightCount(20);
         }
     }
 
-    void CullingAndLodExampleComponent::UpdateSpotLightCount(uint16_t count)
+    void CullingAndLodExampleComponent::UpdateDiskLightCount(uint16_t count)
     {
         using namespace AZ;
 
-        for (int index = count; index < m_spotLightCount; ++index)
+        for (int index = count; index < m_diskLightCount; ++index)
         {
-            SpotLightHandle& handle = m_spotLights[index].m_handle;
-            m_spotLightFeatureProcessor->ReleaseLight(handle);
+            DiskLightHandle& handle = m_diskLights[index].m_handle;
+            m_diskLightFeatureProcessor->ReleaseLight(handle);
         }
 
-        const int previousSpotLightCount = m_spotLightCount;
+        const int previousDiskLightCount = m_diskLightCount;
 
-        for (int index = previousSpotLightCount; index < count; ++index)
+        for (int index = previousDiskLightCount; index < count; ++index)
         {
-            Render::SpotLightFeatureProcessorInterface* const spotLightFP = m_spotLightFeatureProcessor;
-            const SpotLightHandle handle = spotLightFP->AcquireLight();
-            const SpotLight &spotLight = m_spotLights[index];
-
-            spotLightFP->SetPosition(handle, spotLight.m_position);
-            spotLightFP->SetDirection(handle, spotLight.m_direction);
-            spotLightFP->SetRgbIntensity(handle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(spotLight.m_color * m_spotLightIntensity));
-            const float radius = sqrtf(m_spotLightIntensity / CutoffIntensity);
-            spotLightFP->SetAttenuationRadius(handle, radius);
-            spotLightFP->SetShadowmapSize(handle, m_spotLightShadowEnabled ? m_spotLights[index].m_shadowmapSize : Render::ShadowmapSize::None);
-            spotLightFP->SetConeAngles(handle, 45.f, 55.f);
-
-            m_spotLights[index].m_handle = handle;
+            Render::DiskLightFeatureProcessorInterface* const diskLightFP = m_diskLightFeatureProcessor;
+            const DiskLightHandle handle = diskLightFP->AcquireLight();
+            const DiskLight &diskLight = m_diskLights[index];
+
+            diskLightFP->SetPosition(handle, diskLight.m_position);
+            diskLightFP->SetDirection(handle, diskLight.m_direction);
+            diskLightFP->SetRgbIntensity(handle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(diskLight.m_color * m_diskLightIntensity));
+            const float radius = sqrtf(m_diskLightIntensity / CutoffIntensity);
+            diskLightFP->SetAttenuationRadius(handle, radius);
+            diskLightFP->SetShadowsEnabled(handle, m_diskLightShadowEnabled);
+            if (m_diskLightShadowEnabled)
+            {
+                diskLightFP->SetShadowmapMaxResolution(handle, m_diskLights[index].m_shadowmapSize);
+            }
+            diskLightFP->SetConeAngles(handle, DegToRad(45.f), DegToRad(55.f));
+
+            m_diskLights[index].m_handle = handle;
         }
 
-        m_spotLightCount = count;
+        m_diskLightCount = count;
     }
 
     void CullingAndLodExampleComponent::DrawSidebar()
@@ -419,42 +423,42 @@ namespace AtomSampleViewer
 
         ImGui::Separator();
 
-        ImGui::Text("Spot Lights");
+        ImGui::Text("Disk Lights");
         ImGui::Indent();
         {
-            int spotLightCount = m_spotLightCount;
-            if (ImGui::SliderInt("Number", &spotLightCount, 0, SpotLightCountMax))
+            int diskLightCount = m_diskLightCount;
+            if (ImGui::SliderInt("Number", &diskLightCount, 0, DiskLightCountMax))
             {
-                UpdateSpotLightCount(spotLightCount);
+                UpdateDiskLightCount(diskLightCount);
             }
 
-            if (ImGui::SliderFloat("Intensity##spot", &m_spotLightIntensity, 0.f, 100000.f, "%.1f", 4.f))
+            if (ImGui::SliderFloat("Intensity##disk", &m_diskLightIntensity, 0.f, 100000.f, "%.1f", 4.f))
             {
-                for (const SpotLight& light : m_spotLights)
+                for (const DiskLight& light : m_diskLights)
                 {
                     if (light.m_handle.IsValid())
                     {
-                        m_spotLightFeatureProcessor->SetRgbIntensity(light.m_handle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(light.m_color * m_spotLightIntensity));
-                        const float radius = sqrtf(m_spotLightIntensity / CutoffIntensity);
-                        m_spotLightFeatureProcessor->SetAttenuationRadius(light.m_handle, radius);
+                        m_diskLightFeatureProcessor->SetRgbIntensity(light.m_handle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(light.m_color * m_diskLightIntensity));
+                        const float radius = sqrtf(m_diskLightIntensity / CutoffIntensity);
+                        m_diskLightFeatureProcessor->SetAttenuationRadius(light.m_handle, radius);
                     }
                 }
             }
 
-            bool spotLightShadowmapChanged = ImGui::Checkbox("Enable Shadow", &m_spotLightShadowEnabled);
+            bool diskLightShadowmapChanged = ImGui::Checkbox("Enable Shadow", &m_diskLightShadowEnabled);
             
             ImGui::Text("Shadowmap Size");
-            int newSize = static_cast<int>(m_spotLightShadowmapSize);
+            int newSize = static_cast<int>(m_diskLightShadowmapSize);
             // To avoid GPU memory consumption, we avoid bigger shadowmap sizes here.
-            spotLightShadowmapChanged = spotLightShadowmapChanged ||
+            diskLightShadowmapChanged = diskLightShadowmapChanged ||
                 ImGui::RadioButton("256", &newSize, static_cast<int>(Render::ShadowmapSize::Size256)) ||
                 ImGui::RadioButton("512", &newSize, static_cast<int>(Render::ShadowmapSize::Size512)) ||
                 ImGui::RadioButton("Random", &newSize, static_cast<int>(Render::ShadowmapSize::None));
 
-            if (spotLightShadowmapChanged)
+            if (diskLightShadowmapChanged)
             {
-                m_spotLightShadowmapSize = static_cast<Render::ShadowmapSize>(newSize);
-                UpdateSpotLightShadowmapSize();
+                m_diskLightShadowmapSize = static_cast<Render::ShadowmapSize>(newSize);
+                UpdateDiskLightShadowmapSize();
             }
         }
         ImGui::Unindent();
@@ -474,47 +478,43 @@ namespace AtomSampleViewer
         m_imguiSidebar.End();
     }
 
-    void CullingAndLodExampleComponent::UpdateSpotLightShadowmapSize()
+    void CullingAndLodExampleComponent::UpdateDiskLightShadowmapSize()
     {
         using namespace AZ::Render;
-        SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
+        DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
 
-        if (!m_spotLightShadowEnabled)
+        if (!m_diskLightShadowEnabled)
         {
             // disabled shadows
-            for (const SpotLight& light : m_spotLights)
+            for (const DiskLight& light : m_diskLights)
             {
                 if (light.m_handle.IsValid())
                 {
-                    featureProcessor->SetShadowmapSize(
-                        light.m_handle,
-                        ShadowmapSize::None);
+                    featureProcessor->SetShadowsEnabled(light.m_handle, false);
                 }
             }
         }
-        else if (m_spotLightShadowmapSize != ShadowmapSize::None)
+        else if (m_diskLightShadowmapSize != ShadowmapSize::None)
         {
             // uniform size
-            for (const SpotLight& light : m_spotLights)
+            for (const DiskLight& light : m_diskLights)
             {
                 if (light.m_handle.IsValid())
                 {
-                    featureProcessor->SetShadowmapSize(
-                        light.m_handle,
-                        m_spotLightShadowmapSize);
+                    featureProcessor->SetShadowsEnabled(light.m_handle, true);
+                    featureProcessor->SetShadowmapMaxResolution(light.m_handle, m_diskLightShadowmapSize);
                 }
             }
         }
         else
         {
             // random sizes
-            for (const SpotLight& light : m_spotLights)
+            for (const DiskLight& light : m_diskLights)
             {
                 if (light.m_handle.IsValid())
                 {
-                    featureProcessor->SetShadowmapSize(
-                        light.m_handle,
-                        light.m_shadowmapSize);
+                    featureProcessor->SetShadowsEnabled(light.m_handle, true);
+                    featureProcessor->SetShadowmapMaxResolution(light.m_handle, light.m_shadowmapSize);
                 }
             }
         }

+ 17 - 17
Gem/Code/Source/CullingAndLodExampleComponent.h

@@ -14,8 +14,8 @@
 
 #include <CommonSampleComponentBase.h>
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/ShadowConstants.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
 #include <Atom/Feature/Mesh/MeshFeatureProcessor.h>
 #include <Atom/RPI.Reflect/Material/MaterialAsset.h>
 #include <Atom/RPI.Reflect/Model/ModelAsset.h>
@@ -49,30 +49,30 @@ namespace AtomSampleViewer
 
     private:
         using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
+        using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
 
-        class SpotLight
+        class DiskLight
         {
         public:
-            SpotLight() = delete;
-            explicit SpotLight(const AZ::Color& color, const AZ::Vector3& position,
+            DiskLight() = delete;
+            explicit DiskLight(const AZ::Color& color, const AZ::Vector3& position,
                 const AZ::Vector3& direction, AZ::Render::ShadowmapSize shadowmapSize)
                 : m_color(color)
                 , m_position(position)
                 , m_direction(direction)
                 , m_shadowmapSize(shadowmapSize)
             {}
-            ~SpotLight() = default;
+            ~DiskLight() = default;
 
             const AZ::Color m_color;
             const AZ::Vector3 m_position;
             const AZ::Vector3 m_direction;
             const AZ::Render::ShadowmapSize m_shadowmapSize;
-            SpotLightHandle m_handle;
+            DiskLightHandle m_handle;
         };
 
-        static constexpr int SpotLightCountMax = 100;
-        static constexpr int SpotLightCountDefault = 10;
+        static constexpr int DiskLightCountMax = 100;
+        static constexpr int DiskLightCountDefault = 10;
         static constexpr float CutoffIntensity = 0.5f;
 
         static const AZ::Color DirectionalLightColor;
@@ -89,18 +89,18 @@ namespace AtomSampleViewer
         void ClearMeshes();
         void SpawnModelsIn2DGrid(uint32_t numAlongXAxis, uint32_t numAlongYAxis);
         void SetupLights();
-        void UpdateSpotLightCount(uint16_t count);
+        void UpdateDiskLightCount(uint16_t count);
 
         void DrawSidebar();
-        void UpdateSpotLightShadowmapSize();
+        void UpdateDiskLightShadowmapSize();
 
         float m_originalFarClipDistance = 0.f;
 
         // lights
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         DirectionalLightHandle m_directionalLightHandle;
-        AZStd::vector<SpotLight> m_spotLights;
+        AZStd::vector<DiskLight> m_diskLights;
 
         // models
         AZStd::vector<AZ::Render::MeshFeatureProcessorInterface::MeshHandle> m_meshHandles;
@@ -111,8 +111,8 @@ namespace AtomSampleViewer
         float m_directionalLightPitch = -1.22;
         float m_directionalLightYaw = 0.7f;
         float m_directionalLightIntensity = 4.f;
-        float m_spotLightIntensity = 2000.f;
-        int m_spotLightCount = 0;
+        float m_diskLightIntensity = 2000.f;
+        int m_diskLightCount = 0;
 
         // Shadowmap
         static const AZ::Render::ShadowmapSize s_shadowmapSizes[];
@@ -123,8 +123,8 @@ namespace AtomSampleViewer
         int m_directionalLightShadowmapSizeIndex = 0;
         int m_cascadeCount = 0;
         float m_ratioLogarithmUniform = 0.f;
-        AZ::Render::ShadowmapSize m_spotLightShadowmapSize = AZ::Render::ShadowmapSize::None;
-        bool m_spotLightShadowEnabled = true;
+        AZ::Render::ShadowmapSize m_diskLightShadowmapSize = AZ::Render::ShadowmapSize::None;
+        bool m_diskLightShadowEnabled = true;
 
         // Edge-softening of directional light shadows
         static const AZ::Render::ShadowFilterMethod s_shadowFilterMethods[];

+ 2 - 2
Gem/Code/Source/DecalExampleComponent.cpp

@@ -33,8 +33,8 @@ namespace AtomSampleViewer
 {
     namespace
     {
-        static constexpr char* TargetMeshName = "objects/plane.azmodel";
-        static constexpr char* TargetMaterialName = "materials/defaultpbr.azmaterial";
+        static constexpr const char* TargetMeshName = "objects/plane.azmodel";
+        static constexpr const char* TargetMaterialName = "materials/defaultpbr.azmaterial";
     }
 
     void DecalExampleComponent::Reflect(AZ::ReflectContext* context)

+ 31 - 79
Gem/Code/Source/LightCullingExampleComponent.cpp

@@ -282,14 +282,6 @@ namespace AtomSampleViewer
         }
     }
 
-    void LightCullingExampleComponent::CreateSpotLights()
-    {
-        for (int i = 0; i < m_settings[(int)LightType::Spot].m_numActive; ++i)
-        {
-            CreateSpotLight(i);
-        }
-    }
-
     void LightCullingExampleComponent::CreateDiskLights()
     {
         for (int i = 0; i < m_settings[(int)LightType::Disk].m_numActive; ++i)
@@ -360,7 +352,6 @@ namespace AtomSampleViewer
         ImGui::Separator();
 
         DrawSidebarPointLightsSection(&m_settings[(int)LightType::Point]);
-        DrawSidebarSpotLightsSection(&m_settings[(int)LightType::Spot]);
         DrawSidebarDiskLightsSection(&m_settings[(int)LightType::Disk]);
         DrawSidebarCapsuleLightSection(&m_settings[(int)LightType::Capsule]);
         DrawSidebarQuadLightsSections(&m_settings[(int)LightType::Quad]);
@@ -384,21 +375,6 @@ namespace AtomSampleViewer
         }
     }
 
-    void LightCullingExampleComponent::DrawSidebarSpotLightsSection(LightSettings* lightSettings)
-    {
-        ScriptableImGui::ScopedNameContext context{"Spot Lights"};
-        if (ImGui::CollapsingHeader("Spot Lights", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed))
-        {
-            m_refreshLights |= ScriptableImGui::SliderInt("Spot light count", &lightSettings->m_numActive, 0, MaxNumLights);
-            m_refreshLights |= ScriptableImGui::SliderFloat("Spot Intensity", &lightSettings->m_intensity, 0.0f, 200.0f);
-            m_refreshLights |= ScriptableImGui::Checkbox("Enable automatic light falloff (Spot)", &lightSettings->m_enableAutomaticFalloff);
-            m_refreshLights |= ScriptableImGui::SliderFloat("Spot Attenuation Radius", &lightSettings->m_attenuationRadius, 0.0f, 20.0f);
-            m_refreshLights |= ScriptableImGui::SliderFloat("Inner Cone (degrees)", &m_spotInnerConeDegrees, 0.0f, 180.0f);
-            m_refreshLights |= ScriptableImGui::SliderFloat("Outer Cone (degrees)", &m_spotOuterConeDegrees, 0.0f, 180.0f);
-            ScriptableImGui::Checkbox("Draw Debug Cones", &lightSettings->m_enableDebugDraws);
-        }
-    }
-
     void LightCullingExampleComponent::DrawSidebarDiskLightsSection(LightSettings* lightSettings)
     {
         ScriptableImGui::ScopedNameContext context{"Disk Lights"};
@@ -408,8 +384,18 @@ namespace AtomSampleViewer
             m_refreshLights |= ScriptableImGui::SliderFloat("Disk Radius", &m_diskRadius, 0.0f, 20.0f);
             m_refreshLights |= ScriptableImGui::SliderFloat("Disk Attenuation Radius", &lightSettings->m_attenuationRadius, 0.0f, 20.0f);
             m_refreshLights |= ScriptableImGui::SliderFloat("Disk Intensity", &lightSettings->m_intensity, 0.0f, 200.0f);
-            m_refreshLights |= ScriptableImGui::Checkbox("Double sided disk", &m_isDiskDoubleSided);
-            ScriptableImGui::Checkbox("Draw disk lights", &lightSettings->m_enableDebugDraws);
+            m_refreshLights |= ScriptableImGui::Checkbox("Enable Disk Cone", &m_diskConesEnabled);
+
+            if (m_diskConesEnabled)
+            {
+                m_refreshLights |= ScriptableImGui::SliderFloat("Inner Cone (degrees)", &m_diskInnerConeDegrees, 0.0f, 180.0f);
+                m_refreshLights |= ScriptableImGui::SliderFloat("Outer Cone (degrees)", &m_diskOuterConeDegrees, 0.0f, 180.0f);
+                ScriptableImGui::Checkbox("Draw Debug Cones", &lightSettings->m_enableDebugDraws);
+            }
+            else
+            {
+                ScriptableImGui::Checkbox("Draw disk lights", &lightSettings->m_enableDebugDraws);
+            }
         }
     }
 
@@ -496,7 +482,12 @@ namespace AtomSampleViewer
         m_diskLightFeatureProcessor->SetPosition(light.m_lightHandle, light.m_position);
         m_diskLightFeatureProcessor->SetRgbIntensity(light.m_lightHandle, PhotometricColor<PhotometricUnit::Candela>(settings.m_intensity * light.m_color));
         m_diskLightFeatureProcessor->SetDirection(light.m_lightHandle, light.m_direction);
-        m_diskLightFeatureProcessor->SetLightEmitsBothDirections(light.m_lightHandle, m_isDiskDoubleSided);
+        
+        m_diskLightFeatureProcessor->SetConstrainToConeLight(light.m_lightHandle, m_diskConesEnabled);
+        if (m_diskConesEnabled)
+        {
+            m_diskLightFeatureProcessor->SetConeAngles(light.m_lightHandle, DegToRad(m_diskInnerConeDegrees), DegToRad(m_diskOuterConeDegrees));
+        }
 
         m_diskLightFeatureProcessor->SetAttenuationRadius(light.m_lightHandle, m_settings[(int)LightType::Disk].m_attenuationRadius);
     }
@@ -537,21 +528,6 @@ namespace AtomSampleViewer
         m_quadLightFeatureProcessor->SetPosition(light.m_lightHandle, light.m_position);
     }
 
-    void LightCullingExampleComponent::CreateSpotLight(int index)
-    {
-        auto& light = m_spotLights[index];
-        light.m_lightHandle = m_spotLightFeatureProcessor->AcquireLight();
-        const LightSettings& settings = m_settings[(int)LightType::Spot];
-
-        m_spotLightFeatureProcessor->SetPosition(light.m_lightHandle, light.m_position);
-        m_spotLightFeatureProcessor->SetDirection(light.m_lightHandle, light.m_direction);
-        m_spotLightFeatureProcessor->SetRgbIntensity(light.m_lightHandle, PhotometricColor<PhotometricUnit::Candela>(settings.m_intensity * light.m_color));
-
-        float attenuationRadius = settings.m_enableAutomaticFalloff ? AutoCalculateAttenuationRadius(light.m_color, settings.m_intensity) : settings.m_attenuationRadius;
-        m_spotLightFeatureProcessor->SetAttenuationRadius(light.m_lightHandle, attenuationRadius);
-        m_spotLightFeatureProcessor->SetConeAngles(light.m_lightHandle, m_spotInnerConeDegrees, m_spotOuterConeDegrees);
-    }
-
     void LightCullingExampleComponent::CreateDecal(int index)
     {
         Decal& decal = m_decals[index];
@@ -593,25 +569,6 @@ namespace AtomSampleViewer
         }
     }
 
-    void LightCullingExampleComponent::DrawSpotLightDebugCones(AZ::RPI::AuxGeomDrawPtr auxGeom)
-    {
-        const LightSettings& settings = m_settings[(int)LightType::Spot];
-        int numToDraw = AZStd::min(settings.m_numActive, aznumeric_cast<int>(m_spotLights.size()));
-        for (int i = 0; i < numToDraw; ++i)
-        {
-            const auto& light = m_spotLights[i];
-            if (light.m_lightHandle.IsNull())
-            {
-                continue;
-            }
-
-            float height = settings.m_enableAutomaticFalloff ? AutoCalculateAttenuationRadius(light.m_color, settings.m_intensity) : settings.m_attenuationRadius;
-            float angleRadians = AZ::DegToRad(m_spotOuterConeDegrees * 0.5f);
-            float radius = tanf(angleRadians) * height;
-            auxGeom->DrawCone(light.m_position + light.m_direction * height, -light.m_direction, radius, height, light.m_color, AZ::RPI::AuxGeomDraw::DrawStyle::Shaded);
-        }
-    }
-
     void LightCullingExampleComponent::DrawDecalDebugBoxes(AZ::RPI::AuxGeomDrawPtr auxGeom)
     {
         int numToDraw = AZStd::min(m_settings[(int)LightType::Decal].m_numActive, aznumeric_cast<int>(m_decals.size()));
@@ -679,10 +636,6 @@ namespace AtomSampleViewer
             {
                 DrawPointLightDebugSpheres(auxGeom);
             }
-            if (m_settings[(int)LightType::Spot].m_enableDebugDraws)
-            {
-                DrawSpotLightDebugCones(auxGeom);
-            }
             if (m_settings[(int)LightType::Disk].m_enableDebugDraws)
             {
                 DrawDiskLightDebugObjects(auxGeom);
@@ -724,35 +677,37 @@ namespace AtomSampleViewer
 
     void LightCullingExampleComponent::InitLightArrays()
     {
-        // Set seed to the same value each time so values are consistent between multiple app runs.
-        // Intended for use with the screenshot comparison tool
-        m_random.SetSeed(0);
-
         const auto InitLight = [this](auto& light)
             {
                 light.m_color = GetRandomColor();
                 light.m_position = GetRandomPositionInsideWorldModel();
                 light.m_direction = GetRandomDirection();
             };
-
+        
+        // Set seed to a specific value for each light type so values are consistent between multiple app runs
+        // And changes to one type don't polute the random numbers for another type.
+        // Intended for use with the screenshot comparison tool
+        m_random.SetSeed(0);
         m_pointLights.resize(MaxNumLights);
         AZStd::for_each(m_pointLights.begin(), m_pointLights.end(), InitLight);
-
-        m_spotLights.resize(MaxNumLights);
-        AZStd::for_each(m_spotLights.begin(), m_spotLights.end(), InitLight);
-
+        
+        m_random.SetSeed(1);
         m_diskLights.resize(MaxNumLights);
         AZStd::for_each(m_diskLights.begin(), m_diskLights.end(), InitLight);
-
+        
+        m_random.SetSeed(2);
         m_capsuleLights.resize(MaxNumLights);
         AZStd::for_each(m_capsuleLights.begin(), m_capsuleLights.end(), InitLight);
+
+        m_random.SetSeed(3);
         m_decals.resize(MaxNumLights);
         AZStd::for_each(m_decals.begin(), m_decals.end(), [&](Decal& decal)
             {
                 decal.m_position = GetRandomPositionInsideWorldModel();
                 decal.m_quaternion = AZ::Quaternion::CreateFromAxisAngle(GetRandomDirection(), GetRandomNumber(0.0f, AZ::Constants::TwoPi));
             });
-
+        
+        m_random.SetSeed(4);
         m_quadLights.resize(MaxNumLights);
         AZStd::for_each(m_quadLights.begin(), m_quadLights.end(), InitLight);
     }
@@ -761,7 +716,6 @@ namespace AtomSampleViewer
     {
         AZ::RPI::Scene* scene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene().get();
         m_pointLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::PointLightFeatureProcessorInterface>();
-        m_spotLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::SpotLightFeatureProcessorInterface>();
         m_diskLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::DiskLightFeatureProcessorInterface>();
         m_capsuleLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::CapsuleLightFeatureProcessorInterface>();
         m_quadLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::QuadLightFeatureProcessorInterface>();
@@ -866,7 +820,6 @@ namespace AtomSampleViewer
     void LightCullingExampleComponent::DestroyLightsAndDecals()
     {
         DestroyLights(m_pointLightFeatureProcessor, m_pointLights);
-        DestroyLights(m_spotLightFeatureProcessor, m_spotLights);
         DestroyLights(m_diskLightFeatureProcessor, m_diskLights);
         DestroyLights(m_capsuleLightFeatureProcessor, m_capsuleLights);
         DestroyLights(m_quadLightFeatureProcessor, m_quadLights);
@@ -876,7 +829,6 @@ namespace AtomSampleViewer
     void LightCullingExampleComponent::CreateLightsAndDecals()
     {
         CreatePointLights();
-        CreateSpotLights();
         CreateDiskLights();
         CreateCapsuleLights();
         CreateQuadLights();

+ 4 - 14
Gem/Code/Source/LightCullingExampleComponent.h

@@ -24,7 +24,6 @@
 
 #include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/PointLightFeatureProcessorInterface.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/CapsuleLightFeatureProcessorInterface.h>
 #include <Atom/Feature/Decals/DecalFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/QuadLightFeatureProcessorInterface.h>
@@ -65,7 +64,6 @@ namespace AtomSampleViewer
         enum class LightType
         {
             Point,
-            Spot,
             Disk,
             Capsule,
             Quad,
@@ -83,7 +81,6 @@ namespace AtomSampleViewer
         };
 
         using PointLightHandle = AZ::Render::PointLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
         using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
         using CapsuleLightHandle = AZ::Render::CapsuleLightFeatureProcessorInterface::LightHandle;
         using QuadLightHandle = AZ::Render::QuadLightFeatureProcessorInterface::LightHandle;
@@ -105,7 +102,6 @@ namespace AtomSampleViewer
 
         void DrawDebuggingHelpers();
         void DrawPointLightDebugSpheres(AZ::RPI::AuxGeomDrawPtr auxGeom);
-        void DrawSpotLightDebugCones(AZ::RPI::AuxGeomDrawPtr auxGeom);
         void DrawDiskLightDebugObjects(AZ::RPI::AuxGeomDrawPtr auxGeom);
         void DrawCapsuleLightDebugObjects(AZ::RPI::AuxGeomDrawPtr auxGeom);
         void DrawDecalDebugBoxes(AZ::RPI::AuxGeomDrawPtr auxGeom);
@@ -125,9 +121,6 @@ namespace AtomSampleViewer
         void CreatePointLights();
         void CreatePointLight(int index);
 
-        void CreateSpotLights();
-        void CreateSpotLight(int index);
-
         void CreateDiskLights();
         void CreateDiskLight(int index);
 
@@ -157,7 +150,6 @@ namespace AtomSampleViewer
         void DestroyLightsAndDecals();
 
         void DrawSidebarPointLightsSection(LightSettings* lightSettings);
-        void DrawSidebarSpotLightsSection(LightSettings* lightSettings);
         void DrawSidebarDiskLightsSection(LightSettings* lightSettings);
         void DrawSidebarCapsuleLightSection(LightSettings* lightSettings);
         void DrawSidebarDecalSection(LightSettings* lightSettings);
@@ -193,7 +185,6 @@ namespace AtomSampleViewer
         AZStd::array<LightSettings, (size_t)LightType::Count> m_settings;
 
         AZStd::vector<Light<PointLightHandle>> m_pointLights;
-        AZStd::vector<Light<SpotLightHandle>> m_spotLights;
         AZStd::vector<Light<DiskLightHandle>> m_diskLights;
         AZStd::vector<Light<CapsuleLightHandle>> m_capsuleLights;
         AZStd::vector<Light<QuadLightHandle>> m_quadLights;
@@ -217,14 +208,14 @@ namespace AtomSampleViewer
         float m_smoothedFPS = 0.0f;
         float m_bulbRadius = 3.0f;
 
-        float m_spotInnerConeDegrees = 22.0f;
-        float m_spotOuterConeDegrees = 90.0f;
-
+        bool m_diskConesEnabled = false;
+        float m_diskInnerConeDegrees = 22.0f;
+        float m_diskOuterConeDegrees = 90.0f;
+        
         float m_capsuleRadius = 0.1f;
         float m_capsuleLength = 3.0f;
 
         float m_diskRadius = 3.0f;
-        bool m_isDiskDoubleSided = false;
         bool m_isQuadLightDoubleSided = false;
         bool m_quadLightsUseFastApproximation = false;
 
@@ -240,7 +231,6 @@ namespace AtomSampleViewer
         AZ::Data::Asset<AZ::Data::AssetData> m_decalMaterial;
 
         AZ::Render::PointLightFeatureProcessorInterface* m_pointLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
         AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         AZ::Render::CapsuleLightFeatureProcessorInterface* m_capsuleLightFeatureProcessor = nullptr;
         AZ::Render::QuadLightFeatureProcessorInterface* m_quadLightFeatureProcessor = nullptr;

+ 14 - 3
Gem/Code/Source/MaterialHotReloadTestComponent.cpp

@@ -162,6 +162,7 @@ namespace AtomSampleViewer
         DeleteTestFile(Sources::ShaderVariantListFileName);
 
         m_initStatus = InitStatus::ClearingTestAssets;
+        m_clearAssetsTimeout = 5.0f;
 
         // Wait until the test material is fully initialized. Use a long timeout because it can take a while for the shaders to compile.
         ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::PauseScriptWithTimeout, LongTimeout);
@@ -368,13 +369,23 @@ namespace AtomSampleViewer
     {
         if (m_initStatus == InitStatus::ClearingTestAssets)
         {
+            m_clearAssetsTimeout -= deltaTime;
+
             Data::AssetId materialAssetId = GetAssetId(Products::MaterialFilePath);
             Data::AssetId materialTypeAssetId = GetAssetId(Products::MaterialTypeFilePath);
             Data::AssetId shaderAssetId = GetAssetId(Products::ShaderFilePath);
 
-            if (!materialAssetId.IsValid() &&
-                !materialTypeAssetId.IsValid() &&
-                !shaderAssetId.IsValid())
+            bool proceed = !materialAssetId.IsValid() && !materialTypeAssetId.IsValid() && !shaderAssetId.IsValid();
+
+            if (!proceed && m_clearAssetsTimeout < 0)
+            {
+                // There was a specific bug in the Asset Processor where deleting a source file does not always remove the corresponding product
+                // from the cache and from the asset database.
+                AZ_Error("MaterialHotReloadTestComponent", false, "Timed out while waiting for test assets to be removed.");
+                proceed = true;
+            }
+
+            if (proceed)
             {
                 // [GFX TODO] [ATOM-5899] Once this ticket is addressed, This block can call all required CopyTestFile() at once,
                 //            and the states InitStatus::CopyingDefault***TestFile won't be needed.

+ 2 - 0
Gem/Code/Source/MaterialHotReloadTestComponent.h

@@ -113,5 +113,7 @@ namespace AtomSampleViewer
         AZ::Data::Instance<AZ::RPI::Material>  m_shaderVariantIndicatorMaterial_current;
 
         FileIOErrorHandler m_fileIoErrorHandler;
+
+        float m_clearAssetsTimeout = 0.0f;
     };
 } // namespace AtomSampleViewer

+ 19 - 18
Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp

@@ -77,7 +77,7 @@ namespace AtomSampleViewer
         m_scene = RPI::RPISystemInterface::Get()->GetDefaultScene();
 
         // Save references of different feature processors
-        m_spotLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::SpotLightFeatureProcessorInterface>();
+        m_diskLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::DiskLightFeatureProcessorInterface>();
         m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::DirectionalLightFeatureProcessorInterface>();
         m_skyboxFeatureProcessor = m_scene->GetFeatureProcessor<AZ::Render::SkyBoxFeatureProcessorInterface>();
         m_postProcessFeatureProcessor = m_scene->GetFeatureProcessor<AZ::Render::PostProcessFeatureProcessorInterface>();
@@ -156,9 +156,9 @@ namespace AtomSampleViewer
         {
             AddDirectionalLight();
         }
-        if (m_hasSpotLight)
+        if (m_hasDiskLight)
         {
-            AddSpotLight();
+            AddDiskLight();
         }
         if (m_enabledSkybox)
         {
@@ -247,31 +247,32 @@ namespace AtomSampleViewer
         }
     }
 
-    void MultiRenderPipelineExampleComponent::AddSpotLight()
+    void MultiRenderPipelineExampleComponent::AddDiskLight()
     {
-        Render::SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
+        Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
 
-        const SpotLightHandle handle = featureProcessor->AcquireLight();
+        const DiskLightHandle handle = featureProcessor->AcquireLight();
 
         AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(Colors::Green * 500.0f);
         featureProcessor->SetRgbIntensity(handle, lightColor);
         featureProcessor->SetAttenuationRadius(handle, 30.0f);
-        featureProcessor->SetConeAngles(handle, 35*0.9f, 35);
-        featureProcessor->SetShadowmapSize(handle, Render::ShadowmapSize::Size1024);
+        featureProcessor->SetConeAngles(handle, DegToRad(35.0f * 0.9f), DegToRad(35.0f));
+        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_spotLightHandle = handle;
+        m_diskLightHandle = handle;
     }
 
-    void MultiRenderPipelineExampleComponent::RemoveSpotLight()
+    void MultiRenderPipelineExampleComponent::RemoveDiskLight()
     {
-        if (m_spotLightHandle.IsValid())
+        if (m_diskLightHandle.IsValid())
         {
-            m_spotLightFeatureProcessor->ReleaseLight(m_spotLightHandle);
+            m_diskLightFeatureProcessor->ReleaseLight(m_diskLightHandle);
         }
     }
 
@@ -386,7 +387,7 @@ namespace AtomSampleViewer
     {
         RemoveIBL();
         DisableSkybox();
-        RemoveSpotLight();
+        RemoveDiskLight();
         RemoveDirectionalLight();
         DisableDepthOfField();
 
@@ -407,7 +408,7 @@ namespace AtomSampleViewer
         CleanUpScene();
 
         m_directionalLightFeatureProcessor = nullptr;
-        m_spotLightFeatureProcessor = nullptr;
+        m_diskLightFeatureProcessor = nullptr;
         m_skyboxFeatureProcessor = nullptr;
         m_scene = nullptr;
     }
@@ -538,15 +539,15 @@ namespace AtomSampleViewer
                 ImGui::Unindent();
             }
 
-            if (ScriptableImGui::Checkbox("Add/Remove Spot Light", &m_hasSpotLight))
+            if (ScriptableImGui::Checkbox("Add/Remove Spot Light", &m_hasDiskLight))
             {
-                if (m_hasSpotLight)
+                if (m_hasDiskLight)
                 {
-                    AddSpotLight();
+                    AddDiskLight();
                 }
                 else
                 {
-                    RemoveSpotLight();
+                    RemoveDiskLight();
                 }
             }
 

+ 8 - 8
Gem/Code/Source/MultiRenderPipelineExampleComponent.h

@@ -24,7 +24,7 @@
 #include <AzFramework/Windowing/NativeWindow.h>
 
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/ShadowConstants.h>
 #include <Atom/Feature/SkyBox/SkyBoxFeatureProcessorInterface.h>
 #include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
@@ -78,8 +78,8 @@ namespace AtomSampleViewer
         void AddDirectionalLight();
         void RemoveDirectionalLight();
 
-        void AddSpotLight();
-        void RemoveSpotLight();
+        void AddDiskLight();
+        void RemoveDiskLight();
 
         void EnableSkybox();
         void DisableSkybox();
@@ -95,15 +95,15 @@ namespace AtomSampleViewer
         
         // For scene content
         using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
+        using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
         using MeshHandle = AZ::Render::MeshFeatureProcessorInterface::MeshHandle;
 
         // Directional light
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
         DirectionalLightHandle m_directionalLightHandle;
-        // Spot light
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
-        SpotLightHandle m_spotLightHandle;
+        // Disk light
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
+        DiskLightHandle m_diskLightHandle;
         // Meshes
         MeshHandle m_floorMeshHandle;
 
@@ -120,7 +120,7 @@ namespace AtomSampleViewer
         // flags of features enabled
         bool m_enabledDepthOfField = true;
         bool m_hasDirectionalLight = true;
-        bool m_hasSpotLight = true;
+        bool m_hasDiskLight = true;
         bool m_enabledSkybox = true;
         bool m_hasIBL = true;
         bool m_enableSecondRenderPipeline = true;

+ 16 - 14
Gem/Code/Source/MultiSceneExampleComponent.cpp

@@ -82,8 +82,9 @@ namespace AtomSampleViewer
         sceneDesc.m_featureProcessorNames.push_back("AZ::Render::QuadLightFeatureProcessor");
         sceneDesc.m_featureProcessorNames.push_back("ReflectionProbeFeatureProcessor");
         sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SkyBoxFeatureProcessor");
-        sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SpotLightFeatureProcessor");
+        sceneDesc.m_featureProcessorNames.push_back("AZ::Render::DiskLightFeatureProcessor");
         sceneDesc.m_featureProcessorNames.push_back("AZ::Render::TransformServiceFeatureProcessor");
+        sceneDesc.m_featureProcessorNames.push_back("AZ::Render::ProjectedShadowFeatureProcessor");
         m_scene = RPI::Scene::CreateScene(sceneDesc);
 
         // Setup scene srg modification callback (to push per-frame values to the shaders)
@@ -143,7 +144,7 @@ namespace AtomSampleViewer
         m_meshFeatureProcessor = m_scene->GetFeatureProcessor<Render::MeshFeatureProcessorInterface>();
         m_skyBoxFeatureProcessor = m_scene->GetFeatureProcessor<Render::SkyBoxFeatureProcessorInterface>();
         m_pointLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::PointLightFeatureProcessorInterface>();
-        m_spotLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::SpotLightFeatureProcessorInterface>();
+        m_diskLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::DiskLightFeatureProcessorInterface>();
         m_directionalLightFeatureProcessor = m_scene->GetFeatureProcessor<Render::DirectionalLightFeatureProcessorInterface>();
         m_reflectionProbeFeatureProcessor = m_scene->GetFeatureProcessor<Render::ReflectionProbeFeatureProcessorInterface>();
         m_postProcessFeatureProcessor = m_scene->GetFeatureProcessor<Render::PostProcessFeatureProcessorInterface>();
@@ -214,26 +215,27 @@ namespace AtomSampleViewer
             m_pointLightFeatureProcessor->SetBulbRadius(m_pointLightHandle, 4.0f);
         }
 
-        // Create SpotLight
+        // Create DiskLight
         {
-            m_spotLightHandle = m_spotLightFeatureProcessor->AcquireLight();
+            m_diskLightHandle = m_diskLightFeatureProcessor->AcquireLight();
 
-            const Vector3 spotLightPosition(3.0f, 0.0f, 4.0f);
-            m_spotLightFeatureProcessor->SetPosition(m_spotLightHandle, spotLightPosition);
+            const Vector3 diskLightPosition(3.0f, 0.0f, 4.0f);
+            m_diskLightFeatureProcessor->SetPosition(m_diskLightHandle, diskLightPosition);
 
             Render::PhotometricValue rgbIntensity;
-            m_spotLightFeatureProcessor->SetRgbIntensity(m_spotLightHandle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(Color::CreateOne() * 2000.0f));
+            m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, Render::PhotometricColor<Render::PhotometricUnit::Candela>(Color::CreateOne() * 2000.0f));
 
             const auto lightDir = Transform::CreateLookAt(
-                spotLightPosition,
+                diskLightPosition,
                 Vector3::CreateZero());
-            m_spotLightFeatureProcessor->SetDirection(m_spotLightHandle, lightDir.GetBasis(1));
+            m_diskLightFeatureProcessor->SetDirection(m_diskLightHandle, lightDir.GetBasis(1));
 
             const float radius = sqrtf(2000.0f / 0.5f);
-            m_spotLightFeatureProcessor->SetAttenuationRadius(m_spotLightHandle, radius);
-            m_spotLightFeatureProcessor->SetShadowmapSize(m_spotLightHandle, Render::ShadowmapSize::Size512);
-            m_spotLightFeatureProcessor->SetConeAngles(m_spotLightHandle, 45.f, 55.f);
-            m_spotLightFeatureProcessor->SetShadowBoundaryWidthAngle(m_spotLightHandle, 0.25f);
+            m_diskLightFeatureProcessor->SetAttenuationRadius(m_diskLightHandle, radius);
+            m_diskLightFeatureProcessor->SetShadowsEnabled(m_diskLightHandle, true);
+            m_diskLightFeatureProcessor->SetShadowmapMaxResolution(m_diskLightHandle, Render::ShadowmapSize::Size512);
+            m_diskLightFeatureProcessor->SetConeAngles(m_diskLightHandle, DegToRad(45.0f), DegToRad(55.0f));
+            m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(m_diskLightHandle, DegToRad(0.25f));
         }
 
         // Create DirectionalLight
@@ -324,7 +326,7 @@ namespace AtomSampleViewer
 
         // Release all the light types
         m_pointLightFeatureProcessor->ReleaseLight(m_pointLightHandle);
-        m_spotLightFeatureProcessor->ReleaseLight(m_spotLightHandle);
+        m_diskLightFeatureProcessor->ReleaseLight(m_diskLightHandle);
         m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle);
 
         // Release the probe

+ 4 - 4
Gem/Code/Source/MultiSceneExampleComponent.h

@@ -24,7 +24,7 @@
 #include <AzFramework/Windowing/NativeWindow.h>
 
 #include <Atom/Feature/CoreLights/PointLightFeatureProcessorInterface.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
 #include <Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessorInterface.h>
 #include <Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessor.h>
@@ -41,7 +41,7 @@ namespace AtomSampleViewer
     {
         using ModelChangedHandler = AZ::Render::MeshFeatureProcessorInterface::ModelChangedEvent::Handler;
         using PointLightHandle = AZ::Render::PointLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
+        using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
         using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle;
         using ReflectinoProbeHandle = AZ::Render::ReflectionProbeHandle;
 
@@ -81,7 +81,7 @@ namespace AtomSampleViewer
         AZ::Render::MeshFeatureProcessorInterface* m_meshFeatureProcessor = nullptr;
         AZ::Render::SkyBoxFeatureProcessorInterface* m_skyBoxFeatureProcessor = nullptr;
         AZ::Render::PointLightFeatureProcessorInterface* m_pointLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
         AZ::Render::PostProcessFeatureProcessorInterface* m_postProcessFeatureProcessor = nullptr;
         AZ::Render::ReflectionProbeFeatureProcessorInterface* m_reflectionProbeFeatureProcessor = nullptr;
@@ -95,7 +95,7 @@ namespace AtomSampleViewer
 
         // Various FeatureProcessor handles
         PointLightHandle m_pointLightHandle;
-        SpotLightHandle m_spotLightHandle;
+        DiskLightHandle m_diskLightHandle;
         DirectionalLightHandle m_directionalLightHandle;
         ReflectinoProbeHandle m_reflectionProbeHandle;
 

+ 17 - 16
Gem/Code/Source/ParallaxMappingExampleComponent.cpp

@@ -121,8 +121,8 @@ namespace AtomSampleViewer
         AZ::RPI::Scene* scene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene().get();
         m_directionalLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::DirectionalLightFeatureProcessorInterface>();
         CreateDirectionalLight();
-        m_spotLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::SpotLightFeatureProcessorInterface>();
-        CreateSpotLight();
+        m_diskLightFeatureProcessor = scene->GetFeatureProcessor<AZ::Render::DiskLightFeatureProcessorInterface>();
+        CreateDiskLight();
 
         m_imguiSidebar.Activate();
         AZ::TickBus::Handler::BusConnect();
@@ -139,7 +139,7 @@ namespace AtomSampleViewer
             &AZ::Debug::CameraControllerRequestBus::Events::Disable);
 
         m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle);
-        m_spotLightFeatureProcessor->ReleaseLight(m_spotLightHandle);
+        m_diskLightFeatureProcessor->ReleaseLight(m_diskLightHandle);
 
         m_imguiSidebar.Deactivate();
         AZ::TickBus::Handler::BusDisconnect();
@@ -180,16 +180,17 @@ namespace AtomSampleViewer
         m_directionalLightHandle = handle;
     }
 
-    void ParallaxMappingExampleComponent::CreateSpotLight()
+    void ParallaxMappingExampleComponent::CreateDiskLight()
     {
-        AZ::Render::SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
-        const AZ::Render::SpotLightFeatureProcessorInterface::LightHandle handle = featureProcessor->AcquireLight();
+        AZ::Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
+        const AZ::Render::DiskLightFeatureProcessorInterface::LightHandle handle = featureProcessor->AcquireLight();
 
-        featureProcessor->SetAttenuationRadius( handle, sqrtf(500.f / CutoffIntensity));
-        featureProcessor->SetConeAngles( handle, 45.f * ConeAngleInnerRatio, 45.f);
-        featureProcessor->SetShadowmapSize( handle, AZ::Render::ShadowmapSize::Size2048);
+        featureProcessor->SetAttenuationRadius(handle, sqrtf(500.f / CutoffIntensity));
+        featureProcessor->SetConeAngles(handle, AZ::DegToRad(45.0f) * ConeAngleInnerRatio, AZ::DegToRad(45.0f));
+        featureProcessor->SetShadowsEnabled(handle, true);
+        featureProcessor->SetShadowmapMaxResolution(handle, AZ::Render::ShadowmapSize::Size2048);
 
-        m_spotLightHandle = handle;
+        m_diskLightHandle = handle;
         
     }
 
@@ -211,20 +212,20 @@ namespace AtomSampleViewer
         if (m_lightType)
         {
             AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Lux> directionalLightColor(AZ::Color::CreateZero());
-            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> spotLightColor(AZ::Color::CreateOne() * 500.f);
+            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> diskLightColor(AZ::Color::CreateOne() * 500.f);
             m_directionalLightFeatureProcessor->SetRgbIntensity(m_directionalLightHandle, directionalLightColor);
-            m_spotLightFeatureProcessor->SetRgbIntensity(m_spotLightHandle, spotLightColor);
+            m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, diskLightColor);
         }
         else
         {
             AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Lux> directionalLightColor(AZ::Color::CreateOne() * 5.f);
-            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> spotLightColor(AZ::Color::CreateZero());
+            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> diskLightColor(AZ::Color::CreateZero());
             m_directionalLightFeatureProcessor->SetRgbIntensity(m_directionalLightHandle, directionalLightColor);
-            m_spotLightFeatureProcessor->SetRgbIntensity(m_spotLightHandle, spotLightColor);
+            m_diskLightFeatureProcessor->SetRgbIntensity(m_diskLightHandle, diskLightColor);
         }
 
-        m_spotLightFeatureProcessor->SetPosition(m_spotLightHandle, location);
-        m_spotLightFeatureProcessor->SetDirection(m_spotLightHandle, transform.GetBasis(1));
+        m_diskLightFeatureProcessor->SetPosition(m_diskLightHandle, location);
+        m_diskLightFeatureProcessor->SetDirection(m_diskLightHandle, transform.GetBasis(1));
         m_directionalLightFeatureProcessor->SetDirection(m_directionalLightHandle, transform.GetBasis(1));
 
         // Camera Configuration

+ 5 - 5
Gem/Code/Source/ParallaxMappingExampleComponent.h

@@ -13,7 +13,7 @@
 #pragma once
 #include <CommonSampleComponentBase.h>
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <AzCore/Component/TickBus.h>
 
 #include <Utils/ImGuiSidebar.h>
@@ -50,7 +50,7 @@ namespace AtomSampleViewer
             AZ::Data::Instance<AZ::RPI::Material> material,
             AZ::Transform transform);
         void CreateDirectionalLight();
-        void CreateSpotLight();
+        void CreateDiskLight();
         void DrawSidebar();
 
         void SaveCameraConfiguration();
@@ -64,13 +64,13 @@ namespace AtomSampleViewer
 
         // Light
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle m_directionalLightHandle;
-        AZ::Render::SpotLightFeatureProcessorInterface::LightHandle m_spotLightHandle;
+        AZ::Render::DiskLightFeatureProcessorInterface::LightHandle m_diskLightHandle;
 
         float m_lightRotationAngle = 0.f; // in radian
         bool m_lightAutoRotate = true;
-        int m_lightType = 0; // 0: diectionalLight, 1: spotLight
+        int m_lightType = 0; // 0: diectionalLight, 1: diskLight
 
         //Assets
         AZ::Data::Asset<AZ::RPI::ModelAsset> m_planeAsset;

+ 6 - 6
Gem/Code/Source/RHI/MRTExampleComponent.cpp

@@ -74,7 +74,7 @@ namespace AtomSampleViewer
     }
 
     void MRTExampleComponent::Activate()
-    {   
+    {
         // Init buffers & views
         CreateInputAssemblyBuffersAndViews();
         // Init render targets
@@ -85,7 +85,7 @@ namespace AtomSampleViewer
 
         CreateRenderTargetScope();
         CreateScreenScope();
-        
+
         AZ::RHI::RHISystemNotificationBus::Handler::BusConnect();
     }
 
@@ -110,7 +110,7 @@ namespace AtomSampleViewer
         auto shader = LoadShader(MRTTargetShaderFilePath, sampleName);
         if (shader == nullptr)
             return;
-        
+
         RHI::PipelineStateDescriptorForDraw pipelineDesc;
         shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId).ConfigurePipelineState(pipelineDesc);
         pipelineDesc.m_inputStreamLayout = m_inputStreamLayout;
@@ -120,7 +120,7 @@ namespace AtomSampleViewer
             ->RenderTargetAttachment(RHI::Format::R8G8B8A8_UNORM_SRGB)
             ->RenderTargetAttachment(RHI::Format::R16G16_FLOAT)
             ->RenderTargetAttachment(RHI::Format::R32_FLOAT);
-        [[maybe_unused]] RHI::ResultCode [[maybe_unused]] result = attachmentsBuilder.End(pipelineDesc.m_renderAttachmentConfiguration.m_renderAttachmentLayout);
+        [[maybe_unused]] RHI::ResultCode result = attachmentsBuilder.End(pipelineDesc.m_renderAttachmentConfiguration.m_renderAttachmentLayout);
         AZ_Assert(result == RHI::ResultCode::Success, "Failed to create render attachment layout");
 
         m_pipelineStates[0] = shader->AcquirePipelineState(pipelineDesc);
@@ -327,7 +327,7 @@ namespace AtomSampleViewer
         using namespace AZ;
 
         const auto prepareFunctionScreen = [this](RHI::FrameGraphInterface frameGraph, [[maybe_unused]] ScopeData& scopeData)
-        {            
+        {
             // Binds the swap chain as a color attachment. Clears it to white.
             {
                 RHI::ImageScopeAttachmentDescriptor descriptor;
@@ -361,7 +361,7 @@ namespace AtomSampleViewer
         };
 
         const auto executeFunctionScreen = [this](const RHI::FrameGraphExecuteContext& context, [[maybe_unused]] const ScopeData& scopeData)
-        {            
+        {
             RHI::CommandList* commandList = context.GetCommandList();
 
             // Set persistent viewport and scissor state.

+ 2 - 3
Gem/Code/Source/SampleComponentManager.cpp

@@ -282,7 +282,6 @@ namespace AtomSampleViewer
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/Parallax", azrtti_typeid<ParallaxMappingExampleComponent>() ));
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/Shadow", azrtti_typeid<ShadowExampleComponent>() ));
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/ShadowedBistro", azrtti_typeid<ShadowedBistroExampleComponent>() ));
-        SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/SkinnedMesh", azrtti_typeid<SkinnedMeshExampleComponent>() ));
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/SSAO", azrtti_typeid<SsaoExampleComponent>()));
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/SSR", azrtti_typeid<SSRExampleComponent>()));
         SampleComponentManager::RegisterSampleComponent(SampleEntry::NewRPISample( "Features/Tonemapping", azrtti_typeid<TonemappingExampleComponent>() ));
@@ -1087,7 +1086,7 @@ namespace AtomSampleViewer
         {
             AZ::Render::ImGuiSystemRequestBus::Broadcast(&AZ::Render::ImGuiSystemRequestBus::Events::HideAllImGuiPasses);
 
-            // We also hide lumberyard's debug text
+            // We also hide Open 3D Engine's debug text
             AzFramework::ConsoleRequestBus::Broadcast(&AzFramework::ConsoleRequests::ExecuteConsoleCommand, "r_DisplayInfo 0");
             // The ExecuteConsoleCommand request is handled in a deferred manner, so we have to delay the screenshot a bit.
             m_countdownForFrameCapture = 1;
@@ -1106,7 +1105,7 @@ namespace AtomSampleViewer
         {
             AZ::Render::ImGuiSystemRequestBus::Broadcast(&AZ::Render::ImGuiSystemRequestBus::Events::ShowAllImGuiPasses);
 
-            // We also show lumberyard's debug text
+            // We also show Open 3D Engine's debug text
             AzFramework::ConsoleRequestBus::Broadcast(&AzFramework::ConsoleRequests::ExecuteConsoleCommand, "r_DisplayInfo 1");
         }
 

+ 87 - 89
Gem/Code/Source/ShadowExampleComponent.cpp

@@ -39,7 +39,7 @@ namespace AtomSampleViewer
     };
 
     const AZ::Color ShadowExampleComponent::DirectionalLightColor = AZ::Color::CreateOne();
-    AZ::Color ShadowExampleComponent::s_spotLightColors[] = {
+    AZ::Color ShadowExampleComponent::s_diskLightColors[] = {
         // they will be initialized in the constructor.
         AZ::Color::CreateZero(),
         AZ::Color::CreateZero(),
@@ -77,9 +77,9 @@ namespace AtomSampleViewer
     ShadowExampleComponent::ShadowExampleComponent()
         : m_imguiSidebar("@user@/ShadowExampleComponent/sidebar.xml")
     {
-        s_spotLightColors[0] = AZ::Colors::Red;
-        s_spotLightColors[1] = AZ::Colors::Green;
-        s_spotLightColors[2] = AZ::Colors::Blue;
+        s_diskLightColors[0] = AZ::Colors::Red;
+        s_diskLightColors[1] = AZ::Colors::Green;
+        s_diskLightColors[2] = AZ::Colors::Blue;
     }
 
     void ShadowExampleComponent::Reflect(AZ::ReflectContext* context)
@@ -123,9 +123,9 @@ namespace AtomSampleViewer
         m_floorMeshIsReady = false;
 
         m_directionalLightImageSizeIndex = 2; // image size is 1024.
-        for (uint32_t index = 0; index < SpotLightCount; ++index)
+        for (uint32_t index = 0; index < DiskLightCount; ++index)
         {
-            m_spotLightImageSizeIndices[index] = 2; // image size is 1024.
+            m_diskLightImageSizeIndices[index] = 2; // image size is 1024.
         }
         m_cascadeCount = 2;
         m_ratioLogarithmUniform = 0.5f;
@@ -134,11 +134,11 @@ namespace AtomSampleViewer
 
         RPI::Scene* scene = RPI::RPISystemInterface::Get()->GetDefaultScene().get();
         m_directionalLightFeatureProcessor = scene->GetFeatureProcessor<Render::DirectionalLightFeatureProcessorInterface>();
-        m_spotLightFeatureProcessor = scene->GetFeatureProcessor<Render::SpotLightFeatureProcessorInterface>();
+        m_diskLightFeatureProcessor = scene->GetFeatureProcessor<Render::DiskLightFeatureProcessorInterface>();
 
         CreateMeshes();
         CreateDirectionalLight();
-        CreateSpotLights();
+        CreateDiskLights();
 
         m_elapsedTime = 0.f;
         m_imguiSidebar.Activate();
@@ -156,9 +156,9 @@ namespace AtomSampleViewer
         GetMeshFeatureProcessor()->ReleaseMesh(m_bunnyMeshHandle);
 
         m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle);
-        for (SpotLightHandle& handle : m_spotLightHandles)
+        for (DiskLightHandle& handle : m_diskLightHandles)
         {
-            m_spotLightFeatureProcessor->ReleaseLight(handle);
+            m_diskLightFeatureProcessor->ReleaseLight(handle);
         }
 
         m_imguiSidebar.Deactivate();
@@ -168,9 +168,9 @@ namespace AtomSampleViewer
     {
         using namespace AZ;
         constexpr float directionalLightPeriodTime = 5.f; // 5 seconds for a rotation of directional light position.
-        constexpr float spotLightPeriodTime = 7.f; // 7 seconds for a rotation of spot light positions.
+        constexpr float diskLightPeriodTime = 7.f; // 7 seconds for a rotation of disk light positions.
         constexpr float directionalLightDist = 10.f;
-        constexpr float spotLightDist = 5.f;
+        constexpr float diskLightDist = 5.f;
 
         if (m_elapsedTime == 0.f)
         {
@@ -185,9 +185,9 @@ namespace AtomSampleViewer
         {
             m_directionalLightRotationAngle = fmodf(m_directionalLightRotationAngle + deltaTime * Constants::TwoPi / directionalLightPeriodTime, Constants::TwoPi);
         }
-        if (m_isSpotLightAutoRotate)
+        if (m_isDiskLightAutoRotate)
         {
-            m_spotLightRotationAngle = fmodf(m_spotLightRotationAngle - deltaTime * Constants::TwoPi / spotLightPeriodTime + Constants::TwoPi, Constants::TwoPi);
+            m_diskLightRotationAngle = fmodf(m_diskLightRotationAngle - deltaTime * Constants::TwoPi / diskLightPeriodTime + Constants::TwoPi, Constants::TwoPi);
         }
 
         // Directional Light Transform
@@ -202,19 +202,19 @@ namespace AtomSampleViewer
             m_directionalLightFeatureProcessor->SetDirection(m_directionalLightHandle, lightTransform.GetBasis(1));
         }
 
-        // Spot Lights Transform
-        for (uint32_t index = 0; index < SpotLightCount; ++index)
+        // Disk Lights Transform
+        for (uint32_t index = 0; index < DiskLightCount; ++index)
         { 
-            const float angle = m_spotLightRotationAngle + index * Constants::TwoPi / 3;
+            const float angle = m_diskLightRotationAngle + index * Constants::TwoPi / 3;
             const auto location = Vector3(
-                spotLightDist * sinf(angle),
-                spotLightDist * cosf(angle),
-                m_spotLightHeights[index]);
+                diskLightDist * sinf(angle),
+                diskLightDist * cosf(angle),
+                m_diskLightHeights[index]);
             const auto transform = Transform::CreateLookAt(
                 location,
                 Vector3::CreateZero());
-            m_spotLightFeatureProcessor->SetPosition(m_spotLightHandles[index], location);
-            m_spotLightFeatureProcessor->SetDirection(m_spotLightHandles[index], transform.GetBasis(1));
+            m_diskLightFeatureProcessor->SetPosition(m_diskLightHandles[index], location);
+            m_diskLightFeatureProcessor->SetDirection(m_diskLightHandles[index], transform.GetBasis(1));
         }
 
         Camera::CameraRequestBus::Event(
@@ -399,35 +399,35 @@ namespace AtomSampleViewer
         SetupDebugFlags();
     }
 
-    void ShadowExampleComponent::CreateSpotLights()
+    void ShadowExampleComponent::CreateDiskLights()
     {
         using namespace AZ;
-        Render::SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
+        Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
 
-        for (uint32_t index = 0; index < SpotLightCount; ++index)
+        for (uint32_t index = 0; index < DiskLightCount; ++index)
         {
-            const SpotLightHandle handle = featureProcessor->AcquireLight();
+            const DiskLightHandle handle = featureProcessor->AcquireLight();
 
-            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(s_spotLightColors[index] * m_spotLightIntensities[index]);
+            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(s_diskLightColors[index] * m_diskLightIntensities[index]);
             featureProcessor->SetRgbIntensity(handle, lightColor);
             featureProcessor->SetAttenuationRadius(
                 handle,
-                sqrtf(m_spotLightIntensities[index] / CutoffIntensity));
+                sqrtf(m_diskLightIntensities[index] / CutoffIntensity));
             featureProcessor->SetConeAngles(
                 handle,
-                m_outerConeAngles[index] * ConeAngleInnerRatio,
-                m_outerConeAngles[index]);
-            featureProcessor->SetShadowmapSize(
-                handle,
-                m_spotLightShadowEnabled[index] ?
-                s_shadowmapImageSizes[m_spotLightImageSizeIndices[index]] :
-                Render::ShadowmapSize::None);
-            featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndicesSpot[index]]);
-            featureProcessor->SetShadowBoundaryWidthAngle(handle, m_boundaryWidthsSpot[index]);
-            featureProcessor->SetPredictionSampleCount(handle, m_predictionSampleCountsSpot[index]);
-            featureProcessor->SetFilteringSampleCount(handle, m_filteringSampleCountsSpot[index]);
-            featureProcessor->SetPcfMethod(handle, m_pcfMethod[index]);
-            m_spotLightHandles[index] = handle;
+                DegToRad(m_outerConeAngles[index]) * ConeAngleInnerRatio,
+                DegToRad(m_outerConeAngles[index]));
+            featureProcessor->SetShadowsEnabled(handle, m_diskLightShadowEnabled[index]);
+            if (m_diskLightShadowEnabled[index])
+            {
+                featureProcessor->SetShadowmapMaxResolution(handle, s_shadowmapImageSizes[m_diskLightImageSizeIndices[index]]);
+                featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndicesDisk[index]]);
+                featureProcessor->SetSofteningBoundaryWidthAngle(handle, AZ::DegToRad(m_boundaryWidthsDisk[index]));
+                featureProcessor->SetPredictionSampleCount(handle, m_predictionSampleCountsDisk[index]);
+                featureProcessor->SetFilteringSampleCount(handle, m_filteringSampleCountsDisk[index]);
+                featureProcessor->SetPcfMethod(handle, m_pcfMethod[index]);
+            }
+            m_diskLightHandles[index] = handle;
         }
     }
 
@@ -589,69 +589,69 @@ namespace AtomSampleViewer
 
             ImGui::Separator();
 
-            ImGui::Text("Spot Lights");
+            ImGui::Text("Disk Lights");
             ImGui::Indent();
             {
-                ScriptableImGui::Checkbox("Auto Rotation##Spot", &m_isSpotLightAutoRotate);
-                ScriptableImGui::SliderAngle("Base Direction##Spot", &m_spotLightRotationAngle, 0, 360);
+                ScriptableImGui::Checkbox("Auto Rotation##Disk", &m_isDiskLightAutoRotate);
+                ScriptableImGui::SliderAngle("Base Direction##Disk", &m_diskLightRotationAngle, 0, 360);
 
                 ImGui::Spacing();
 
                 ImGui::Text("Control Target");
-                ScriptableImGui::RadioButton("Red", &m_controlTargetSpotLightIndex, 0);
+                ScriptableImGui::RadioButton("Red", &m_controlTargetDiskLightIndex, 0);
                 ImGui::SameLine();
-                ScriptableImGui::RadioButton("Green", &m_controlTargetSpotLightIndex, 1);
+                ScriptableImGui::RadioButton("Green", &m_controlTargetDiskLightIndex, 1);
                 ImGui::SameLine();
-                ScriptableImGui::RadioButton("Blue", &m_controlTargetSpotLightIndex, 2);
+                ScriptableImGui::RadioButton("Blue", &m_controlTargetDiskLightIndex, 2);
 
-                const int index = m_controlTargetSpotLightIndex;
-                const SpotLightHandle lightId = m_spotLightHandles[index];
+                const int index = m_controlTargetDiskLightIndex;
+                const DiskLightHandle lightId = m_diskLightHandles[index];
 
-                ScriptableImGui::SliderFloat("Height##Spot",
-                    &m_spotLightHeights[index], 1.f, 30.f, "%.1f", 2.f);
+                ScriptableImGui::SliderFloat("Height##Disk",
+                    &m_diskLightHeights[index], 1.f, 30.f, "%.1f", 2.f);
 
                 if (ScriptableImGui::SliderFloat("Cone Angle", &m_outerConeAngles[index], 0.f, 120.f))
                 {
-                    m_spotLightFeatureProcessor->SetConeAngles(
+                    m_diskLightFeatureProcessor->SetConeAngles(
                         lightId,
-                        m_outerConeAngles[index] * ConeAngleInnerRatio,
-                        m_outerConeAngles[index]);
+                        AZ::DegToRad(m_outerConeAngles[index]) * ConeAngleInnerRatio,
+                        AZ::DegToRad(m_outerConeAngles[index]));
                 }
 
-                if (ScriptableImGui::SliderFloat("Intensity##Spot", &m_spotLightIntensities[index], 0.f, 20000.f, "%.1f", 2.f))
+                if (ScriptableImGui::SliderFloat("Intensity##Disk", &m_diskLightIntensities[index], 0.f, 20000.f, "%.1f", 2.f))
                 {
-                    AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(s_spotLightColors[index] * m_spotLightIntensities[index]);
-                    m_spotLightFeatureProcessor->SetRgbIntensity(lightId, lightColor);
-                    m_spotLightFeatureProcessor->SetAttenuationRadius(
+                    AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(s_diskLightColors[index] * m_diskLightIntensities[index]);
+                    m_diskLightFeatureProcessor->SetRgbIntensity(lightId, lightColor);
+                    m_diskLightFeatureProcessor->SetAttenuationRadius(
                         lightId,
-                        sqrtf(m_spotLightIntensities[index] / CutoffIntensity));
+                        sqrtf(m_diskLightIntensities[index] / CutoffIntensity));
                 }
 
                 bool shadowmapSizeChanged =
-                    ScriptableImGui::Checkbox("Enable Shadow", &m_spotLightShadowEnabled[index]);
+                    ScriptableImGui::Checkbox("Enable Shadow", &m_diskLightShadowEnabled[index]);
 
                 ImGui::Text("Shadowmap Size");
                 shadowmapSizeChanged = shadowmapSizeChanged ||
                     ScriptableImGui::Combo(
-                        "Size##Spot",
-                        &m_spotLightImageSizeIndices[index],
+                        "Size##Disk",
+                        &m_diskLightImageSizeIndices[index],
                         s_shadowmapImageSizeLabels,
                         AZ_ARRAY_SIZE(s_shadowmapImageSizeLabels));
                 if (shadowmapSizeChanged)
                 {
-                    m_spotLightFeatureProcessor->SetShadowmapSize(
-                        lightId,
-                        m_spotLightShadowEnabled[index] ?
-                        s_shadowmapImageSizes[m_spotLightImageSizeIndices[index]] :
-                        ShadowmapSize::None);
+                    m_diskLightFeatureProcessor->SetShadowsEnabled(lightId, m_diskLightShadowEnabled[index]);
+                    if (m_diskLightShadowEnabled[index])
+                    {
+                        m_diskLightFeatureProcessor->SetShadowmapMaxResolution(lightId, s_shadowmapImageSizes[m_diskLightImageSizeIndices[index]]);
+                    }
 
                     // Reset shadow parameters when shadow is disabled.
-                    if (!m_spotLightShadowEnabled[index])
+                    if (!m_diskLightShadowEnabled[index])
                     {
-                        m_shadowFilterMethodIndicesSpot[index] = 0;
-                        m_boundaryWidthsSpot[index] = 0.f;
-                        m_predictionSampleCountsSpot[index] = 0;
-                        m_filteringSampleCountsSpot[index] = 0;
+                        m_shadowFilterMethodIndicesDisk[index] = 0;
+                        m_boundaryWidthsDisk[index] = 0.f;
+                        m_predictionSampleCountsDisk[index] = 0;
+                        m_filteringSampleCountsDisk[index] = 0;
                     }
                 }
 
@@ -659,40 +659,38 @@ namespace AtomSampleViewer
 
                 ImGui::Text("Filtering");
                 if (ScriptableImGui::Combo(
-                    "Filter Method##Spot",
-                    &m_shadowFilterMethodIndicesSpot[index],
+                    "Filter Method##Disk",
+                    &m_shadowFilterMethodIndicesDisk[index],
                     s_shadowFilterMethodLabels,
                     AZ_ARRAY_SIZE(s_shadowFilterMethodLabels)))
                 {
-                    m_spotLightFeatureProcessor->SetShadowFilterMethod(
+                    m_diskLightFeatureProcessor->SetShadowFilterMethod(
                         lightId,
-                        s_shadowFilterMethods[m_shadowFilterMethodIndicesSpot[index]]);
+                        s_shadowFilterMethods[m_shadowFilterMethodIndicesDisk[index]]);
                 }
 
-                if (m_shadowFilterMethodIndicesSpot[index] != aznumeric_cast<int>(ShadowFilterMethod::None))
+                if (m_shadowFilterMethodIndicesDisk[index] != aznumeric_cast<int>(ShadowFilterMethod::None))
                 {
                     ImGui::Text("Boundary Width in degrees");
-                    if (ScriptableImGui::SliderFloat("Width##Spot", &m_boundaryWidthsSpot[index], 0.f, 1.0f, "%.3f"))
+                    if (ScriptableImGui::SliderFloat("Width##Disk", &m_boundaryWidthsDisk[index], 0.f, 1.0f, "%.3f"))
                     {
-                        m_spotLightFeatureProcessor->SetShadowBoundaryWidthAngle(
-                            lightId,
-                            m_boundaryWidthsSpot[index]);
+                        m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightId, AZ::DegToRad(m_boundaryWidthsDisk[index]));
                     }
                 }
 
-                if (m_shadowFilterMethodIndicesSpot[index] == aznumeric_cast<int>(ShadowFilterMethod::Pcf) ||
-                    m_shadowFilterMethodIndicesSpot[index] == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
+                if (m_shadowFilterMethodIndicesDisk[index] == aznumeric_cast<int>(ShadowFilterMethod::Pcf) ||
+                    m_shadowFilterMethodIndicesDisk[index] == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
                 {
                     ImGui::Spacing();
                     ImGui::Text("Filtering (PCF specific)");
                     
-                    if (m_pcfMethod[index] == PcfMethod::BoundarySearch && ScriptableImGui::SliderInt("Prediction # ##Spot", &m_predictionSampleCountsSpot[index], 4, 16))
+                    if (m_pcfMethod[index] == PcfMethod::BoundarySearch && ScriptableImGui::SliderInt("Prediction # ##Disk", &m_predictionSampleCountsDisk[index], 4, 16))
                     {
-                        m_spotLightFeatureProcessor->SetPredictionSampleCount(lightId, m_predictionSampleCountsSpot[index]);
+                        m_diskLightFeatureProcessor->SetPredictionSampleCount(lightId, m_predictionSampleCountsDisk[index]);
                     }
-                    if (ScriptableImGui::SliderInt("Filtering # ##Spot", &m_filteringSampleCountsSpot[index], 4, 64))
+                    if (ScriptableImGui::SliderInt("Filtering # ##Disk", &m_filteringSampleCountsDisk[index], 4, 64))
                     {
-                        m_spotLightFeatureProcessor->SetFilteringSampleCount(lightId, m_filteringSampleCountsSpot[index]);
+                        m_diskLightFeatureProcessor->SetFilteringSampleCount(lightId, m_filteringSampleCountsDisk[index]);
                     }
 
                     int pcfMethodAsInteger = aznumeric_cast<int>(m_pcfMethod[index]);
@@ -700,13 +698,13 @@ namespace AtomSampleViewer
                             "Boundary Search filtering", &pcfMethodAsInteger, static_cast<int>(PcfMethod::BoundarySearch)))
                     {
                         m_pcfMethod[index] = PcfMethod::BoundarySearch;
-                        m_spotLightFeatureProcessor->SetPcfMethod(lightId, m_pcfMethod[index]);
+                        m_diskLightFeatureProcessor->SetPcfMethod(lightId, m_pcfMethod[index]);
                     }
                     if (ScriptableImGui::RadioButton(
                             "Bicubic filtering", &pcfMethodAsInteger, static_cast<int>(PcfMethod::Bicubic)))
                     {
                         m_pcfMethod[index] = PcfMethod::Bicubic;
-                        m_spotLightFeatureProcessor->SetPcfMethod(lightId, m_pcfMethod[index]);
+                        m_diskLightFeatureProcessor->SetPcfMethod(lightId, m_pcfMethod[index]);
                     }
 
                 }

+ 21 - 21
Gem/Code/Source/ShadowExampleComponent.h

@@ -16,7 +16,7 @@
 
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/ShadowConstants.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 
 #include <AzCore/Component/TickBus.h>
 
@@ -31,7 +31,7 @@ namespace AtomSampleViewer
     * At the 3rd step, we made the number of cascades configurable.
     * At the 4th step, we implement softening shadow edge by PCF (Percentage Closer Filtering).
     * At the 5th step, we implement softening shadow edge by ESM (Exponential Shadow Maps).
-    * At the 6th step, we implement spot light shadows.
+    * At the 6th step, we implement disk light shadows.
     */
     class ShadowExampleComponent final
         : public CommonSampleComponentBase
@@ -50,7 +50,7 @@ namespace AtomSampleViewer
 
     private:
         using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
+        using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
         
         // AZ::TickBus::Handler overrides...
         void OnTick(float deltaTime, AZ::ScriptTimePoint time);
@@ -67,19 +67,19 @@ namespace AtomSampleViewer
 
         void CreateMeshes();
         void CreateDirectionalLight();
-        void CreateSpotLights();
+        void CreateDiskLights();
         void SetInitialShadowParams();
         void SetupDebugFlags();
 
         void DrawSidebar();
 
-        static constexpr uint32_t SpotLightCount = 3;
+        static constexpr uint32_t DiskLightCount = 3;
         static constexpr float ConeAngleInnerRatio = 0.9f;
         static constexpr float CutoffIntensity = 0.1f;
         static constexpr float FarClipDistance = 20.f;
 
         static const AZ::Color DirectionalLightColor;
-        static AZ::Color s_spotLightColors[SpotLightCount];
+        static AZ::Color s_diskLightColors[DiskLightCount];
         
         // Mesh Handles
         using MeshHandle = AZ::Render::MeshFeatureProcessorInterface::MeshHandle;
@@ -88,9 +88,9 @@ namespace AtomSampleViewer
 
         // lights
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         DirectionalLightHandle m_directionalLightHandle;
-        SpotLightHandle m_spotLightHandles[SpotLightCount];
+        DiskLightHandle m_diskLightHandles[DiskLightCount];
 
         // asset
         AZ::Data::Asset<AZ::RPI::ModelAsset> m_bunnyModelAsset;
@@ -108,23 +108,23 @@ namespace AtomSampleViewer
         // GUI
         float m_elapsedTime = 0.f;
 
-        int m_controlTargetSpotLightIndex = 0;
+        int m_controlTargetDiskLightIndex = 0;
         float m_directionalLightRotationAngle = 0.f; // in radian
-        float m_spotLightRotationAngle = 0.f; // in radian
+        float m_diskLightRotationAngle = 0.f; // in radian
         bool m_isDirectionalLightAutoRotate = true;
-        bool m_isSpotLightAutoRotate = true;
+        bool m_isDiskLightAutoRotate = true;
         float m_directionalLightHeight = 10.f;
-        float m_spotLightHeights[SpotLightCount] = {5.f, 6.f, 7.f};
+        float m_diskLightHeights[DiskLightCount] = {5.f, 6.f, 7.f};
         float m_directionalLightIntensity = 5.f;
-        float m_spotLightIntensities[SpotLightCount] = {500.f, 900.f, 500.f};
-        float m_outerConeAngles[SpotLightCount] = {35.f, 40.f, 45.f};
+        float m_diskLightIntensities[DiskLightCount] = {500.f, 900.f, 500.f};
+        float m_outerConeAngles[DiskLightCount] = {35.f, 40.f, 45.f};
         float m_cameraFovY = AZ::Constants::QuarterPi;
 
         // Shadowmap
         static const AZ::Render::ShadowmapSize s_shadowmapImageSizes[];
         static const char* s_shadowmapImageSizeLabels[];
         int m_directionalLightImageSizeIndex = 2; // image size is 1024.
-        int m_spotLightImageSizeIndices[SpotLightCount] = {2, 2, 2}; // image size is 1024.
+        int m_diskLightImageSizeIndices[DiskLightCount] = {2, 2, 2}; // image size is 1024.
         int m_cascadeCount = 2;
         bool m_shadowmapFrustumSplitIsAutomatic = true;
         float m_ratioLogarithmUniform = 0.5f;
@@ -138,20 +138,20 @@ namespace AtomSampleViewer
         bool m_isCascadeCorrectionEnabled = false;
         bool m_isDebugColoringEnabled = false;
         bool m_isDebugBoundingBoxEnabled = false;
-        bool m_spotLightShadowEnabled[SpotLightCount] = {true, true, true};
+        bool m_diskLightShadowEnabled[DiskLightCount] = {true, true, true};
 
         // Edge-softening of shadows
         static const AZ::Render::ShadowFilterMethod s_shadowFilterMethods[];
         static const char* s_shadowFilterMethodLabels[];
         int m_shadowFilterMethodIndexDirectional = 0; // filter method is None.
-        int m_shadowFilterMethodIndicesSpot[SpotLightCount] = { 0, 0, 0 }; // filter method is None.
+        int m_shadowFilterMethodIndicesDisk[DiskLightCount] = { 0, 0, 0 }; // filter method is None.
         float m_boundaryWidthDirectional = 0.03f; // 3cm
-        float m_boundaryWidthsSpot[SpotLightCount] = { 0.25f, 0.25f, 0.25f }; // 0.25 degrees
+        float m_boundaryWidthsDisk[DiskLightCount] = { 0.25f, 0.25f, 0.25f }; // 0.25 degrees
         int m_predictionSampleCountDirectional = 8;
-        int m_predictionSampleCountsSpot[SpotLightCount] = { 8, 8, 8 };
+        int m_predictionSampleCountsDisk[DiskLightCount] = { 8, 8, 8 };
         int m_filteringSampleCountDirectional = 32;
-        int m_filteringSampleCountsSpot[SpotLightCount] = { 32, 32, 32 };
-        AZ::Render::PcfMethod m_pcfMethod[SpotLightCount] = {
+        int m_filteringSampleCountsDisk[DiskLightCount] = { 32, 32, 32 };
+        AZ::Render::PcfMethod m_pcfMethod[DiskLightCount] = {
             AZ::Render::PcfMethod::BoundarySearch, AZ::Render::PcfMethod::BoundarySearch, AZ::Render::PcfMethod::BoundarySearch};
 
         ImGuiSidebar m_imguiSidebar;

+ 122 - 116
Gem/Code/Source/ShadowedBistroExampleComponent.cpp

@@ -73,20 +73,20 @@ namespace AtomSampleViewer
     {
         using namespace AZ;
         m_directionalLightShadowmapSizeIndex = s_shadowmapSizeIndexDefault;
-        m_spotLightShadowmapSize = Render::ShadowmapSize::None; // random
+        m_diskLightShadowmapSize = Render::ShadowmapSize::None; // random
         m_cascadeCount = s_cascadesCountDefault;
         m_ratioLogarithmUniform = s_ratioLogarithmUniformDefault;
-        m_spotLightCount = 0;
+        m_diskLightCount = 0;
 
-        // heuristic spot light default position configuration
-        m_spotLightsBasePosition[0] = 0.04f;
-        m_spotLightsBasePosition[1] = 0.04f;;
-        m_spotLightsBasePosition[2] = -0.03f;
-        m_spotLightsPositionScatteringRatio = 0.27f;
+        // heuristic disk light default position configuration
+        m_diskLightsBasePosition[0] = 0.04f;
+        m_diskLightsBasePosition[1] = 0.04f;;
+        m_diskLightsBasePosition[2] = -0.03f;
+        m_diskLightsPositionScatteringRatio = 0.27f;
 
         RPI::Scene* scene = RPI::RPISystemInterface::Get()->GetDefaultScene().get();
         m_directionalLightFeatureProcessor = scene->GetFeatureProcessor<Render::DirectionalLightFeatureProcessorInterface>();
-        m_spotLightFeatureProcessor = scene->GetFeatureProcessor<Render::SpotLightFeatureProcessorInterface>();
+        m_diskLightFeatureProcessor = scene->GetFeatureProcessor<Render::DiskLightFeatureProcessorInterface>();
 
         SetupScene();
 
@@ -129,7 +129,7 @@ namespace AtomSampleViewer
         GetMeshFeatureProcessor()->ReleaseMesh(m_meshHandle);
 
         m_directionalLightFeatureProcessor->ReleaseLight(m_directionalLightHandle);
-        UpdateSpotLightCount(0);
+        UpdateDiskLightCount(0);
     }
 
     void ShadowedBistroExampleComponent::OnTick(float deltaTime, AZ::ScriptTimePoint timePoint)
@@ -176,7 +176,7 @@ namespace AtomSampleViewer
     {
         m_bistroExteriorAssetLoaded = true;
         m_worldAabb = model->GetAabb();
-        UpdateSpotLightCount(SpotLightCountDefault);
+        UpdateDiskLightCount(DiskLightCountDefault);
 
         // Now that the models are initialized, we can allow the script to continue.
         ScriptRunnerRequestBus::Broadcast(&ScriptRunnerRequests::ResumeScript);
@@ -269,27 +269,27 @@ namespace AtomSampleViewer
             SetupDebugFlags();
         }
 
-        // spot lights are initialized after loading models.
-        BuildSpotLightParameters();
+        // disk lights are initialized after loading models.
+        BuildDiskLightParameters();
     }
 
-    void ShadowedBistroExampleComponent::BuildSpotLightParameters()
+    void ShadowedBistroExampleComponent::BuildDiskLightParameters()
     {
         m_random.SetSeed(0);
-        m_spotLights.clear();
-        m_spotLights.reserve(SpotLightCountMax);
-        for (int index = 0; index < SpotLightCountMax; ++index)
+        m_diskLights.clear();
+        m_diskLights.reserve(DiskLightCountMax);
+        for (int index = 0; index < DiskLightCountMax; ++index)
         {
-            m_spotLights.emplace_back(
+            m_diskLights.emplace_back(
                 GetRandomColor(),
                 GetRandomPosition(),
                 GetRandomShadowmapSize());
         }
     }
 
-    void ShadowedBistroExampleComponent::UpdateSpotLightCount(uint16_t count)
+    void ShadowedBistroExampleComponent::UpdateDiskLightCount(uint16_t count)
     {
-        // We suppose m_spotLights has been initialized except m_entity.
+        // We suppose m_diskLights has been initialized except m_entity.
         using namespace AZ;
 
         // Don't assert here if count == 0, since the count is set to 0 during Deactivate
@@ -299,40 +299,43 @@ namespace AtomSampleViewer
             return;
         }
 
-        for (int index = count; index < m_spotLightCount; ++index)
+        for (int index = count; index < m_diskLightCount; ++index)
         {
-            SpotLightHandle& handle = m_spotLights[index].m_handle;
-            m_spotLightFeatureProcessor->ReleaseLight(handle);
+            DiskLightHandle& handle = m_diskLights[index].m_handle;
+            m_diskLightFeatureProcessor->ReleaseLight(handle);
         }
 
-        const int previousSpotLightCount = m_spotLightCount;
+        const int previousDiskLightCount = m_diskLightCount;
 
-        for (int index = previousSpotLightCount; index < count; ++index)
+        for (int index = previousDiskLightCount; index < count; ++index)
         {
-            Render::SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
-            const SpotLightHandle handle = featureProcessor->AcquireLight();
+            Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
+            const DiskLightHandle handle = featureProcessor->AcquireLight();
 
-            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(m_spotLights[index].m_color * m_spotLightIntensity);
+            AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(m_diskLights[index].m_color * m_diskLightIntensity);
             featureProcessor->SetRgbIntensity(handle, lightColor);
             featureProcessor->SetAttenuationRadius(
                 handle,
-                sqrtf(m_spotLightIntensity / CutoffIntensity));
-            featureProcessor->SetShadowmapSize(
-                handle,
-                m_spotLightShadowEnabled ?
-                m_spotLights[index].m_shadowmapSize :
-                Render::ShadowmapSize::None);
-            featureProcessor->SetConeAngles(handle, 45.f, 55.f);
-            featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast<Render::ShadowFilterMethod>(m_shadowFilterMethodIndexSpot));
-            featureProcessor->SetPredictionSampleCount(handle, aznumeric_cast<uint16_t>(m_predictionSampleCountSpot));
-            featureProcessor->SetFilteringSampleCount(handle, aznumeric_cast<uint16_t>(m_filteringSampleCountSpot));
-
-            m_spotLights[index].m_handle = handle;
+                sqrtf(m_diskLightIntensity / CutoffIntensity));
+            featureProcessor->SetConeAngles(handle, DegToRad(45.0f), DegToRad(55.0f));
+            featureProcessor->SetShadowsEnabled(handle, m_diskLightShadowEnabled);
+            if (m_diskLightShadowEnabled)
+            {
+                featureProcessor->SetShadowmapMaxResolution(
+                    handle,
+                    m_diskLightShadowEnabled ?
+                    m_diskLights[index].m_shadowmapSize :
+                    Render::ShadowmapSize::None);
+                featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast<Render::ShadowFilterMethod>(m_shadowFilterMethodIndexDisk));
+                featureProcessor->SetPredictionSampleCount(handle, aznumeric_cast<uint16_t>(m_predictionSampleCountDisk));
+                featureProcessor->SetFilteringSampleCount(handle, aznumeric_cast<uint16_t>(m_filteringSampleCountDisk));
+            }
+            m_diskLights[index].m_handle = handle;
 
-            UpdateSpotLightPosition(index);
+            UpdateDiskLightPosition(index);
         }
 
-        m_spotLightCount = count;
+        m_diskLightCount = count;
     }
 
     const AZ::Color& ShadowedBistroExampleComponent::GetRandomColor()
@@ -505,7 +508,23 @@ namespace AtomSampleViewer
             {
                 ImGui::Spacing();
                 ImGui::Text("Filtering (PCF specific)");
-                if (ScriptableImGui::SliderInt("Prediction # ##Directional", &m_predictionSampleCountDirectional, 4, 16))
+
+                int pcfMethodAsInteger = aznumeric_cast<int>(m_pcfMethodDirectional);
+                if (ScriptableImGui::RadioButton(
+                        "Boundary Search filtering", &pcfMethodAsInteger, static_cast<int>(PcfMethod::BoundarySearch)))
+                {
+                    m_pcfMethodDirectional = PcfMethod::BoundarySearch;
+                    m_directionalLightFeatureProcessor->SetPcfMethod(m_directionalLightHandle, m_pcfMethodDirectional);
+                }
+                if (ScriptableImGui::RadioButton("Bicubic filtering", &pcfMethodAsInteger, static_cast<int>(PcfMethod::Bicubic)))
+                {
+                    m_pcfMethodDirectional = PcfMethod::Bicubic;
+                    m_directionalLightFeatureProcessor->SetPcfMethod(m_directionalLightHandle, m_pcfMethodDirectional);
+                }
+
+                if (m_pcfMethodDirectional ==
+                    AZ::Render::PcfMethod::BoundarySearch && ScriptableImGui::SliderInt(
+                        "Prediction # ##Directional", &m_predictionSampleCountDirectional, 4, 16))
                 {
                     m_directionalLightFeatureProcessor->SetPredictionSampleCount(
                         m_directionalLightHandle,
@@ -526,96 +545,96 @@ namespace AtomSampleViewer
         ImGui::Text("Spot Lights");
         ImGui::Indent();
         {
-            int spotLightCount = m_spotLightCount;
-            if (ScriptableImGui::SliderInt("Number", &spotLightCount, 0, SpotLightCountMax))
+            int diskLightCount = m_diskLightCount;
+            if (ScriptableImGui::SliderInt("Number", &diskLightCount, 0, DiskLightCountMax))
             {
-                UpdateSpotLightCount(spotLightCount);
+                UpdateDiskLightCount(diskLightCount);
             }
 
-            if (ScriptableImGui::SliderFloat("Intensity##spot", &m_spotLightIntensity, 0.f, 100000.f, "%.1f", 4.f))
+            if (ScriptableImGui::SliderFloat("Intensity##spot", &m_diskLightIntensity, 0.f, 100000.f, "%.1f", 4.f))
             {
-                for (const SpotLight& light : m_spotLights)
+                for (const DiskLight& light : m_diskLights)
                 {
                     if (light.m_handle.IsValid())
                     {
-                        AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(light.m_color * m_spotLightIntensity);
-                        m_spotLightFeatureProcessor->SetRgbIntensity(light.m_handle, lightColor);
-                        m_spotLightFeatureProcessor->SetAttenuationRadius(
+                        AZ::Render::PhotometricColor<AZ::Render::PhotometricUnit::Candela> lightColor(light.m_color * m_diskLightIntensity);
+                        m_diskLightFeatureProcessor->SetRgbIntensity(light.m_handle, lightColor);
+                        m_diskLightFeatureProcessor->SetAttenuationRadius(
                             light.m_handle,
-                            sqrtf(m_spotLightIntensity / CutoffIntensity));
+                            sqrtf(m_diskLightIntensity / CutoffIntensity));
                     }
                 }
             }
 
             // avoiding SliderFloat3 since its sliders are too narrow.
-            if (ScriptableImGui::SliderFloat("Center X", &m_spotLightsBasePosition[0], -0.5f, 0.5f) ||
-                ScriptableImGui::SliderFloat("Center Y", &m_spotLightsBasePosition[1], -0.5f, 0.5f) ||
-                ScriptableImGui::SliderFloat("Center Z", &m_spotLightsBasePosition[2], -0.5f, 0.5f) ||
-                ScriptableImGui::SliderFloat("Pos. Scatt. Ratio", &m_spotLightsPositionScatteringRatio, 0.f, 1.f))
+            if (ScriptableImGui::SliderFloat("Center X", &m_diskLightsBasePosition[0], -0.5f, 0.5f) ||
+                ScriptableImGui::SliderFloat("Center Y", &m_diskLightsBasePosition[1], -0.5f, 0.5f) ||
+                ScriptableImGui::SliderFloat("Center Z", &m_diskLightsBasePosition[2], -0.5f, 0.5f) ||
+                ScriptableImGui::SliderFloat("Pos. Scatt. Ratio", &m_diskLightsPositionScatteringRatio, 0.f, 1.f))
             {
-                UpdateSpotLightPositions();
+                UpdateDiskLightPositions();
             }
 
-            bool spotLightShadowmapChanged = ScriptableImGui::Checkbox("Enable Shadow", &m_spotLightShadowEnabled);
+            bool diskLightShadowmapChanged = ScriptableImGui::Checkbox("Enable Shadow", &m_diskLightShadowEnabled);
 
             ImGui::Text("Shadowmap Size");
-            int newSize = static_cast<int>(m_spotLightShadowmapSize);
+            int newSize = static_cast<int>(m_diskLightShadowmapSize);
             // To avoid GPU memory consumption, we avoid bigger shadowmap sizes here.
-            spotLightShadowmapChanged = spotLightShadowmapChanged ||
+            diskLightShadowmapChanged = diskLightShadowmapChanged ||
                 ScriptableImGui::RadioButton("256", &newSize, static_cast<int>(Render::ShadowmapSize::Size256)) ||
                 ScriptableImGui::RadioButton("512", &newSize, static_cast<int>(Render::ShadowmapSize::Size512)) ||
                 ScriptableImGui::RadioButton("1024", &newSize, static_cast<int>(Render::ShadowmapSize::Size1024)) ||
                 ScriptableImGui::RadioButton("Random", &newSize, static_cast<int>(Render::ShadowmapSize::None));
 
-            if (spotLightShadowmapChanged)
+            if (diskLightShadowmapChanged)
             {
-                m_spotLightShadowmapSize = static_cast<Render::ShadowmapSize>(newSize);
-                UpdateSpotLightShadowmapSize();
+                m_diskLightShadowmapSize = static_cast<Render::ShadowmapSize>(newSize);
+                UpdateDiskLightShadowmapSize();
             }
 
             ImGui::Spacing();
             ImGui::Text("Filtering");
             if (ScriptableImGui::Combo(
                 "Filter Method##Spot",
-                &m_shadowFilterMethodIndexSpot,
+                &m_shadowFilterMethodIndexDisk,
                 s_shadowFilterMethodLabels,
                 AZ_ARRAY_SIZE(s_shadowFilterMethodLabels)))
             {
-                for (int index = 0; index < m_spotLightCount; ++index)
+                for (int index = 0; index < m_diskLightCount; ++index)
                 {
-                    m_spotLightFeatureProcessor->SetShadowFilterMethod(m_spotLights[index].m_handle, aznumeric_cast<ShadowFilterMethod>(m_shadowFilterMethodIndexSpot));
+                    m_diskLightFeatureProcessor->SetShadowFilterMethod(m_diskLights[index].m_handle, aznumeric_cast<ShadowFilterMethod>(m_shadowFilterMethodIndexDisk));
                 }
             }
 
-            if (m_shadowFilterMethodIndexSpot != aznumeric_cast<int>(ShadowFilterMethod::None))
+            if (m_shadowFilterMethodIndexDisk != aznumeric_cast<int>(ShadowFilterMethod::None))
             {
                 ImGui::Text("Boundary Width in degrees");
-                if (ScriptableImGui::SliderFloat("Width##Spot", &m_boundaryWidthSpot, 0.f, 1.f, "%.3f"))
+                if (ScriptableImGui::SliderFloat("Width##Spot", &m_boundaryWidthDisk, 0.f, 1.f, "%.3f"))
                 {
-                    for (int index = 0; index < m_spotLightCount; ++index)
+                    for (int index = 0; index < m_diskLightCount; ++index)
                     {
-                        m_spotLightFeatureProcessor->SetShadowBoundaryWidthAngle(m_spotLights[index].m_handle, m_boundaryWidthSpot);
+                        m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(m_diskLights[index].m_handle, DegToRad(m_boundaryWidthDisk));
                     }
                 }
             }
 
-            if (m_shadowFilterMethodIndexSpot == aznumeric_cast<int>(ShadowFilterMethod::Pcf) ||
-                m_shadowFilterMethodIndexSpot == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
+            if (m_shadowFilterMethodIndexDisk == aznumeric_cast<int>(ShadowFilterMethod::Pcf) ||
+                m_shadowFilterMethodIndexDisk == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
             {
                 ImGui::Spacing();
                 ImGui::Text("Filtering (PCF specific)");
-                if (ScriptableImGui::SliderInt("Predictiona # ##Spot", &m_predictionSampleCountSpot, 4, 16))
+                if (ScriptableImGui::SliderInt("Predictiona # ##Spot", &m_predictionSampleCountDisk, 4, 16))
                 {
-                    for (int index = 0; index < m_spotLightCount; ++index)
+                    for (int index = 0; index < m_diskLightCount; ++index)
                     {
-                        m_spotLightFeatureProcessor->SetPredictionSampleCount(m_spotLights[index].m_handle, m_predictionSampleCountSpot);
+                        m_diskLightFeatureProcessor->SetPredictionSampleCount(m_diskLights[index].m_handle, m_predictionSampleCountDisk);
                     }
                 }
-                if (ScriptableImGui::SliderInt("Filtering # ##Spot", &m_filteringSampleCountSpot, 4, 64))
+                if (ScriptableImGui::SliderInt("Filtering # ##Spot", &m_filteringSampleCountDisk, 4, 64))
                 {
-                    for (int index = 0; index < m_spotLightCount; ++index)
+                    for (int index = 0; index < m_diskLightCount; ++index)
                     {
-                        m_spotLightFeatureProcessor->SetFilteringSampleCount(m_spotLights[index].m_handle, m_filteringSampleCountSpot);
+                        m_diskLightFeatureProcessor->SetFilteringSampleCount(m_diskLights[index].m_handle, m_filteringSampleCountDisk);
                     }
                 }
             }
@@ -625,45 +644,32 @@ namespace AtomSampleViewer
         m_imguiSidebar.End();
     }
 
-    void ShadowedBistroExampleComponent::UpdateSpotLightShadowmapSize()
+    void ShadowedBistroExampleComponent::UpdateDiskLightShadowmapSize()
     {
         using namespace AZ::Render;
-        SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
+        DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
 
-        if (!m_spotLightShadowEnabled)
+        for (const DiskLight& light : m_diskLights)
         {
-            // disabled shadows
-            for (const SpotLight& light : m_spotLights)
+            if (!light.m_handle.IsValid())
             {
-                if (light.m_handle.IsValid())
-                {
-                    featureProcessor->SetShadowmapSize(
-                        light.m_handle,
-                        ShadowmapSize::None);
-                }
+                continue;
             }
-        }
-        else if (m_spotLightShadowmapSize != ShadowmapSize::None)
-        {
-            // uniform size
-            for (const SpotLight& light : m_spotLights)
+
+            featureProcessor->SetShadowsEnabled(light.m_handle, m_diskLightShadowEnabled);
+            if (m_diskLightShadowEnabled)
             {
-                if (light.m_handle.IsValid())
+                if (m_diskLightShadowmapSize != ShadowmapSize::None)
                 {
-                    featureProcessor->SetShadowmapSize(
+                    // Uniform size
+                    featureProcessor->SetShadowmapMaxResolution(
                         light.m_handle,
-                        m_spotLightShadowmapSize);
+                        m_diskLightShadowmapSize);
                 }
-            }
-        }
-        else
-        {
-            // random sizes
-            for (const SpotLight& light : m_spotLights)
-            {
-                if (light.m_handle.IsValid())
+                else
                 {
-                    featureProcessor->SetShadowmapSize(
+                    // Random sizes
+                    featureProcessor->SetShadowmapMaxResolution(
                         light.m_handle,
                         light.m_shadowmapSize);
                 }
@@ -671,18 +677,18 @@ namespace AtomSampleViewer
         }
     }
 
-    void ShadowedBistroExampleComponent::UpdateSpotLightPositions()
+    void ShadowedBistroExampleComponent::UpdateDiskLightPositions()
     {
-        for (int index = 0; index < m_spotLightCount; ++index)
+        for (int index = 0; index < m_diskLightCount; ++index)
         {
-            UpdateSpotLightPosition(index);
+            UpdateDiskLightPosition(index);
         }
     }
 
-    void ShadowedBistroExampleComponent::UpdateSpotLightPosition(int index)
+    void ShadowedBistroExampleComponent::UpdateDiskLightPosition(int index)
     {
         using namespace AZ;
-        Render::SpotLightFeatureProcessorInterface* const featureProcessor = m_spotLightFeatureProcessor;
+        Render::DiskLightFeatureProcessorInterface* const featureProcessor = m_diskLightFeatureProcessor;
 
 
         if (!m_worldAabb.IsValid() || !m_worldAabb.IsFinite())
@@ -692,19 +698,19 @@ namespace AtomSampleViewer
         }
 
         const Vector3 basePosition(
-            m_spotLightsBasePosition[0],
-            m_spotLightsBasePosition[1],
-            m_spotLightsBasePosition[2]);
-        const Vector3 relativePosition = basePosition + m_spotLights[index].m_relativePosition * m_spotLightsPositionScatteringRatio;
+            m_diskLightsBasePosition[0],
+            m_diskLightsBasePosition[1],
+            m_diskLightsBasePosition[2]);
+        const Vector3 relativePosition = basePosition + m_diskLights[index].m_relativePosition * m_diskLightsPositionScatteringRatio;
         const Vector3 position = m_worldAabb.GetCenter() +
             m_worldAabb.GetExtents() * relativePosition;
         const auto transform =
             Transform::CreateTranslation(position) * Transform::CreateRotationX(-Constants::HalfPi);
         featureProcessor->SetPosition(
-            m_spotLights[index].m_handle,
+            m_diskLights[index].m_handle,
             position);
         featureProcessor->SetDirection(
-            m_spotLights[index].m_handle,
+            m_diskLights[index].m_handle,
             transform.GetBasis(1));
     }
 

+ 27 - 26
Gem/Code/Source/ShadowedBistroExampleComponent.h

@@ -15,7 +15,7 @@
 #include <CommonSampleComponentBase.h>
 #include <Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h>
 #include <Atom/Feature/CoreLights/ShadowConstants.h>
-#include <Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h>
+#include <Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h>
 #include <AzCore/Component/TickBus.h>
 #include <AzCore/std/containers/vector.h>
 #include <AzCore/Math/Aabb.h>
@@ -44,13 +44,13 @@ namespace AtomSampleViewer
 
     private:
         using DirectionalLightHandle = AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle;
-        using SpotLightHandle = AZ::Render::SpotLightFeatureProcessorInterface::LightHandle;
+        using DiskLightHandle = AZ::Render::DiskLightFeatureProcessorInterface::LightHandle;
 
-        class SpotLight
+        class DiskLight
         {
         public:
-            SpotLight() = delete;
-            explicit SpotLight(
+            DiskLight() = delete;
+            explicit DiskLight(
                 const AZ::Color& color,
                 const AZ::Vector3& relativePosition,
                 AZ::Render::ShadowmapSize shadowmapSize)
@@ -58,16 +58,16 @@ namespace AtomSampleViewer
                 , m_relativePosition{ relativePosition }
                 , m_shadowmapSize{ shadowmapSize }
             {}
-            ~SpotLight() = default;
+            ~DiskLight() = default;
 
             const AZ::Color m_color;
             const AZ::Vector3 m_relativePosition;
             const AZ::Render::ShadowmapSize m_shadowmapSize;
-            SpotLightHandle m_handle;
+            DiskLightHandle m_handle;
         };
 
-        static constexpr int SpotLightCountMax = 50;
-        static constexpr int SpotLightCountDefault = 10;
+        static constexpr int DiskLightCountMax = 50;
+        static constexpr int DiskLightCountDefault = 10;
         static constexpr float CutoffIntensity = 0.1f;
 
         static const AZ::Color DirectionalLightColor;
@@ -82,25 +82,25 @@ namespace AtomSampleViewer
         void SetInitialCameraTransform();
 
         void SetupScene();
-        void BuildSpotLightParameters();
-        void UpdateSpotLightCount(uint16_t count);
+        void BuildDiskLightParameters();
+        void UpdateDiskLightCount(uint16_t count);
         const AZ::Color& GetRandomColor();
         AZ::Vector3 GetRandomPosition();
         AZ::Render::ShadowmapSize GetRandomShadowmapSize();
 
         void DrawSidebar();
-        void UpdateSpotLightShadowmapSize();
-        void UpdateSpotLightPositions();
-        void UpdateSpotLightPosition(int index);
+        void UpdateDiskLightShadowmapSize();
+        void UpdateDiskLightPositions();
+        void UpdateDiskLightPosition(int index);
         void SetupDebugFlags();
 
         float m_originalFarClipDistance = 0.f;
 
         // lights
         AZ::Render::DirectionalLightFeatureProcessorInterface* m_directionalLightFeatureProcessor = nullptr;
-        AZ::Render::SpotLightFeatureProcessorInterface* m_spotLightFeatureProcessor = nullptr;
+        AZ::Render::DiskLightFeatureProcessorInterface* m_diskLightFeatureProcessor = nullptr;
         DirectionalLightHandle m_directionalLightHandle;
-        AZStd::vector<SpotLight> m_spotLights;
+        AZStd::vector<DiskLight> m_diskLights;
 
         // scene setup
         AZ::SimpleLcgRandom m_random;
@@ -119,10 +119,10 @@ namespace AtomSampleViewer
         float m_directionalLightPitch = -AZ::Constants::QuarterPi;
         float m_directionalLightYaw = 0.f;
         float m_directionalLightIntensity = 5.f;
-        float m_spotLightIntensity = 500.f;
-        int m_spotLightCount = 0;
-        float m_spotLightsBasePosition[3] = {0.f, 0.f, 0.f};
-        float m_spotLightsPositionScatteringRatio = 0.0f;
+        float m_diskLightIntensity = 500.f;
+        int m_diskLightCount = 0;
+        float m_diskLightsBasePosition[3] = {0.f, 0.f, 0.f};
+        float m_diskLightsPositionScatteringRatio = 0.0f;
         bool m_cameraTransformInitialized = false;
 
         // Shadowmap
@@ -134,20 +134,21 @@ namespace AtomSampleViewer
         int m_directionalLightShadowmapSizeIndex = 0;
         int m_cascadeCount = 0;
         float m_ratioLogarithmUniform = 0.f;
-        AZ::Render::ShadowmapSize m_spotLightShadowmapSize = AZ::Render::ShadowmapSize::None;
-        bool m_spotLightShadowEnabled = true;
+        AZ::Render::ShadowmapSize m_diskLightShadowmapSize = AZ::Render::ShadowmapSize::None;
+        bool m_diskLightShadowEnabled = true;
 
         // Edge-softening of directional light shadows
         static const AZ::Render::ShadowFilterMethod s_shadowFilterMethods[];
         static const char* s_shadowFilterMethodLabels[];
         int m_shadowFilterMethodIndexDirectional = 0; // filter method is None.
-        int m_shadowFilterMethodIndexSpot = 0; // filter method is None
+        int m_shadowFilterMethodIndexDisk = 0; // filter method is None
         float m_boundaryWidthDirectional = 0.03f; // 3cm
-        float m_boundaryWidthSpot = 0.25f; // 0.25 degrees
+        float m_boundaryWidthDisk = 0.25f; // 0.25 degrees
         int m_predictionSampleCountDirectional = 4;
-        int m_predictionSampleCountSpot = 4;
+        int m_predictionSampleCountDisk = 4;
         int m_filteringSampleCountDirectional = 16;
-        int m_filteringSampleCountSpot = 16;
+        AZ::Render::PcfMethod m_pcfMethodDirectional = AZ::Render::PcfMethod::BoundarySearch;
+        int m_filteringSampleCountDisk = 16;
 
         bool m_isCascadeCorrectionEnabled = false;
         bool m_isDebugColoringEnabled = false;

+ 1 - 1
Objects/Bistro/CHANGELOG.txt

@@ -1,4 +1,4 @@
-Amazon Lumberyard Bistro
+Amazon Open 3D Engine Bistro
 
 v1: Initial release
 

+ 3 - 3
Objects/Bistro/README.txt

@@ -1,4 +1,4 @@
-Amazon Lumberyard Bistro
+Amazon Open 3D Engine Bistro
 
 Vertex counts:
 - Interior: 814,435
@@ -24,8 +24,8 @@ Also included:
 How to cite use of this asset:
 
   @misc{ORCAAmazonBistro,
-   title = {Amazon Lumberyard Bistro, Open Research Content Archive (ORCA)},
-   author = {Amazon Lumberyard},
+   title = {Amazon Open 3D Engine Bistro, Open Research Content Archive (ORCA)},
+   author = {Amazon Open 3D Engine},
    year = {2017},
    month = {July},
    note = {\small \texttt{http://developer.nvidia.com/orca/amazon-lumberyard-bistro}},

+ 14 - 14
Passes/CheckerboardPipeline.pass

@@ -50,12 +50,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     },
                     "Connections": [
                         {
@@ -85,17 +85,17 @@
                     ]
                 },
                 {
-                    "Name": "EsmShadowmapsPassSpot",
+                    "Name": "EsmShadowmapsPassProjected",
                     "TemplateName": "EsmShadowmapsTemplate",
                     "PassData": {
                         "$type": "EsmShadowmapsPassData",
-                        "LightType": "spot"
+                        "LightType": "projected"
                     },
                     "Connections": [
                         {
                             "LocalSlot": "DepthShadowmaps",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         }
@@ -241,16 +241,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },
@@ -602,16 +602,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },

+ 10 - 10
Passes/ComplexPipeline.pass

@@ -49,12 +49,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedLightShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     },
                     "Connections": [
                         {
@@ -84,17 +84,17 @@
                     ]
                 },
                 {
-                    "Name": "EsmShadowmapsPassSpot",
+                    "Name": "EsmShadowmapsPassProjected",
                     "TemplateName": "EsmShadowmapsTemplate",
                     "PassData": {
                         "$type": "EsmShadowmapsPassData",
-                        "LightType": "spot"
+                        "LightType": "projected"
                     },
                     "Connections": [
                         {
                             "LocalSlot": "DepthShadowmaps",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         }
@@ -190,16 +190,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedLightShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },

+ 3 - 3
Passes/MSAA_RPI_Pipeline_Core.pass

@@ -71,12 +71,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     }
                 },
                 {

+ 8 - 8
Passes/MainPipeline.pass

@@ -155,17 +155,17 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
                                 "Pass": "ShadowPass",
-                                "Attachment": "SpotLightShadowmap"
+                                "Attachment": "ProjectedShadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightESM",
+                            "LocalSlot": "ProjectedESM",
                             "AttachmentRef": {
                                 "Pass": "ShadowPass",
-                                "Attachment": "SpotLightESM"
+                                "Attachment": "ProjectedESM"
                             }
                         },
                         {
@@ -224,17 +224,17 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
                                 "Pass": "ShadowPass",
-                                "Attachment": "SpotLightShadowmap"
+                                "Attachment": "ProjectedShadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightESM",
+                            "LocalSlot": "ProjectedESM",
                             "AttachmentRef": {
                                 "Pass": "ShadowPass",
-                                "Attachment": "SpotLightESM"
+                                "Attachment": "ProjectedESM"
                             }
                         },
                         {

+ 14 - 14
Passes/MainPipeline_Mobile.pass

@@ -50,12 +50,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     },
                     "Connections": [
                         {
@@ -85,17 +85,17 @@
                     ]
                 },
                 {
-                    "Name": "EsmShadowmapsPassSpot",
+                    "Name": "EsmShadowmapsPassProjected",
                     "TemplateName": "EsmShadowmapsTemplate",
                     "PassData": {
                         "$type": "EsmShadowmapsPassData",
-                        "LightType": "spot"
+                        "LightType": "projected"
                     },
                     "Connections": [
                         {
                             "LocalSlot": "DepthShadowmaps",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         }
@@ -191,16 +191,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },
@@ -546,16 +546,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },

+ 3 - 3
Passes/No_MSAA_RPI_Pipeline.pass

@@ -102,12 +102,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     },
                     "Connections": [
                         {

+ 2 - 2
Passes/PassTemplates.azasset

@@ -293,8 +293,8 @@
                 "Path": "Passes/LightCullingRemap.pass"
             },
             {
-                "Name": "SpotLightShadowmapsTemplate",
-                "Path": "Passes/SpotLightShadowmaps.pass"
+                "Name": "ProjectedShadowmapsTemplate",
+                "Path": "Passes/ProjectedShadowmaps.pass"
             },
             {
                 "Name": "EnvironmentCubeMapPipeline",

+ 10 - 10
Passes/SsaoPipeline.pass

@@ -54,12 +54,12 @@
                     ]
                 },
                 {
-                    "Name": "SpotLightShadowmapsPass",
-                    "TemplateName": "SpotLightShadowmapsTemplate",
+                    "Name": "ProjectedShadowmapsPass",
+                    "TemplateName": "ProjectedShadowmapsTemplate",
                     "PassData": {
                         "$type": "RasterPassData",
                         "DrawListTag": "shadow",
-                        "PipelineViewTag": "SpotLightView"
+                        "PipelineViewTag": "ProjectedShadowView"
                     },
                     "Connections": [
                         {
@@ -89,17 +89,17 @@
                     ]
                 },
                 {
-                    "Name": "EsmShadowmapsPassSpot",
+                    "Name": "EsmShadowmapsPassProjected",
                     "TemplateName": "EsmShadowmapsTemplate",
                     "PassData": {
                         "$type": "EsmShadowmapsPassData",
-                        "LightType": "spot"
+                        "LightType": "projected"
                     },
                     "Connections": [
                         {
                             "LocalSlot": "DepthShadowmaps",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         }
@@ -230,16 +230,16 @@
                             }
                         },
                         {
-                            "LocalSlot": "SpotLightShadowmap",
+                            "LocalSlot": "ProjectedShadowmap",
                             "AttachmentRef": {
-                                "Pass": "SpotLightShadowmapsPass",
+                                "Pass": "ProjectedShadowmapsPass",
                                 "Attachment": "Shadowmap"
                             }
                         },
                         {
-                            "LocalSlot": "ExponentialShadowmapSpot",
+                            "LocalSlot": "ExponentialShadowmapProjected",
                             "AttachmentRef": {
-                                "Pass": "EsmShadowmapsPassSpot",
+                                "Pass": "EsmShadowmapsPassProjected",
                                 "Attachment": "EsmShadowmaps"
                             }
                         },

+ 0 - 10
Scripts/AreaLightTest.bv.lua

@@ -27,15 +27,6 @@ function SetupDiskLights()
     SetImguiValue('AreaLightSample/Emit Both Directions', false)
 end
 
-function SetupDiskLightsDoubleSided()
-    SetImguiValue('AreaLightSample/LightType/Disk', true)
-    SetImguiValue('AreaLightSample/Position Offset', Vector3(0.0, -0.5, -1.25))
-    SetImguiValue('AreaLightSample/Radius', 0.75)
-    SetImguiValue('AreaLightSample/X rotation', -1.45)
-    SetImguiValue('AreaLightSample/Y rotation', -0.5)
-    SetImguiValue('AreaLightSample/Emit Both Directions', true)
-end
-
 function SetupCapsuleLights()
     SetImguiValue('AreaLightSample/LightType/Capsule', true)
     SetImguiValue('AreaLightSample/Position Offset', Vector3(0.0, 0.0, 0.0))
@@ -139,7 +130,6 @@ lightSetups =
 {
     point = SetupPointLights,
     disk = SetupDiskLights,
-    disk_double_sided = SetupDiskLightsDoubleSided,
     capsule = SetupCapsuleLights,
     quad = SetupQuadLights,
     quad_double_sided = SetupQuadLightsDoubleSided,

+ 0 - 3
Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_metal.ppm

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e98dc8763abe88b813d01de5d6c9004e82c40526a149c9b63fd84c9f28df35c0
-size 1920016

+ 0 - 3
Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_rough_metal.ppm

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:20447abab4e19cb2bbb42b87d10870bc5fd303f1f6dcad422ba5b1e030e1a3eb
-size 1920016

+ 0 - 3
Scripts/ExpectedScreenshots/AreaLights/disk_double_sided_vary_rough_nonmetal.ppm

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e619203ae401b87654a20ef2699fc2a048ed4b377c286dfd5a600532e1ab606f
-size 1920016

+ 1 - 1
Scripts/ExpectedScreenshots/CullingAndLod/screenshot_1.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:869c2ff7bd66ed93d0561a7b901f936c8b38c77f7b064d90020d71d3b9e02e0e
+oid sha256:a2384eccf7d3d139e5467b7f7c01c42671fbea85f8785fb8dbeeea39e95e133e
 size 750015

+ 1 - 1
Scripts/ExpectedScreenshots/LightCulling/screenshot_capsulelights.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:03f768e3f5e03b1faa333cf463960d5cbbc66ca89302593b66e7d99fd22f0318
+oid sha256:e5eefe346d6e04846923e983fec6fd812ed68f4bbe5d84dae900ab60617ae6e9
 size 4320016

+ 1 - 1
Scripts/ExpectedScreenshots/LightCulling/screenshot_decals.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:8188131d5cb77040bdf3f1ec9b1b70d4e2bff0d4d58c3dd138ef1690e7194459
+oid sha256:0a98fae2e19ac0fa161d1e93ff69beed58f013dff0023da056d28af045c5621f
 size 4320016

+ 1 - 1
Scripts/ExpectedScreenshots/LightCulling/screenshot_disklights.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:0ac5b1b223677517baac2c3e6796acdbd1ba6f58050fd6095fb81d88768654e5
+oid sha256:a4ee644113c4900187d3808fc8c5723b4b58946356921ae6cf3f7f5a625f6cfb
 size 4320016

+ 1 - 1
Scripts/ExpectedScreenshots/LightCulling/screenshot_quadlights.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:28d24236f116e18b3070f7705e1e4836376a6ca948dc837ab67df4e895141fdc
+oid sha256:b7cca1b103c6039dbd70a84847a1358f89d82d874fdb1683064b0035131c125c
 size 4320016

+ 0 - 3
Scripts/ExpectedScreenshots/LightCulling/screenshot_spotlights.ppm

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5f882f45a7f6c15370b9a5b9239047e824e3039b3c1afaa06efe178d3420c13d
-size 4320016

+ 1 - 1
Scripts/ExpectedScreenshots/ShadowedBistro/initial.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:087cfb5dd627b1525834827a2d5d5a47effedcb467c277ab0061da8e72660ecb
+oid sha256:472c22b404c140e0d4a4dd68ec31f809cd7beba6d8e9fcc1141e8e1a40b4b67c
 size 1440015

+ 1 - 1
Scripts/ExpectedScreenshots/ShadowedBistro/spot_nofilter_table.ppm

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:89b1d114b29fdf51eeb131103abf7064bb364f81d2ccbe17a446d5ece72187d2
+oid sha256:d95cea86930a4e7b35c129d07f192dba3b261fed19b0a6195ad3186611505bf7
 size 1440015

+ 0 - 14
Scripts/LightCulling.bv.lua

@@ -14,7 +14,6 @@
 
 function ResetEntityCounts()
     SetImguiValue('Point Lights/Point light count', 0)
-    SetImguiValue('Spot Lights/Spot light count', 0)
     SetImguiValue('Decals/Decal count', 0)
     SetImguiValue('Disk Lights/Disk light count', 0)
     SetImguiValue('Capsule Lights/Capsule light count', 0)
@@ -38,18 +37,6 @@ function TakeScreenshotPointLights()
     CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_pointlights.ppm')
 end
 
-function TakeScreenshotSpotLights()
-
-    ResetEntityCounts()
-
-    NoClipCameraController_SetFov(DegToRad(90))
-    SetImguiValue('Spot Lights/Spot light count', 150)
-    SetImguiValue('Spot Lights/Spot Intensity', 70)
-    
-    IdleFrames(1) 
-    CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_spotlights.ppm')
-end
-
 function TakeScreenshotDiskLights()
 
     ResetEntityCounts()
@@ -129,7 +116,6 @@ ResizeViewport(1600, 900)
 EnableOnlyTestHeatmap()
 
 TakeScreenshotPointLights()
-TakeScreenshotSpotLights()
 TakeScreenshotDiskLights()
 TakeScreenshotCapsuleLights()
 TakeScreenshotQuadLights()

+ 2 - 1
Scripts/MaterialHotReloadTest.bv.lua

@@ -112,7 +112,8 @@ AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.materialtype")
 AssetTracking_ExpectAsset(g_assetFolder .. "HotReloadTest.shader")
 AssetTracking_IdleUntilExpectedAssetsFinish(60)
 IdleSeconds(1) -- Idle for a bit to give time for the assets to reload
-CaptureScreenshot(g_screenshotOutputFolder .. '/12_Variants_None_AfterUpdatingShader.ppm')
+--[GFX TODO][ATOM-15079] This test is consistently failing due to an Asset Processor bug. Re-enable this test once SPEC-5888 is fixed.
+--CaptureScreenshot(g_screenshotOutputFolder .. '/12_Variants_None_AfterUpdatingShader.ppm')
 
 -- Here we prepare to test a specific edge case. First, the material should be using a full baked shader variant, so we set up that precondition and verify with a screenshot.
 AssetTracking_Start()

+ 27 - 27
Scripts/ShadowTest.bv.lua

@@ -19,24 +19,24 @@ OpenSample('Features/Shadow')
 ResizeViewport(800, 600)
 SelectImageComparisonToleranceLevel("Level H")
 SetImguiValue('Auto Rotation##Directional', false)
-SetImguiValue('Auto Rotation##Spot', false)
+SetImguiValue('Auto Rotation##Disk', false)
 
 -- Initial
 SetImguiValue('Direction##Directional', 0.0)
-SetImguiValue('Base Direction##Spot', 0.0)
+SetImguiValue('Base Direction##Disk', 0.0)
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/initial.ppm')
 
 -- Directional Light Initial
--- Diabling spot lights
+-- Diabling Disk lights
 SetImguiValue('Red', true)
-SetImguiValue('Intensity##Spot', 0.0)
+SetImguiValue('Intensity##Disk', 0.0)
 IdleFrames(1)
 SetImguiValue('Green', true)
-SetImguiValue('Intensity##Spot', 0.0)
+SetImguiValue('Intensity##Disk', 0.0)
 IdleFrames(1)
 SetImguiValue('Blue', true)
-SetImguiValue('Intensity##Spot', 0.0)
+SetImguiValue('Intensity##Disk', 0.0)
 -- Set Camera
 ArcBallCameraController_SetHeading(DegToRad(90.0))
 ArcBallCameraController_SetPitch(DegToRad(-45.0))
@@ -98,60 +98,60 @@ SetImguiValue('Filter Method##Directional', 'ESM+PCF')
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/directional_esm_pcf.ppm')
 
--- Spot Light Initial
+-- Disk Light Initial
 -- Disabling directional light
 SetImguiValue('Intensity##Directional', 0.0)
 SetImguiValue('Red', true)
-SetImguiValue('Intensity##Spot', 500.0)
+SetImguiValue('Intensity##Disk', 500.0)
 IdleFrames(1)
 SetImguiValue('Green', true)
-SetImguiValue('Height##Spot', 4.0)
-SetImguiValue('Intensity##Spot', 400.0)
+SetImguiValue('Height##Disk', 4.0)
+SetImguiValue('Intensity##Disk', 400.0)
 IdleFrames(1)
 SetImguiValue('Blue', true)
-SetImguiValue('Intensity##Spot', 500.0)
+SetImguiValue('Intensity##Disk', 500.0)
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/spot_initial.ppm')
 
--- Spot Light Disabling Shadow for Red
+-- Disk Light Disabling Shadow for Red
 SetImguiValue('Red', true)
 SetImguiValue('Enable Shadow', false)
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/spot_no_red_shadow.ppm')
 
--- Spot Light Various Shadowmap Sizes
+-- Disk Light Various Shadowmap Sizes
 SetImguiValue('Red', true)
 SetImguiValue('Enable Shadow', true)
 IdleFrames(1)
-SetImguiValue('Size##Spot', '2048')
+SetImguiValue('Size##Disk', '2048')
 IdleFrames(1)
 SetImguiValue('Green', true)
-SetImguiValue('Size##Spot', '1024')
+SetImguiValue('Size##Disk', '1024')
 IdleFrames(1)
 SetImguiValue('Blue', true)
-SetImguiValue('Size##Spot', '512')
+SetImguiValue('Size##Disk', '512')
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/spot_shadowmap_size.ppm')
 
--- Spot Light Various Filter Method
+-- Disk Light Various Filter Method
 SetImguiValue('Red', true)
-SetImguiValue('Filter Method##Spot', 'PCF')
+SetImguiValue('Filter Method##Disk', 'PCF')
 IdleFrames(1)
-SetImguiValue('Width##Spot', 0.5)
-SetImguiValue('Prediction # ##Spot', 16)
-SetImguiValue('Filtering # ##Spot', 64)
+SetImguiValue('Width##Disk', 0.5)
+SetImguiValue('Prediction # ##Disk', 16)
+SetImguiValue('Filtering # ##Disk', 64)
 IdleFrames(1)
 SetImguiValue('Green', true)
-SetImguiValue('Filter Method##Spot', 'ESM')
+SetImguiValue('Filter Method##Disk', 'ESM')
 IdleFrames(1)
-SetImguiValue('Width##Spot', 0.5)
+SetImguiValue('Width##Disk', 0.5)
 IdleFrames(1)
 SetImguiValue('Blue', true)
-SetImguiValue('Filter Method##Spot', 'ESM+PCF')
+SetImguiValue('Filter Method##Disk', 'ESM+PCF')
 IdleFrames(1)
-SetImguiValue('Width##Spot', 0.5)
-SetImguiValue('Prediction # ##Spot', 16)
-SetImguiValue('Filtering # ##Spot', 64)
+SetImguiValue('Width##Disk', 0.5)
+SetImguiValue('Prediction # ##Disk', 16)
+SetImguiValue('Filtering # ##Disk', 64)
 IdleFrames(1)
 CaptureScreenshot(g_screenshotOutputFolder .. '/spot_filter_method.ppm')
 

+ 4 - 4
Standalone/Platform/Mac/MacLumberyardApplication.h → Standalone/Platform/Mac/MacO3DEApplication.h

@@ -15,13 +15,13 @@
 //[GFX TODO][ATOM-449] - Remove this file once we switch to unified launcher
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@interface MacLumberyardApplication : NSApplication
+@interface MacO3DEApplication : NSApplication
 {
 }
-@end    // MacLumberyardApplication Interface
+@end    // MacO3DEApplication Interface
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@interface MacLumberyardApplicationDelegate : NSObject<NSApplicationDelegate>
+@interface MacO3DEApplicationDelegate : NSObject<NSApplicationDelegate>
 {
 }
-@end    // MacLumberyardApplicationDelegate Interface
+@end    // MacO3DEApplicationDelegate Interface

+ 3 - 3
Standalone/Platform/Mac/MacLumberyardApplication.mm → Standalone/Platform/Mac/MacO3DEApplication.mm

@@ -10,10 +10,10 @@
 *
 */
 
-#include "MacLumberyardApplication.h"
+#include "MacO3DEApplication.h"
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@implementation MacLumberyardApplication
+@implementation MacO3DEApplication
 
-@end // MacLumberyardApplication Implementation
+@end // MacO3DEApplication Implementation
 

+ 3 - 3
Standalone/Platform/Mac/MacLumberyardApplicationDelegate.mm → Standalone/Platform/Mac/MacO3DEApplicationDelegate.mm

@@ -10,10 +10,10 @@
 *
 */
 
-#include "MacLumberyardApplication.h"
+#include "MacO3DEApplication.h"
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@implementation MacLumberyardApplicationDelegate
+@implementation MacO3DEApplicationDelegate
 
-@end // MacLumberyardApplicationDelegate Implementation
+@end // MacO3DEApplicationDelegate Implementation
 

+ 4 - 4
Standalone/Platform/Mac/main_mac.mm

@@ -17,7 +17,7 @@
 #include <GridMate/GridMate.h>
 #include <GridMate/Session/LANSession.h>
 
-#include "MacLumberyardApplication.h"
+#include "MacO3DEApplication.h"
 #include <mach-o/dyld.h>
 #include <libgen.h>
 
@@ -44,8 +44,8 @@ int main(int argc, char** argv)
     // Create a custom AppKit application, and a custom AppKit application delegate.
     @autoreleasepool
     {
-        [MacLumberyardApplication sharedApplication];
-        [NSApp setDelegate: [[MacLumberyardApplicationDelegate alloc] init]];
+        [MacO3DEApplication sharedApplication];
+        [NSApp setDelegate: [[MacO3DEApplicationDelegate alloc] init]];
         
         // Register some default application behaviours
         [[NSUserDefaults standardUserDefaults] registerDefaults:
@@ -58,6 +58,6 @@ int main(int argc, char** argv)
         [NSApp finishLaunching];
     }
     
-    // Launch the Lumberyard application.
+    // Launch the Open 3D Engine application.
     return AtomSampleViewer::RunGameCommon(argc, argv);
 }

+ 3 - 3
Standalone/Platform/Mac/platform_mac_files.cmake

@@ -10,9 +10,9 @@
 #
 
 set(FILES
-    MacLumberyardApplication.h
-    MacLumberyardApplication.mm
-    MacLumberyardApplicationDelegate.mm
+    MacO3DEApplication.h
+    MacO3DEApplication.mm
+    MacO3DEApplicationDelegate.mm
     AtomSampleViewerApplication_mac.cpp
     main_mac.mm
 )

+ 3 - 3
Standalone/Platform/iOS/IosLumberyardApplication.mm → Standalone/Platform/iOS/IosO3DEApplication.mm

@@ -17,13 +17,13 @@
 //[GFX TODO][ATOM-449] - Remove this file once we switch to unified launcher
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@interface IosLumberyardApplication : UIApplication
+@interface IosO3DEApplication : UIApplication
 {
 }
-@end    // IosLumberyardApplication Interface
+@end    // IosO3DEApplication Interface
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@implementation IosLumberyardApplication
+@implementation IosO3DEApplication
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 - (void)touchesBegan: (NSSet<UITouch*>*)touches withEvent: (UIEvent*)event

+ 5 - 5
Standalone/Platform/iOS/IosLumberyardApplicationDelegate.mm → Standalone/Platform/iOS/IosO3DEApplicationDelegate.mm

@@ -16,17 +16,17 @@
 //[GFX TODO][ATOM-449] - Remove this file once we switch to unified launcher
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@interface IosLumberyardApplicationDelegate : NSObject<UIApplicationDelegate>
+@interface IosO3DEApplicationDelegate : NSObject<UIApplicationDelegate>
 {
 }
-@end    // IosLumberyardApplicationDelegate Interface
+@end    // IosO3DEApplicationDelegate Interface
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-@implementation IosLumberyardApplicationDelegate
+@implementation IosO3DEApplicationDelegate
 
 extern int ios_main();
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-- (void)launchLumberyardApplication
+- (void)launchO3DEApplication
 {
     const int exitCode = ios_main();
     exit(exitCode);
@@ -35,7 +35,7 @@ extern int ios_main();
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
 {
-    [self performSelector:@selector(launchLumberyardApplication) withObject:nil afterDelay:0.0];
+    [self performSelector:@selector(launchO3DEApplication) withObject:nil afterDelay:0.0];
     return YES;
 }
 

+ 2 - 2
Standalone/Platform/iOS/main_ios.mm

@@ -31,7 +31,7 @@ int main(int argc, char** argv)
     {
         UIApplicationMain(argc,
                       argv,
-                      @"IosLumberyardApplication",
-                      @"IosLumberyardApplicationDelegate");
+                      @"IosO3DEApplication",
+                      @"IosO3DEApplicationDelegate");
     }
 }

+ 2 - 2
Standalone/Platform/iOS/platform_ios_files.cmake

@@ -11,8 +11,8 @@
 
 set(FILES
     ../../Resources/IOSLauncher/Info.plist
-    IosLumberyardApplication.mm
-    IosLumberyardApplicationDelegate.mm
+    IosO3DEApplication.mm
+    IosO3DEApplicationDelegate.mm
     AtomSampleViewerApplication_ios.cpp
     main_ios.mm
 )

+ 2 - 2
Standalone/atomsample_viewer_ios_files.cmake

@@ -11,6 +11,6 @@
 
 set(FILES
     Resources/IOSLauncher/Info.plist
-    ios/IosLumberyardApplication.mm
-    ios/IosLumberyardApplicationDelegate.mm
+    ios/IosO3DEApplication.mm
+    ios/IosO3DEApplicationDelegate.mm
 )

+ 3 - 3
Standalone/atomsample_viewer_mac_files.cmake

@@ -10,7 +10,7 @@
 #
 
 set(FILES
-    mac/MacLumberyardApplication.h
-    mac/MacLumberyardApplication.mm
-    mac/MacLumberyardApplicationDelegate.mm
+    mac/MacO3DEApplication.h
+    mac/MacO3DEApplication.mm
+    mac/MacO3DEApplicationDelegate.mm
 )