Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

how to use CommandBuffer.DrawMeshInstancedIndirect draw submeshs

Discussion in 'Multiplayer' started by tonyqiu, May 30, 2023.

  1. tonyqiu


    May 29, 2019
    a model has two submeshs . i build a bufferWithArgs like this : 444,20,0,0,0,2688,20,444,0,0, and draw it with argsOffset
    code like this:
    for (int i = 0; i < render.mesh.subMeshCount; i++)
    cmd.DrawMeshInstancedIndirect(render.mesh, i, render.material, 0, render.argsBuffer, i * 5, render.blocks);
    but only draw 1 submesh in game scene. so how do i fix it? thanks.