diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 8e8464efffe..8aabb90d688 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shader graph not supporting indirectdxr multibounce (case 1294694). - Fixed the planar depth texture not being properly created and rendered to (case 1299617). - Fixed C# 8 compilation issue with turning on nullable checks (case 1300167) +- Fixed affects AO for deacl materials. ### Changed - Removed the material pass probe volumes evaluation mode. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalUI.cs index e8d4d10e9fe..b3ad35c5241 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalUI.cs @@ -47,11 +47,14 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change static public void SetupCommonDecalMaterialKeywordsAndPass(Material material) { + bool affectsMaskmap = false; + affectsMaskmap |= material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f; + affectsMaskmap |= material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f; + affectsMaskmap |= material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f; + CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_ALBEDO", material.HasProperty(kAffectAlbedo) && material.GetFloat(kAffectAlbedo) == 1.0f); CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_NORMAL", material.HasProperty(kAffectNormal) && material.GetFloat(kAffectNormal) == 1.0f); - CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f); - CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f); - CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f); + CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", affectsMaskmap); // Albedo : RT0 RGB, A - sRGB // Normal : RT1 RGB, A