diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 183e13b5ea3..21b132c9b91 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix for rendering thumbnails. [case 1348209](https://issuetracker.unity3d.com/issues/preview-of-assets-do-not-show-in-the-project-window) - Fixed a regression bug where XR camera postion can not be modified in beginCameraRendering [case 1365000] - Fixed an issue in where installing the Adaptive Performance package caused errors to the inspector UI [1368161](https://issuetracker.unity3d.com/issues/urp-package-throws-compilation-error-cs1525-when-imported-together-with-adaptive-performance-package) +- Fixed broken soft shadow filtering. [case 1374960](https://issuetracker.unity3d.com/product/unity/issues/guid/1374960/) - Fixed Lens Flare not accounting Render Scale setting. [case 1376820](https://issuetracker.unity3d.com/issues/urp-lens-flare-do-not-account-for-render-scale-setting) - Fixed an issue where SSAO would throw a "RenderingCommandBuffer: invalid pass index" errors. [case 1374215](https://issuetracker.unity3d.com/issues/urp-renderingcommandbuffer-invalid-pass-index-errors-when-opening-urp-sample-scenes) - Fixed performance regression for 2D shaders where alpha discard was disabled. [case 1335648] diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs index c7050766841..ae83372bcfe 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs @@ -84,7 +84,6 @@ public ShadowResolutionRequest(int _visibleLightIndex, int _perLightShadowSliceI bool m_CreateEmptyShadowmap; - bool m_SupportsBoxFilterForShadows; ProfilingSampler m_ProfilingSetupSampler = new ProfilingSampler("Setup Additional Shadows"); int MAX_PUNCTUAL_LIGHT_SHADOW_SLICES_IN_UBO // keep in sync with MAX_PUNCTUAL_LIGHT_SHADOW_SLICES_IN_UBO in Shadows.hlsl @@ -118,7 +117,6 @@ public AdditionalLightsShadowCasterPass(RenderPassEvent evt) m_AdditionalShadowParams_SSBO = Shader.PropertyToID("_AdditionalShadowParams_SSBO"); m_UseStructuredBuffer = RenderingUtils.useStructuredBuffer; - m_SupportsBoxFilterForShadows = Application.isMobilePlatform || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Switch; // Preallocated a fixed size. CommandBuffer.SetGlobal* does allow this data to grow. int maxVisibleAdditionalLights = UniversalRenderPipeline.maxVisibleAdditionalLights; @@ -977,17 +975,14 @@ void SetupAdditionalLightsShadowReceiverConstants(CommandBuffer cmd, ref ShadowD if (softShadows) { - if (m_SupportsBoxFilterForShadows) - { - cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset0, + cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset0, new Vector4(-invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset1, + cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset1, new Vector4(invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset2, + cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset2, new Vector4(-invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset3, + cmd.SetGlobalVector(AdditionalShadowsConstantBuffer._AdditionalShadowOffset3, new Vector4(invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); - } // Currently only used when !SHADER_API_MOBILE but risky to not set them as it's generic // enough so custom shaders might use it. diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs index 5afe3b6a859..71ae4acfc23 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs @@ -29,7 +29,6 @@ private static class MainLightShadowConstantBuffer float m_CascadeBorder; float m_MaxShadowDistanceSq; int m_ShadowCasterCascadesCount; - bool m_SupportsBoxFilterForShadows; RenderTargetHandle m_MainLightShadowmap; internal RenderTexture m_MainLightShadowmapTexture; @@ -65,7 +64,6 @@ public MainLightShadowCasterPass(RenderPassEvent evt) MainLightShadowConstantBuffer._ShadowmapSize = Shader.PropertyToID("_MainLightShadowmapSize"); m_MainLightShadowmap.Init("_MainLightShadowmapTexture"); - m_SupportsBoxFilterForShadows = Application.isMobilePlatform || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Switch; } public bool Setup(ref RenderingData renderingData) @@ -284,17 +282,14 @@ void SetupMainLightShadowReceiverConstants(CommandBuffer cmd, VisibleLight shado // This workaround will be removed once we will support soft shadows per light. if (supportsSoftShadows) { - if (m_SupportsBoxFilterForShadows) - { - cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset0, - new Vector4(-invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset1, - new Vector4(invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset2, - new Vector4(-invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); - cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset3, - new Vector4(invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); - } + cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset0, + new Vector4(-invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); + cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset1, + new Vector4(invHalfShadowAtlasWidth, -invHalfShadowAtlasHeight, 0.0f, 0.0f)); + cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset2, + new Vector4(-invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); + cmd.SetGlobalVector(MainLightShadowConstantBuffer._ShadowOffset3, + new Vector4(invHalfShadowAtlasWidth, invHalfShadowAtlasHeight, 0.0f, 0.0f)); // Currently only used when !SHADER_API_MOBILE but risky to not set them as it's generic // enough so custom shaders might use it.