Advertisement
Altair200333

Untitled

Nov 16th, 2021
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1.  // Update is called once per frame
  2.     void Update()
  3.     {
  4.         //split render task into chunks
  5.         var list = new List<List<Matrix4x4>>();
  6.         var colorList = new List<List<Vector4>>();
  7.         int nSize = 1000;
  8.         for (int i = 0; i < matricies.Count; i += nSize)
  9.         {
  10.             list.Add(matricies.GetRange(i, Math.Min(nSize, matricies.Count - i)));
  11.             colorList.Add(colors.ToList().GetRange(i, Math.Min(nSize, matricies.Count - i)));
  12.         }
  13.  
  14.         for (int i = 0; i < list.Count; i++)
  15.         {
  16.             block.SetVectorArray("_Color", colorList[i]);
  17.  
  18.             //Graphics.DrawMeshInstanced(mesh, 0, getDegubMaterial(), list[i]);
  19.             Graphics.DrawMeshInstanced(sample.GetComponent<MeshFilter>().mesh, 0, DebugRendering.getDegubMaterial(),
  20.                 list[i], block, ShadowCastingMode.Off);
  21.         }
  22.  
  23.        
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement