diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c3ef0d7248a..c5d70910152 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -544,6 +544,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue that was collapsing the volume components in the HDRP default settings - Fixed warning about missing bound decal buffer - Fixed shader warning on Xbox for ResolveStencilBuffer.compute. +- Fixed PBR shader ZTest rendering in deferred. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/PBRSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/PBRSubTarget.cs index 151239b87c5..57e843f48c0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/PBRSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/PBRSubTarget.cs @@ -277,7 +277,8 @@ static class PBRRenderStates public static RenderStateCollection GBuffer = new RenderStateCollection { { RenderState.Cull(Cull.Off), new FieldCondition(Fields.DoubleSided, true) }, - { RenderState.ZTest(CoreRenderStates.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}",