Search Unity

Question about convex and non convex performance.

Discussion in 'Physics' started by screenname_taken, Dec 28, 2014.

  1. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    Just want to know which one has the best performance. I know it's probably specific to how the meshes are constructed, but lets say that i have a platform relatively flat and boxy. You know how it makes a more solid lets say collider if i select convex, polycount goes down and the like. But is it better for performance? It has a polygon limit so i'm guessing it has some overhead on runtime?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Convex is simpler and therefore has better performance.

    --Eric
     
  3. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    Right to the point. Thanks.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Lots of maths tricks can be used with convex to speed stuff up.
     
  5. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    I was wondering because sometimes, when something has a limit, it's to do with performance on current hardware.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    A limit is almost always because there's some trick/shortcut that can be done that wouldn't work without that limit. Convex colliders have a 255 polygon limit, and the number 255 should be familiar to anyone who knows how computers work...clearly there's some byte indexing going on that helps somehow.

    --Eric
     
  7. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    *raises hand* 8bit! Or a byte! from 0 to sixt... 255!