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 heavy are a lot of similar yet different meshes, same materials?

Discussion in 'Editor & General Support' started by infinitypbr, Oct 10, 2016.

  1. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    Hey!

    I'm thinking of having many different, yet very similar, meshes for a level, so that it doesn't repeat at all. They're normal meshes, and all share the same material. Would this slow down a game in any considerable amount?

    Thanks!
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    This should not slow your game at all. In fact, having the same material for many different meshes will allow you to "batch" several meshes to reduce draw calls to your GPU. What you're doing is not bad practice or anything to worry about unless you get undesirable results.

    To get some extra savings, mark any objects that will not move as "static" in the upper-right of the inspector, it will allow for some more powerful batching (but will slow your game down a ton if those static objects move!).

    If you're especially tech-graphics savvy, and if your meshes are similar enough, you could have 1 large vertex array shared between all of your meshes and use a different array of triangle indices for each mesh.
     
    infinitypbr likes this.
  3. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149

    Good to hear! :D That's what I figured, but since i'm not the best at optimization or understanding what's going on under the hood, I figured I should ask.