From 66e2135d59aa1abc3f7ee789d1f80b35128affb0 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 1 Apr 2020 16:27:50 +0200 Subject: [PATCH 1/2] Fixed PBR shader rendering in deferred --- .../Editor/ShaderGraph/HDRenderStates.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDRenderStates.cs b/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDRenderStates.cs index 6a664f6d81e..8bbc24dd450 100644 --- a/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDRenderStates.cs +++ b/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDRenderStates.cs @@ -398,7 +398,8 @@ static class Uniforms public static RenderStateCollection PBRGBuffer = new RenderStateCollection { { RenderState.Cull(Cull.Off), new FieldCondition(Fields.DoubleSided, true) }, - { RenderState.ZTest(Uniforms.zTestGBuffer) }, + { RenderState.ZTest(ZTest.Equal), new FieldCondition(Fields.AlphaClip, true) }, + { RenderState.ZTest(ZTest.LEqual), new FieldCondition(Fields.AlphaClip, false) }, { RenderState.Stencil(new StencilDescriptor() { WriteMask = $"{ 0 | (int)StencilUsage.RequiresDeferredLighting | (int)StencilUsage.SubsurfaceScattering | (int)StencilUsage.TraceReflectionRay}", From 834a176deb114173b84af7bfd5221b5740b40d7e Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 1 Apr 2020 16:29:04 +0200 Subject: [PATCH 2/2] Updated 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 e5974d1dab2..3cb0ba2a3b7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -500,6 +500,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shadow cascade tooltip when using the metric mode (case 1229232) - Fixed how the area light influence volume is computed to match rasterization. - Focus on Decal uses the extends of the projectors +- Fixed PBR shader ZTest rendering in deferred. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled