According api: DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, List matrices, MaterialPropertyBlock properties);how to set the MaterialPropertyBlock for per instanced?I think Maybe should be List ?
You assign only 1 MaterialPropertyBlock. if you want a per instance property you need to set this up in the shader and add the property as an array on the materialpropertyblock. 1 per instance.
[quote=“LennartJohansen, post:2, topic: 679625, username:LennartJohansen”]
You assign only 1 MaterialPropertyBlock. if you want a per instance property you need to set this up in the shader and add the property as an array on the materialpropertyblock. 1 per instance.
[/quote]
When use: Transform grassObj = GameObject.Instantiate(grassPrefab).transform;and change the color:
MaterialPropertyBlock pb = new MaterialPropertyBlock();
pb.SetColor("_Color", grassData.color);
grass.GetComponent<MeshRenderer>().SetPropertyBlock(pb);
,but can not batching,what’s wrong?
