From 028cbc7b96c2943282d5be53c3b945abad49888b Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Fri, 16 Apr 2021 16:14:06 +0200 Subject: [PATCH] Film grain should not affect the alpha channel --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/PostProcessing/Shaders/FinalPass.shader | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b3253f7174e..fc19bcb2d6f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -213,6 +213,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - UI for Frame Settings has been updated: default values in the HDRP Settings and Custom Frame Settings are always editable - 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. ## [11.0.0] - 2020-10-21 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader index b1fc0df495b..6aefe9c642c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader @@ -124,7 +124,7 @@ Shader "Hidden/HDRP/FinalPass" float lum = 1.0 - sqrt(Luminance(outColor)); lum = lerp(1.0, lum, _GrainParams.y); - outColor += outColor * grain * _GrainParams.x * lum; + outColor.xyz += outColor.xyz * grain * _GrainParams.x * lum; } #endif