Fix for lowend pipeline not having shadows (needed update call)

This commit is contained in:
mriegger
2021-05-25 08:48:18 -07:00
parent 7d0fc03674
commit 14513af1fe
2 changed files with 14 additions and 1 deletions
@@ -203,7 +203,7 @@ namespace AZ
if (m_shadowingLightHandle.IsValid())
{
uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod;
RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{"o_directional_shadow_filtering_method"}, AZ::RPI::ShaderOptionValue{shadowFilterMethod});
RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowFilteringMethodName, AZ::RPI::ShaderOptionValue{shadowFilterMethod});
const uint32_t cascadeCount = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_cascadeCount;
ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex());
@@ -656,6 +656,7 @@ namespace AZ
CacheRenderPipelineIdsForPersistentView();
SetConfigurationToPasses();
SetCameraViewNameToPass();
UpdateViewsOfCascadeSegments();
}
void DirectionalLightFeatureProcessor::CacheCascadedShadowmapsPass() {
@@ -1344,6 +1345,15 @@ namespace AZ
}
}
void DirectionalLightFeatureProcessor::UpdateViewsOfCascadeSegments()
{
if (m_shadowingLightHandle.IsValid())
{
const uint16_t cascadeCount = GetCascadeCount(m_shadowingLightHandle);
UpdateViewsOfCascadeSegments(m_shadowingLightHandle, cascadeCount);
}
}
Aabb DirectionalLightFeatureProcessor::CalculateShadowViewAabb(
LightHandle handle,
const RPI::View* cameraView,
@@ -296,6 +296,8 @@ namespace AZ
//! This updates the shadowmap view.
void UpdateShadowmapViews(LightHandle handle);
void UpdateViewsOfCascadeSegments();
//! This calculate shadow view AABB.
Aabb CalculateShadowViewAabb(
LightHandle handle,
@@ -372,6 +374,7 @@ namespace AZ
uint32_t m_shadowmapIndexTableBufferNameIndex = 0;
Name m_lightTypeName = Name("directional");
Name m_directionalShadowFilteringMethodName = Name("o_directional_shadow_filtering_method");
static constexpr const char* FeatureProcessorName = "DirectionalLightFeatureProcessor";
};
} // namespace Render