Merge pull request #3350 from aws-lumberyard-dev/Atom/mriegger/fixupeditorshadowoptions

Fixing the softening boundary width editor options
This commit is contained in:
Guthrie Adams
2021-08-24 15:25:54 -05:00
committed by GitHub
6 changed files with 34 additions and 2 deletions
@@ -124,6 +124,9 @@ namespace AZ
//! Returns true if exponential shadow maps are disabled.
bool IsEsmDisabled() const;
//! Returns true if the softening boundary width parameter is disabled.
bool IsSofteningBoundaryWidthDisabled() const;
};
}
}
@@ -121,6 +121,8 @@ namespace AZ
bool IsShadowFilteringDisabled() const;
bool IsShadowPcfDisabled() const;
bool IsPcfBoundarySearchDisabled() const;
bool IsSofteningBoundaryWidthDisabled() const;
bool IsEsmDisabled() const;
};
} // namespace Render
} // namespace AZ
@@ -197,5 +197,16 @@ namespace AZ
return !(m_shadowFilterMethod == ShadowFilterMethod::Esm || m_shadowFilterMethod == ShadowFilterMethod::EsmPcf);
}
bool AreaLightComponentConfig::IsSofteningBoundaryWidthDisabled() const
{
// softening boundary width is always available with ESM. It controls the width of the blur kernel during the ESM gaussian
// blur passes
if (!IsEsmDisabled())
return false;
// with PCF, softening boundary width is used with the boundary search method and NOT the bicubic pcf methods
return IsPcfBoundarySearchDisabled();
}
}
}
@@ -128,5 +128,21 @@ namespace AZ
return m_pcfMethod != PcfMethod::BoundarySearch;
}
bool DirectionalLightComponentConfig::IsEsmDisabled() const
{
return !(m_shadowFilterMethod == ShadowFilterMethod::Esm || m_shadowFilterMethod == ShadowFilterMethod::EsmPcf);
}
bool DirectionalLightComponentConfig::IsSofteningBoundaryWidthDisabled() const
{
// softening boundary width is always available with ESM. It controls the width of the blur kernel during the ESM gaussian
// blur passes
if (!IsEsmDisabled())
return false;
// with PCF, softening boundary width is used with the boundary search method and NOT the bicubic pcf methods
return IsPcfBoundarySearchDisabled();
}
} // namespace Render
} // namespace AZ
@@ -162,7 +162,7 @@ namespace AZ
->Attribute(Edit::Attributes::Max, 1.f)
->Attribute(Edit::Attributes::Suffix, " deg")
->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows)
->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsPcfBoundarySearchDisabled)
->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsSofteningBoundaryWidthDisabled)
->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_predictionSampleCount, "Prediction sample count",
"Sample count for prediction of whether the pixel is on the boundary. Specific to PCF and ESM+PCF.")
->Attribute(Edit::Attributes::Min, 4)
@@ -141,7 +141,7 @@ namespace AZ
->Attribute(Edit::Attributes::Max, 0.1f)
->Attribute(Edit::Attributes::Suffix, " m")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled)
->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsSofteningBoundaryWidthDisabled)
->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_predictionSampleCount, "Prediction sample count",
"Sample count for prediction of whether the pixel is on the boundary. "
"Specific to PCF and ESM+PCF.")