Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atom/mriegger/shadowasv #229

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Gem/Code/Source/CullingAndLodExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16_t>(m_filteringSampleCount));
dirLightFP->SetGroundHeight(handle, 0.f);

Expand Down Expand Up @@ -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)");
Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/CullingAndLodExampleComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/DiffuseGIExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/MultiRenderPipelineExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ namespace AtomSampleViewer
featureProcessor->SetShadowmapSize(handle, Render::ShadowmapSize::Size2048);
featureProcessor->SetViewFrustumCorrectionEnabled(handle, true);
featureProcessor->SetShadowFilterMethod(handle, aznumeric_cast<Render::ShadowFilterMethod>(m_shadowFilteringMethod));
featureProcessor->SetShadowBoundaryWidth(handle, 0.03f);
featureProcessor->SetFilteringSampleCount(handle, 32);
featureProcessor->SetGroundHeight(handle, 0.f);
featureProcessor->SetShadowFarClipDistance(handle, 100.f);
Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/MultiSceneExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/ParallaxMappingExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
21 changes: 0 additions & 21 deletions Gem/Code/Source/ShadowExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16_t>(m_filteringSampleCountDirectional));
featureProcessor->SetGroundHeight(handle, 0.f);

Expand Down Expand Up @@ -572,14 +571,6 @@ namespace AtomSampleViewer
m_directionalLightFeatureProcessor->SetShadowFilterMethod(
m_directionalLightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]);
}
if (m_shadowFilterMethodIndexDirectional != aznumeric_cast<int>(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<int>(AZ::Render::ShadowFilterMethod::Pcf) ||
m_shadowFilterMethodIndexDirectional == aznumeric_cast<int>(AZ::Render::ShadowFilterMethod::EsmPcf))
Expand Down Expand Up @@ -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;
Expand All @@ -689,15 +679,6 @@ namespace AtomSampleViewer
settingsChanged = true;
}

if (m_shadowFilterMethodIndicesPositional[index] != aznumeric_cast<int>(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<int>(ShadowFilterMethod::Pcf) ||
m_shadowFilterMethodIndicesPositional[index] == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
{
Expand Down Expand Up @@ -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<uint16_t>(m_filteringSampleCountsPositional[index]));
}
}
Expand Down Expand Up @@ -824,7 +804,6 @@ namespace AtomSampleViewer
lightHandle, s_shadowFilterMethods[m_shadowFilterMethodIndicesPositional[index]]);

m_pointLightFeatureProcessor->SetFilteringSampleCount(lightHandle, static_cast<uint16_t>(m_filteringSampleCountsPositional[index]));
m_pointLightFeatureProcessor->SetSofteningBoundaryWidthAngle(lightHandle, AZ::DegToRad(m_boundaryWidthsPositional[index]));
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Gem/Code/Source/ShadowExampleComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
24 changes: 0 additions & 24 deletions Gem/Code/Source/ShadowedSponzaExampleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16_t>(m_filteringSampleCountDirectional));
featureProcessor->SetGroundHeight(handle, 0.f);

Expand Down Expand Up @@ -478,17 +477,6 @@ namespace AtomSampleViewer
s_shadowFilterMethods[m_shadowFilterMethodIndexDirectional]);
}

if (m_shadowFilterMethodIndexDirectional != aznumeric_cast<int>(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<int>(ShadowFilterMethod::Pcf) ||
m_shadowFilterMethodIndexDirectional == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
{
Expand Down Expand Up @@ -571,18 +559,6 @@ namespace AtomSampleViewer
}
}

if (m_shadowFilterMethodIndexDisk != aznumeric_cast<int>(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<int>(ShadowFilterMethod::Pcf) ||
m_shadowFilterMethodIndexDisk == aznumeric_cast<int>(ShadowFilterMethod::EsmPcf))
{
Expand Down
2 changes: 0 additions & 2 deletions Gem/Code/Source/ShadowedSponzaExampleComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion Gem/Code/Source/SponzaBenchmarkComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Scripts/ExpectedScreenshots/Shadow/spot_filter_method.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Scripts/ExpectedScreenshots/ShadowedSponza/spot_filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.