Search Issue Tracker

Won't Fix

Votes

2

Found in

2019.4

2020.2

2020.2.1f1

2021.1

2021.2

Issue ID

1316016

Regression

No

Clipped parts of a Surface make parts of an overlapping Surface black when using the HDRP\Lit Shader and Surface Type is Opaque

HD RP

-

How to reproduce:
1. Open the user-attached project "Z Fighting Bug Test.zip"
2. Open the Scene "OutdoorsScene.unity"
3. Select the "Alpha Clipping Material" from the Assets folder
4. Make sure that the Shader is set to "HDRP\Lit", the Surface Type is set to "Opaque" and "Alpha Clipping" is checked in the Inspector window
5. Open the Game view

Expected result: No part of any Surface is blacked out
Actual result: Cutout parts of the left plane "Plane" when Alpha Clipping is checked cause the corresponding parts of the right plane "Plane (1)" to appear black

Reproducible with: 2019.4.21f1, 2020.2.6f1, 2021.1.0b8, 2021.2.0a7

Notes:
- Tested in builds and Editor with Direct3D11, Direct3D12, Vulkan and Metal Graphics APIs
- Changing the Transform Position of the "Main Camera" GameObject on the X-axis to approx. -2.3 or less, will render the right plane "Plane (1)" on top of the left plane "Plane" in the Game view and make parts of the left plane appear black
- Changing the Shader of the "Alpha Clipping Material" to "HDRP\LitTessellation" or changing the Surface Type of the "Alpha Clipping Material" to "Transparent" make the issue disappear
- The issue is also apparent in the Scene view but moving the Viewport camera makes the texture glitch through the black parts

  1. Resolution Note:

    The underlying issue here is the z-fighting between the objects. Alpha clipping is not done during the gbuffer pass for performance reasons

Add comment

Log in to post comment