From ba2fbf0094e224a2f47058cb2548694a62dc4358 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Tue, 12 Oct 2021 14:35:29 -0700 Subject: [PATCH 1/2] Removing (unused) boundary width Signed-off-by: mrieggeramzn --- .../Source/CullingAndLodExampleComponent.cpp | 6 ----- .../Source/CullingAndLodExampleComponent.h | 1 - Gem/Code/Source/DiffuseGIExampleComponent.cpp | 1 - .../MultiRenderPipelineExampleComponent.cpp | 1 - .../Source/MultiSceneExampleComponent.cpp | 1 - .../ParallaxMappingExampleComponent.cpp | 1 - Gem/Code/Source/ShadowExampleComponent.cpp | 21 ---------------- Gem/Code/Source/ShadowExampleComponent.h | 2 -- .../Source/ShadowedSponzaExampleComponent.cpp | 24 ------------------- .../Source/ShadowedSponzaExampleComponent.h | 2 -- Gem/Code/Source/SponzaBenchmarkComponent.cpp | 1 - 11 files changed, 61 deletions(-) diff --git a/Gem/Code/Source/CullingAndLodExampleComponent.cpp b/Gem/Code/Source/CullingAndLodExampleComponent.cpp index a3979815..40f44805 100644 --- a/Gem/Code/Source/CullingAndLodExampleComponent.cpp +++ b/Gem/Code/Source/CullingAndLodExampleComponent.cpp @@ -232,7 +232,6 @@ namespace AtomSampleViewer AZ::Render::DirectionalLightFeatureProcessorInterface::DebugDrawFlags::DebugDrawNone); dirLightFP->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled); dirLightFP->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndex]); - dirLightFP->SetShadowBoundaryWidth(handle, m_boundaryWidth); dirLightFP->SetFilteringSampleCount(handle, static_cast(m_filteringSampleCount)); dirLightFP->SetGroundHeight(handle, 0.f); @@ -396,11 +395,6 @@ namespace AtomSampleViewer { m_directionalLightFeatureProcessor->SetShadowFilterMethod(m_directionalLightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndex]); } - ImGui::Text("Boundary Width in meter"); - if (ImGui::SliderFloat("Width", &m_boundaryWidth, 0.f, 0.1f, "%.3f")) - { - m_directionalLightFeatureProcessor->SetShadowBoundaryWidth(m_directionalLightHandle, m_boundaryWidth); - } ImGui::Spacing(); ImGui::Text("Filtering (PCF specific)"); diff --git a/Gem/Code/Source/CullingAndLodExampleComponent.h b/Gem/Code/Source/CullingAndLodExampleComponent.h index ec0ce257..15d33f1e 100644 --- a/Gem/Code/Source/CullingAndLodExampleComponent.h +++ b/Gem/Code/Source/CullingAndLodExampleComponent.h @@ -126,7 +126,6 @@ namespace AtomSampleViewer static const AZ::Render::ShadowFilterMethod s_shadowFilterMethods[]; static const char* s_shadowFilterMethodLabels[]; int m_shadowFilterMethodIndex = 0; // filter method is None. - float m_boundaryWidth = 0.03f; // 3cm int m_predictionSampleCount = 4; int m_filteringSampleCount = 16; diff --git a/Gem/Code/Source/DiffuseGIExampleComponent.cpp b/Gem/Code/Source/DiffuseGIExampleComponent.cpp index 336c3439..056b0516 100644 --- a/Gem/Code/Source/DiffuseGIExampleComponent.cpp +++ b/Gem/Code/Source/DiffuseGIExampleComponent.cpp @@ -409,7 +409,6 @@ namespace AtomSampleViewer directionalLightFeatureProcessor->SetShadowmapSize(m_directionalLightHandle, AZ::Render::ShadowmapSize::Size2048); directionalLightFeatureProcessor->SetViewFrustumCorrectionEnabled(m_directionalLightHandle, false); directionalLightFeatureProcessor->SetShadowFilterMethod(m_directionalLightHandle, AZ::Render::ShadowFilterMethod::EsmPcf); - directionalLightFeatureProcessor->SetShadowBoundaryWidth(m_directionalLightHandle, 0.03f); directionalLightFeatureProcessor->SetFilteringSampleCount(m_directionalLightHandle, 16); directionalLightFeatureProcessor->SetGroundHeight(m_directionalLightHandle, 0.0f); } diff --git a/Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp b/Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp index ae134878..23157735 100644 --- a/Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp +++ b/Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp @@ -220,7 +220,6 @@ namespace AtomSampleViewer featureProcessor->SetShadowmapSize(handle, Render::ShadowmapSize::Size2048); featureProcessor->SetViewFrustumCorrectionEnabled(handle, true); featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast(m_shadowFilteringMethod)); - featureProcessor->SetShadowBoundaryWidth(handle, 0.03f); featureProcessor->SetFilteringSampleCount(handle, 32); featureProcessor->SetGroundHeight(handle, 0.f); featureProcessor->SetShadowFarClipDistance(handle, 100.f); diff --git a/Gem/Code/Source/MultiSceneExampleComponent.cpp b/Gem/Code/Source/MultiSceneExampleComponent.cpp index ed1d25e6..0408fb7f 100644 --- a/Gem/Code/Source/MultiSceneExampleComponent.cpp +++ b/Gem/Code/Source/MultiSceneExampleComponent.cpp @@ -217,7 +217,6 @@ namespace AtomSampleViewer m_diskLightFeatureProcessor->SetShadowsEnabled(m_diskLightHandle, true); m_diskLightFeatureProcessor->SetShadowmapMaxResolution(m_diskLightHandle, Render::ShadowmapSize::Size512); m_diskLightFeatureProcessor->SetConeAngles(m_diskLightHandle, DegToRad(22.5f), DegToRad(27.5f)); - m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(m_diskLightHandle, DegToRad(0.25f)); } // Create DirectionalLight diff --git a/Gem/Code/Source/ParallaxMappingExampleComponent.cpp b/Gem/Code/Source/ParallaxMappingExampleComponent.cpp index c99e2128..f0517abb 100644 --- a/Gem/Code/Source/ParallaxMappingExampleComponent.cpp +++ b/Gem/Code/Source/ParallaxMappingExampleComponent.cpp @@ -172,7 +172,6 @@ namespace AtomSampleViewer m_directionalLightFeatureProcessor->SetShadowmapFrustumSplitSchemeRatio(handle, 0.5f); m_directionalLightFeatureProcessor->SetViewFrustumCorrectionEnabled(handle, true); m_directionalLightFeatureProcessor->SetShadowFilterMethod(handle, AZ::Render::ShadowFilterMethod::Esm); - m_directionalLightFeatureProcessor->SetShadowBoundaryWidth(handle, 0.03f); m_directionalLightFeatureProcessor->SetFilteringSampleCount(handle, 32); m_directionalLightFeatureProcessor->SetGroundHeight(handle, 0.f); diff --git a/Gem/Code/Source/ShadowExampleComponent.cpp b/Gem/Code/Source/ShadowExampleComponent.cpp index 3862197b..da7b486c 100644 --- a/Gem/Code/Source/ShadowExampleComponent.cpp +++ b/Gem/Code/Source/ShadowExampleComponent.cpp @@ -415,7 +415,6 @@ namespace AtomSampleViewer featureProcessor->SetShadowmapFrustumSplitSchemeRatio(handle, m_ratioLogarithmUniform); featureProcessor->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled); featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); - featureProcessor->SetShadowBoundaryWidth(handle, m_boundaryWidthDirectional); featureProcessor->SetFilteringSampleCount(handle, static_cast(m_filteringSampleCountDirectional)); featureProcessor->SetGroundHeight(handle, 0.f); @@ -572,14 +571,6 @@ namespace AtomSampleViewer m_directionalLightFeatureProcessor->SetShadowFilterMethod( m_directionalLightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); } - if (m_shadowFilterMethodIndexDirectional != aznumeric_cast(AZ::Render::ShadowFilterMethod::None)) - { - ImGui::Text("Boundary Width in meter"); - if (ScriptableImGui::SliderFloat("Width##Directional", &m_boundaryWidthDirectional, 0.f, 0.1f, "%.3f")) - { - m_directionalLightFeatureProcessor->SetShadowBoundaryWidth(m_directionalLightHandle, m_boundaryWidthDirectional); - } - } if (m_shadowFilterMethodIndexDirectional == aznumeric_cast(AZ::Render::ShadowFilterMethod::Pcf) || m_shadowFilterMethodIndexDirectional == aznumeric_cast(AZ::Render::ShadowFilterMethod::EsmPcf)) @@ -673,7 +664,6 @@ namespace AtomSampleViewer if (!m_positionalLightShadowEnabled[index]) { m_shadowFilterMethodIndicesPositional[index] = 0; - m_boundaryWidthsPositional[index] = 0.f; m_filteringSampleCountsPositional[index] = 0; } settingsChanged = true; @@ -689,15 +679,6 @@ namespace AtomSampleViewer settingsChanged = true; } - if (m_shadowFilterMethodIndicesPositional[index] != aznumeric_cast(ShadowFilterMethod::None)) - { - ImGui::Text("Boundary Width in degrees"); - if (ScriptableImGui::SliderFloat("Width##Positional", &m_boundaryWidthsPositional[index], 0.f, 1.0f, "%.3f")) - { - settingsChanged = true; - } - } - if (m_shadowFilterMethodIndicesPositional[index] == aznumeric_cast(ShadowFilterMethod::Pcf) || m_shadowFilterMethodIndicesPositional[index] == aznumeric_cast(ShadowFilterMethod::EsmPcf)) { @@ -793,7 +774,6 @@ namespace AtomSampleViewer m_diskLightFeatureProcessor->SetShadowFilterMethod( lightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndicesPositional[index]]); - m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightHandle, AZ::DegToRad(m_boundaryWidthsPositional[index])); m_diskLightFeatureProcessor->SetFilteringSampleCount(lightHandle, static_cast(m_filteringSampleCountsPositional[index])); } } @@ -824,7 +804,6 @@ namespace AtomSampleViewer lightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndicesPositional[index]]); m_pointLightFeatureProcessor->SetFilteringSampleCount(lightHandle, static_cast(m_filteringSampleCountsPositional[index])); - m_pointLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightHandle, AZ::DegToRad(m_boundaryWidthsPositional[index])); } } } diff --git a/Gem/Code/Source/ShadowExampleComponent.h b/Gem/Code/Source/ShadowExampleComponent.h index 07c68b15..7ed4ede0 100644 --- a/Gem/Code/Source/ShadowExampleComponent.h +++ b/Gem/Code/Source/ShadowExampleComponent.h @@ -170,8 +170,6 @@ namespace AtomSampleViewer static const char* s_shadowFilterMethodLabels[]; int m_shadowFilterMethodIndexDirectional = 0; // filter method is None. int m_shadowFilterMethodIndicesPositional[PositionalLightCount] = { 0, 0, 0 }; // filter method is None. - float m_boundaryWidthDirectional = 0.03f; // 3cm - float m_boundaryWidthsPositional[PositionalLightCount] = { 0.25f, 0.25f, 0.25f }; // 0.25 degrees int m_filteringSampleCountDirectional = 32; int m_filteringSampleCountsPositional[PositionalLightCount] = { 32, 32, 32 }; diff --git a/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp b/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp index 1af0451c..b64bf246 100644 --- a/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp +++ b/Gem/Code/Source/ShadowedSponzaExampleComponent.cpp @@ -248,7 +248,6 @@ namespace AtomSampleViewer featureProcessor->SetShadowmapSize(handle, s_shadowmapSizes[s_shadowmapSizeIndexDefault]); featureProcessor->SetViewFrustumCorrectionEnabled(handle, m_isCascadeCorrectionEnabled); featureProcessor->SetShadowFilterMethod(handle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); - featureProcessor->SetShadowBoundaryWidth(handle, m_boundaryWidthDirectional); featureProcessor->SetFilteringSampleCount(handle, static_cast(m_filteringSampleCountDirectional)); featureProcessor->SetGroundHeight(handle, 0.f); @@ -478,17 +477,6 @@ namespace AtomSampleViewer s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]); } - if (m_shadowFilterMethodIndexDirectional != aznumeric_cast(ShadowFilterMethod::None)) - { - ImGui::Text("Boundary Width in meter"); - if (ScriptableImGui::SliderFloat("Width##Directional", &m_boundaryWidthDirectional, 0.f, 0.1f, "%.3f")) - { - m_directionalLightFeatureProcessor->SetShadowBoundaryWidth( - m_directionalLightHandle, - m_boundaryWidthDirectional); - } - } - if (m_shadowFilterMethodIndexDirectional == aznumeric_cast(ShadowFilterMethod::Pcf) || m_shadowFilterMethodIndexDirectional == aznumeric_cast(ShadowFilterMethod::EsmPcf)) { @@ -571,18 +559,6 @@ namespace AtomSampleViewer } } - if (m_shadowFilterMethodIndexDisk != aznumeric_cast(ShadowFilterMethod::None)) - { - ImGui::Text("Boundary Width in degrees"); - if (ScriptableImGui::SliderFloat("Width##Spot", &m_boundaryWidthDisk, 0.f, 1.f, "%.3f")) - { - for (int index = 0; index < m_diskLightCount; ++index) - { - m_diskLightFeatureProcessor->SetSofteningBoundaryWidthAngle(m_diskLights[index].m_handle, DegToRad(m_boundaryWidthDisk)); - } - } - } - if (m_shadowFilterMethodIndexDisk == aznumeric_cast(ShadowFilterMethod::Pcf) || m_shadowFilterMethodIndexDisk == aznumeric_cast(ShadowFilterMethod::EsmPcf)) { diff --git a/Gem/Code/Source/ShadowedSponzaExampleComponent.h b/Gem/Code/Source/ShadowedSponzaExampleComponent.h index 639f872b..636807b7 100644 --- a/Gem/Code/Source/ShadowedSponzaExampleComponent.h +++ b/Gem/Code/Source/ShadowedSponzaExampleComponent.h @@ -138,8 +138,6 @@ namespace AtomSampleViewer static const char* s_shadowFilterMethodLabels[]; int m_shadowFilterMethodIndexDirectional = 0; // filter method is None. int m_shadowFilterMethodIndexDisk = 0; // filter method is None - float m_boundaryWidthDirectional = 0.03f; // 3cm - float m_boundaryWidthDisk = 0.25f; // 0.25 degrees int m_filteringSampleCountDirectional = 16; int m_filteringSampleCountDisk = 16; diff --git a/Gem/Code/Source/SponzaBenchmarkComponent.cpp b/Gem/Code/Source/SponzaBenchmarkComponent.cpp index 3fd40625..d42d28d0 100644 --- a/Gem/Code/Source/SponzaBenchmarkComponent.cpp +++ b/Gem/Code/Source/SponzaBenchmarkComponent.cpp @@ -158,7 +158,6 @@ namespace AtomSampleViewer m_directionalLightFeatureProcessor->SetShadowmapSize(handle, AZ::Render::ShadowmapSizeNamespace::ShadowmapSize::Size2048); m_directionalLightFeatureProcessor->SetViewFrustumCorrectionEnabled(handle, true); m_directionalLightFeatureProcessor->SetShadowFilterMethod(handle, AZ::Render::ShadowFilterMethod::EsmPcf); - m_directionalLightFeatureProcessor->SetShadowBoundaryWidth(handle, 0.03); m_directionalLightFeatureProcessor->SetFilteringSampleCount(handle, 16); m_directionalLightFeatureProcessor->SetGroundHeight(handle, 0.f); m_directionalLightHandle = handle; From 2d45469dbcb126ebd2da27218e49c2689c361ce9 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 13 Oct 2021 16:18:22 -0700 Subject: [PATCH 2/2] Updating xshot tests Signed-off-by: mrieggeramzn --- Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png | 4 ++-- Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png b/Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png index 6e94af0f..32601823 100644 --- a/Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png +++ b/Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44b0b4cbb4854b6f16bc325c3cc25c9cbd807c30212dde93ba33e897e849742e -size 256393 +oid sha256:e66fcf8c5e9dbd7a787d270075d21f6868d3ffeeecca4a957c6bf5662d3d2026 +size 252019 diff --git a/Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png b/Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png index 242ccfc5..389d1dd3 100644 --- a/Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png +++ b/Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd608ea658492301d59e6bd241928e48e24183901c1963bd8771df72499aff5f -size 146139 +oid sha256:a5b4192c853d57d3b288b0b4c6224a56a9f5ec2e298aa5f5a5fd80f8ff76d149 +size 146896