From 837458abf27a13e10ede29226bbe3aa30c3b9791 Mon Sep 17 00:00:00 2001 From: jiaweig Date: Mon, 3 May 2021 20:23:03 -0700 Subject: [PATCH] ATOM-15391 [RHI][Vulkan][Android] SSAO introduces horizontal lines on flat surfaces --- .../Common/Assets/Shaders/PostProcessing/SsaoCompute.azsl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/SsaoCompute.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/SsaoCompute.azsl index c1fa41991e..8294911b44 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/SsaoCompute.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/SsaoCompute.azsl @@ -277,6 +277,8 @@ void MainCS(uint3 thread_id : SV_GroupThreadID, uint3 group_id : SV_GroupID, uin // Gather depth values float2 depthGatherUV = mad(float2(ldsPosition), GetPixelSize(), ldsOffsetUV); + // Gather on some GPUs will fall onto same pixels in adjacent coordinates due to rounding errors + depthGatherUV += GetHalfPixelSize(); float4 depthGather = PassSrg::m_linearDepth.Gather(PassSrg::PointSampler, depthGatherUV); WriteDepthGatherToLDS(ldsPosition, depthGather);