DrawMeshInstanced Bug in Unity SDK
Unity 2020~2021 version - Leapmotion SDK Editor Error fix
Capsule hand Graphic.DrawMeshInstanced()
Summary
Change the Unity function "DrawMeshInstanced()" to "DrawMesh()". Because There is constantly occured error log in editor when run Leap motion sample "Capsule hand". Error log
"DrawMeshInstanced does not support the shader 'Standard' because it does not read any instanced properties. Try switching to DrawMeshInstancedProcedural if the shader is doing procedural instancing"
According to Unity API document, GPU instancing function can be used by Graphic.DrawMesh() function when check "Enable GPU Instancing" checkBox. So there is no disadvantage about performance. After change function, there is no error log and work properly. https://docs.unity.cn/2021.1/Documentation/Manual/GPUInstancing.html
Contributor Tasks
- [x] Add any release testing considerations to the MR for the next release.
- [x] Check any relevant CHANGELOG files have been updated.
- [x] Ensure documentation requirements are met e.g., public API is commented.
- [x] Consider any licensing/other legal implications for this MR e.g. notices required by any new libraries.
Reviewer Tasks
Add any instructions or tasks for the reviewer such as specific test considerations before this can be merged.
Use emojis in review threads to communicate intent and help contributors.
- [ ] Code reviewed.
- [ ] Non-code assets e.g. Unity assets/scenes reviewed.
- [ ] Documentation has been reviewed. Includes checking documentation requirements are met and not missing e.g., public API is commented.
- [ ] Checked and agree with release testing considerations added to MR for the next release.
Thanks for making a contribution - will review soon.
Hi beargrllys, can you add some more information about what you are doing when you see these errors please? Also which version of Unity are you using?
I used Unity 2021.3.11f1
An update - we need to look into other potential causes of this issue.
Hey, just as a note, Unity seems to have a known issue for this type of problem here (the material used for capsule hands has instancing enabled)
It seems to not actually be an issue, and instead just shows a false error that is clear-able.
@beargrllys did you find the error stopped you from seeing the capsule hands render, or was it just that there was an error in the console? :)
Closing this as we've had no response.