Merge pull request #924 from aws-lumberyard-dev/Atom/mriegger/ATOM-15609

Atom/mriegger/atom 15609
main
mrieggeramzn 5 years ago committed by GitHub
commit 56c8f06fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,7 +24,7 @@ function Process(context)
local shadowMap = context:GetShaderByTag("Shadowmap")
local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS")
local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS")
local shadowMapWitPS = context:GetShaderByTag("Shadowmap_WithPS")
local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS")
local forwardPass = context:GetShaderByTag("ForwardPass")
local shadingAffectsDepth = parallaxEnabled and parallaxPdoEnabled;
@ -34,6 +34,6 @@ function Process(context)
forwardPassEDS:SetEnabled(not shadingAffectsDepth)
depthPassWithPS:SetEnabled(shadingAffectsDepth)
shadowMapWitPS:SetEnabled(shadingAffectsDepth)
shadowMapWithPS:SetEnabled(shadingAffectsDepth)
forwardPass:SetEnabled(shadingAffectsDepth)
end

@ -32,7 +32,7 @@ function Process(context)
local lowEndForwardEDS = context:GetShaderByTag("LowEndForward_EDS")
local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS")
local shadowMapWitPS = context:GetShaderByTag("Shadowmap_WithPS")
local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS")
local forwardPass = context:GetShaderByTag("ForwardPass")
local lowEndForward = context:GetShaderByTag("LowEndForward")
@ -43,7 +43,7 @@ function Process(context)
lowEndForwardEDS:SetEnabled(false)
depthPassWithPS:SetEnabled(true)
shadowMapWitPS:SetEnabled(true)
shadowMapWithPS:SetEnabled(true)
forwardPass:SetEnabled(true)
lowEndForward:SetEnabled(true)
else
@ -53,7 +53,7 @@ function Process(context)
lowEndForwardEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent))
depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout)
shadowMapWitPS:SetEnabled(opacityMode == OpacityMode_Cutout)
shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout)
forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout)
lowEndForward:SetEnabled(opacityMode == OpacityMode_Cutout)
end

@ -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

Loading…
Cancel
Save