Jump to content

Are low poly collision meshes necessary?


Duion

Recommended Posts

When modeling my stuff I always wonder if it is really necessary to model low poly collisionmeshes. It is said you should for performance reasons, but usually you can just use the visible mesh and it works fine, there is no performance problem with that. Organic high poly shapes like player models of course should have low poly collisions, but in case of the player a whole other system is used with the bounding box.


So when does it make sense to use low poly collision meshes?


I made some tests and only really high poly objects give performance hit if you use visible mesh for collision, for example I made a metal grid that the player walks on, all out of meshes and with visible mesh collision and there was a noticeable performance drop when walking over it.

For regular scenery objects visible mesh works fine in most cases, also I could imagine physical objects that are rigid and/or destructible and fly around a lot profit a lot from as low as possible collision polygons.

Link to comment
Share on other sites

The lowpoly/convex collision meshes will always be cheaper to process, and it's not too hard to understand why when you look at how collisions are actually processed.


When you test a collision mesh, the Convex object is created, which containts the vertex/tri info of that convex collision mesh, and it's all stored in a singular package. When we go to test collisions against this, we can quickly iterate the entire mesh because we know the data inside it is stored as a convex, which lets us make several - efficient - assumptions about the math we need to successfully test for a collision. The math to test convex intersections is far simpler - and therefore faster - than concave.


When setting up a collision for a visible mesh, aka polysoup, we have no way of knowing how the tris are set up, so the smart assumption is that if they're doing a visible mesh collision, it's not going to be convex shaped. So what we end up doing is iterating over each triangle, which gets it's own Convex entry, where we can use the efficient math. This keeps it simple and standard, but does mean that the denser your mesh is, the more Convex are created, and the more time it takes to process a collision. So it ramps linearly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...