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

2D VS 3D which has better performance on mobile?

Discussion in 'General Discussion' started by chansey97, Apr 12, 2014.

  1. chansey97

    chansey97

    Joined:
    Sep 21, 2012
    Posts:
    59
    Only consider performance on mobile 2D VS 3D:

    I am desgining a game which maybe have 50 - 150 3D animation models or 50 - 150 2D animation sprites on one screen. (eg: warcraft3 vs starcraft1)

    2D or 3D which has better performance?

    3D could run smoothly on Iphone5S?

    3D model:
    I could batch all characters in one 2048 textur and one material.

    2D Sprite:
    For animation details, maybe need N textures for sequence frame.
     
    Last edited: Apr 14, 2014
  2. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    The easiest way is to try it yourself.

    I have never made something mobile, but I would think it is impossible to have 150 skinned 3d meshes on an Iphone. I would think there would be a limit between 10 and 20...
     
  3. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I'm not an expert, but I'd say it depends on the shaders/materials used on the 3d objects, how many tris they are, how big the textures are(and how many different ones they are), if you can do any form of batching for things, and on the 2d side, just how many frames of animation(not for performance, but for memory, as sprite animation is really quick in general), and if you have any 2d special effects(and same in 3d's case).

    In general performance, it also depends on things like if you have a real 3d world or if everything is on a flat plane(which cuts some of the calculations needed out).

    In any case, i agree with the above poster, I don't think you are going to get 150 skinned meshes going at once without some serious optimization. It depends as well if you are indeed interested in using Unity or trying a custom made solution. So, if you really need that many objects going at once, you are more likely going to have to go 2d with sprites. Doing sprite animation is much cheaper than skinning vertices, though it takes more memory, depending on just how many frames of animation you have. You can usually get around that by not having everything in memory at once. I don't think it would be a problem in this case though, because if you have 100 things on screen that you can see, they have to be pretty small you would think. So going 3d for this you likely don't gain anything unless you really need 3d gameplay. Many games are like that.
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The problem here is you need to create a single skinned mesh containing a lot of child objects which have bones. Having multiple skinned meshes will not batch, and this is a problem as of 4.3. Threaded draw calls *might* pop up in a later version of Unity so those reading this later should still check.

    But for now, if your units aren't skinned meshes, but normal meshes, this will batch. It's probably going to be higher performance to use sprites whichever way you cut it. Just make sure the shaders are lean and mean. You can fill a screen with 150 sprites on mobile and get them batched without too much headache. Providing they are small enough, it shouldn't really be that bad.
     
    wccrawford likes this.
  5. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    This is the way to do it IMO.