diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4053_TAA-FP16Alpha.png index cca086bcef3..de41dc14321 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4053_TAA-FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/4053_TAA-FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9735a8fd95812d2e3e7411a8fa6a08454154f1173c09893c1539aadc4ebc265c -size 240651 +oid sha256:effbcbb24599ca89bcb0b99284769a32852531e79de9368048531e3cffe82972 +size 204829 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png index 8c2f382b5e4..b547eaad820 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5bbb287a925e1a4dba1232fff20f6b562622a60ab0b6cc8dda04fc63b4c23f75 -size 240678 +oid sha256:ec59d9a2dc4de6d09000dbfe3d736a0d97ba6f862840596d58f26b35b53661ea +size 204811 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png index 8c2f382b5e4..b547eaad820 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5bbb287a925e1a4dba1232fff20f6b562622a60ab0b6cc8dda04fc63b4c23f75 -size 240678 +oid sha256:ec59d9a2dc4de6d09000dbfe3d736a0d97ba6f862840596d58f26b35b53661ea +size 204811 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png index cca086bcef3..de41dc14321 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9735a8fd95812d2e3e7411a8fa6a08454154f1173c09893c1539aadc4ebc265c -size 240651 +oid sha256:effbcbb24599ca89bcb0b99284769a32852531e79de9368048531e3cffe82972 +size 204829 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 96198ee3d42..ed3f4116836 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -216,6 +216,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Updated Light's shadow layer name in Editor. - Increased path tracing max samples from 4K to 16K (case 1327729). - Film grain does not affect the alpha channel. +- Disable TAA sharpening on alpha channel. ## [11.0.0] - 2020-10-21 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index ebb6d9dbc35..a17d7891173 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -11,7 +11,6 @@ #define CTYPE_SWIZZLE xyz #endif - #if UNITY_REVERSED_Z #define COMPARE_DEPTH(a, b) step(b, a) #else @@ -49,6 +48,8 @@ float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, // Options // --------------------------------------------------- +#define SHARPEN_ALPHA 0 // switch to 1 if you want to enable TAA sharpenning on alpha channel + // History sampling options #define BILINEAR 0 #define BICUBIC_5TAP 1 @@ -717,5 +718,11 @@ CTYPE SharpenColor(NeighbourhoodSamples samples, CTYPE color, float sharpenStren linearC = linearC + (linearC - linearAvg) * sharpenStrength * 3; linearC = clamp(linearC, 0, CLAMP_MAX); #endif - return linearC * PerceptualWeight(linearC); + CTYPE outputSharpened = linearC * PerceptualWeight(linearC); + +#if (SHARPEN_ALPHA == 0 && defined(ENABLE_ALPHA)) + outputSharpened.a = color.a; +#endif + + return outputSharpened; }