[Unity]错误:DrawMesh requires material.SetPass before!
2020/01
03
14:01
private int GetScore()
{
var mMatObj = Resources.Load("Benchmark/Mat") as Material;
if (mMatObj.SetPass(0))
{
for(uint i=0; i<1000; ++i)
{
Graphics.DrawMeshNow(mMeshObj, m);
}
}
return 0;
}
由于Material中的Shader失效,会导致SetPass0成功,但是在DrawMeshNow中报错:DrawMesh requires material.SetPass before!
把Shader修正即可
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: [Unity]错误:DrawMesh requires material.SetPass before!
Post Link: [Unity]错误:DrawMesh requires material.SetPass before!