Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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:
    637
    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,149
    Convex is simpler and therefore has better performance.

    --Eric
     
  3. screenname_taken

    screenname_taken

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

    hippocoder

    Digital Ape Moderator

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

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    637
    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,149
    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:
    637
    *raises hand* 8bit! Or a byte! from 0 to sixt... 255!