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

Question Entities and Draw Calls and Mesh Combining

Discussion in 'Entity Component System' started by Bmco, Sep 14, 2023.

  1. Bmco

    Bmco

    Joined:
    Mar 11, 2020
    Posts:
    36
    I often work with large models made up of many individual meshes (100,000+). Left alone, the model is way too slow (because of draw calls for each mesh). I've gotten around this by displaying as a combined mesh. However, I still keep a copy of the individual meshes for additional functionality (showing/hiding/changing color). If I change something, I re-combined the invidiual meshes at runtime. This solution works pretty well in the standard paradigm.

    However, I believe this is a potential reason to jump into ECS.

    Ideally, I'd like to convert these meshes to Entities and keep the model meshes uncombined. However, I'm not sure how this squares with the Draw Call problem.

    Is this a good use case for ECS?

    Note: These meshes don't move/need to be updated every frame. I want to be able to click on the individual objects and change their color and display properties, etc.
     
  2. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    263
    Are all of these meshes unique? ECS is very fast at drawing many objects with the same mesh (using instancing).
     
  3. Bmco

    Bmco

    Joined:
    Mar 11, 2020
    Posts:
    36
    There may be some identical meshes, but most are unique.
     
  4. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    263
    I think that unfortunately this would be pretty slow by default. You would still need some mesh combining to to avoid the draw call overhead.