Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update is called once per frame
- void Update()
- {
- //split render task into chunks
- var list = new List<List<Matrix4x4>>();
- var colorList = new List<List<Vector4>>();
- int nSize = 1000;
- for (int i = 0; i < matricies.Count; i += nSize)
- {
- list.Add(matricies.GetRange(i, Math.Min(nSize, matricies.Count - i)));
- colorList.Add(colors.ToList().GetRange(i, Math.Min(nSize, matricies.Count - i)));
- }
- for (int i = 0; i < list.Count; i++)
- {
- block.SetVectorArray("_Color", colorList[i]);
- //Graphics.DrawMeshInstanced(mesh, 0, getDegubMaterial(), list[i]);
- Graphics.DrawMeshInstanced(sample.GetComponent<MeshFilter>().mesh, 0, DebugRendering.getDegubMaterial(),
- list[i], block, ShadowCastingMode.Off);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement