From 868906801656fe2916f5f9fcdd736843a12538b0 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 29 Sep 2020 10:22:05 +0200 Subject: [PATCH 1/2] Preserve alpha channel during resolve. --- .../RenderPipeline/RenderPass/MSAA/ColorResolve.shader | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader index 60a8cb67b03..3572c956516 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader @@ -60,12 +60,13 @@ Shader "Hidden/HDRP/ColorResolve" for (int i = 0; i < sampleCount; ++i) { float4 currSample = (LoadColorTextureMS(pixelCoords, i)); - finalVal += currSample * ResolveWeight(currSample, sampleCount); + finalVal.rgb += currSample.rgb * ResolveWeight(currSample, sampleCount); + finalVal.a += currSample.a * rcp(sampleCount); } finalVal.xyz *= InverseToneMapWeight(finalVal); - return float4(finalVal.rgb, 1.0f); + return finalVal; } float4 Frag1X(Varyings input) : SV_Target From 5ee1b1c52a6b3f851e08a90591a322b0dbd48c16 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 29 Sep 2020 12:11:55 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 0bdcca67870..06c50dc8367 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -102,6 +102,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed Cutoff not working properly with ray tracing shaders default and SG (case 1261292). - Fixed shader compilation issue with Hair shader and debug display mode - Fixed cubemap static preview not updated when the asset is imported. +- Fixed issue with MSAA resolve killing the alpha channel. ### Changed - Preparation pass for RTSSShadows to be supported by render graph.