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.

Question Difference between different draw methods?

Discussion in 'General Graphics' started by SuperFranTV, Oct 8, 2022.

  1. SuperFranTV

    SuperFranTV

    Joined:
    Oct 18, 2015
    Posts:
    135
    Hello, I would like to clarify what the differences are and which one offers the best performance?

    Assuming my project only needs 1 shader and 1 material but differend meshes, the game objects then use different settings on the material (material property blocks)

    My idea for a high-performance method would be to use as few SetPass calls and batches as possible and to send as little data as possible between CPU & GPU.

    Please correct me, if I am wrong.

    Why indirect methods? My knowledge says that such a higher number can be grouped into a batch.
    Indirect and procedural are equal in performance level.

    Now functions do not need a CPU readback and are therefore more effective?

    One feature is the difference in name, between Draw & Render, what does that mean?

    RenderMeshIndirect (300.000 Spheres = 13 FPS on my PC)

    DrawMeshInstancedProcedural (300.000 Sphere also 13 FPS)

    The CPU says 75ms and GPU is by 0,8ms, the profiler says:
    - Gfx.WaitForPresentOnGfxThread / Semaphore.WaitForSignal causes this
    i think that means CPU is waiting for the GPU?

    DrawProceduralIndirectNow (not tested now)
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,497
    Graphics code runs on a different CPU thread. It is telling your that that thread is being overloaded with the rendering, not the actual rendering on the GPU.
    If off, maybe enable graphics jobs.

    The fastest way is to bake the meshes into 1 big mesh so it's just 1 object. This only works if the objects move all at once however.

    Maybe simply enabling GPU instancing also will help. Then Unity devides the batches into draw calls itself