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
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Package signature validation unexpectedly return an invalid signature status if the validation check is done after the code signing certificate validaty range has passed
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
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