Search Unity

mesh colliders - impact of triangle count

Discussion in 'Physics' started by wouter_vugt, Nov 21, 2019.

  1. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    129
    I am creating an app with a 3d model, that needs to register tabs on it.
    It has to be a mesh collider since it does not fit any primitive.
    Other than that the model is static and does not move or use physics.

    Will it improve performance if I create a much lower resolution mesh and use that as the mesh collider.
    Or is it better to simply use the same mesh as the collider (maybe since it is already loaded in memory or something)?
     
  2. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    129
    anybody?
     
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi,
    Unity (afaik) does use some acceleration structures for collision meshes but still it's probably obvious that more is more, so it will be slower. But how much slower is another story, if it's meaningful or not. So, instead of thinking what ifs, it's better to test and benchmark how your game runs.

    That being said, I would generally use lower resolution meshes for objects that need some mesh shape and use the existing primitive shapes like sphere, box etc. when possible.

    It's also worth reading what the manual etc. say about this, there's plenty of information out there. You can also search for optimization guides when your game is the phase that you want/need to do it.
     
  4. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    129
    Thanks for your reply.
    I know I can test it out, but that takes a lot of time, I have many meshes this applies to, so I figured someone must know this instead of me having to figure it out myself.