Skip to content

Commit 7bb0afd

Browse files
author
Antoine Lelievre
authored
PBR shader gbuffer ztest (#43)
* Fixed PBR shader rendering in deferred * Updated changelog
1 parent 23af7ab commit 7bb0afd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
544544
- Fixed an issue that was collapsing the volume components in the HDRP default settings
545545
- Fixed warning about missing bound decal buffer
546546
- Fixed shader warning on Xbox for ResolveStencilBuffer.compute.
547+
- Fixed PBR shader ZTest rendering in deferred.
547548

548549
### Changed
549550
- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled

com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/PBRSubTarget.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ static class PBRRenderStates
277277
public static RenderStateCollection GBuffer = new RenderStateCollection
278278
{
279279
{ RenderState.Cull(Cull.Off), new FieldCondition(Fields.DoubleSided, true) },
280-
{ RenderState.ZTest(CoreRenderStates.Uniforms.zTestGBuffer) },
280+
{ RenderState.ZTest(ZTest.Equal), new FieldCondition(Fields.AlphaClip, true) },
281+
{ RenderState.ZTest(ZTest.LEqual), new FieldCondition(Fields.AlphaClip, false) },
281282
{ RenderState.Stencil(new StencilDescriptor()
282283
{
283284
WriteMask = $"{ 0 | (int)StencilUsage.RequiresDeferredLighting | (int)StencilUsage.SubsurfaceScattering | (int)StencilUsage.TraceReflectionRay}",

0 commit comments

Comments
 (0)