Search Unity

Different enemy models using same material vs different material

Discussion in 'Getting Started' started by Sparticus, May 8, 2021.

  1. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Hey all,

    I'm still trying to understand the things I need to do within Unity to get the best performance for mobile games.

    From the Unity asset store I have purchased many enemy models for my game. In my game I will have maybe 10 different enemies.

    I noticed if I add 50+ enemies to the screen (multiples of each type of enemy) I end up with a total of 10 batches (enemies with the same mesh got batched together)

    I've read that getting 3d models to use the same material is better for performance. So I took the time to make 2 of my enemies to use the exact same material. After running the game the number of batches is still 10.

    So, my question is. Is it worth the effort to create a 2048x2048 texture that contains all of the enemies textures and create 1 material from it... and apply that same material to all enemies? I am looking for performance gains here. I'm gunna guess when I am done since all enemies use different meshes my "batches" will be the same.

    Thanks
     
  2. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Anyone have any thoughts? I'd assume having different meshes using the same material would be a performance boost.... but the number of batches doesn't change when I tried it. It's a lot of work for me to move all textures into the same material so I don't want to go through the effort if it makes no/little difference.