From b95e897c48947688e5b0c9ad4f63ab9ed4143512 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 2 Nov 2021 13:51:06 +0100 Subject: [PATCH] Don't blur if nothing to blur (saves memory due to RG) --- .../Runtime/Lighting/Shadow/HDShadowAtlas.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs index 7f8b413778d..8332db2b832 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs @@ -566,6 +566,11 @@ TextureHandle IMBlurMoment(RenderGraph renderGraph, TextureHandle atlasTexture) internal TextureHandle BlurShadows(RenderGraph renderGraph) { + if (m_ShadowRequests.Count == 0) + { + return renderGraph.defaultResources.whiteTexture; + } + if (m_BlurAlgorithm == BlurAlgorithm.EVSM) { return EVSMBlurMoments(renderGraph, m_ShadowMapOutput);