Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

MeshInstanceRenderer : is only main-threaded?

Discussion in 'Graphics for ECS' started by Antypodish, Sep 1, 2018.

  1. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    I just run some stress testing, spawning 150k entities.

    upload_2018-9-1_13-49-29.png

    I do wonder, if mesh instance rendering is only main threaded?

    Following to that, what is Batch.Fill.InstanceProperties?
    Should I assume, this is part of mesh instance rendering?

    upload_2018-9-1_13-52-2.png

    I know I do run test in editor and there are overheads etc. But is it expected for my GPU, to be used at 50% capacity in such case?

    Btw
    Link to MeshInstanceRendererSystem.cs is broken
    https://github.com/Unity-Technologi...endering.Hybrid/MeshInstanceRendererSystem.cs

    from

    Unity-Technologies/EntityComponentSystemSamples / Documentation //content / ecs_in_detail.md
    https://github.com/Unity-Technologi...master/Documentation/content/ecs_in_detail.md
     

    Attached Files:

  2. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    I'm pretty sure it's main threaded. The system has some parallel jobs, but they are all completed within the system (so they do help performance a bit). End of the day though, the MeshInstanceRendererSystem just calls Graphics.DrawInstanced().
     
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    We are working on improving this by adding new API's that let us drive Graphics.DrawMeshInstanced in much more efficient ways. Our goal is naturally to have near zero work performed on the main thread for rendering lots of instances.
     
    optimise likes this.
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Thx guys.
    Yep it would be nice some further feature, which increases performance for none changing environment, or in general.
    But 150k rendered instances by itself, is just like crazy, even they do nothing than rendering ;)