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
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
- Metal Vertex Shader warning is being thrown when creating a VR Template Project
- Asset database warning is thrown when declaring font variable in the USS text file
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