Search Issue Tracker
By Design
Votes
0
Found in [Package]
12.0.0
Issue ID
1334356
Regression
No
[HDRP] Mesh artifacts are drawn with CommandBuffer.DrawMeshInstanced when using a ShaderGraph or some of the HDRP Materials
How to reproduce:
1. Open the user's attached "Fives.zip" project
2. Open the "DevRoom1" Scene
3. Enter Play Mode
4. Press the left mouse button couple of times
5. Press the Pause button
6. Set the Shading Mode to Wireframe in the Scene view
7. Observe the Meshes in the Scene view
Expected result: No Mesh artifacts
Actual result: Mesh artifacts are drawn
Reproducible with: 10.5.0 (2020.3.10f1), 11.0.0 (2021.1.8f1), 12.0.0 (2021.2.0a17)
Could not test with: 7.6.0 (Assets\Rendering\TestRenderFeature.cs(14,30): error CS0115: 'TestRenderFeature.CustomRenderPass.OnCameraSetup(CommandBuffer, ref RenderingData)': no suitable method found to override)
Notes:
- The issue is not reproducible with HDRP/Unlit
- The issue is reproducible with Shader Graph and HDRP/Lit/Simple Lit Materials
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.DrawMeshInstanced.html
You're passing -1 to the CommandBuffer.DrawMeshInstanced() shaderPass call, which causes it to render all passes.
I think it doesn't repro with Unlit because that shader doesn't have a shadowcaster pass.