From 2e6e350e05b2d4a2991f20a8f3cd0c42647744cc Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 11 Jun 2020 12:19:48 +0200 Subject: [PATCH 1/2] specular color needs to be weighted back with the blend factor. --- .../Runtime/Material/Lit/LitDecalData.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl index 06951a7e204..eff35477336 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl @@ -16,7 +16,7 @@ void ApplyDecalToSurfaceData(DecalSurfaceData decalSurfaceData, inout SurfaceDat #ifdef DECALS_4RT // only smoothness in 3RT mode #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR float3 decalSpecularColor = ComputeFresnel0((decalSurfaceData.HTileMask & DBUFFERHTILEBIT_DIFFUSE) ? decalSurfaceData.baseColor.xyz : float3(1.0, 1.0, 1.0), decalSurfaceData.mask.x, DEFAULT_SPECULAR_VALUE); - surfaceData.specularColor = surfaceData.specularColor * decalSurfaceData.MAOSBlend.x + decalSpecularColor; + surfaceData.specularColor = surfaceData.specularColor * decalSurfaceData.MAOSBlend.x + decalSpecularColor * (1.0f - decalSurfaceData.MAOSBlend.x); #else surfaceData.metallic = surfaceData.metallic * decalSurfaceData.MAOSBlend.x + decalSurfaceData.mask.x; #endif From a9b781a7868318203a3a1c5c6b50cecce9d370b9 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 11 Jun 2020 12:20:18 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 295be2e6fcd..f6695f3e773 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -1,9 +1,15 @@ -# Changelog +# Changelog All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Fix issue causing blocky artifacts when decals affect metallic and are applied on material with specular color workflow. + ## [7.4.0] - 2020-05-22 ### Added