Modelling props for games: when to use multiple meshes for an object?

One thing that has never become entirely clear to me after modelling for a while now is when it is and when it isn’t okay to have two meshes intersect for a video game?

For instance, if I’m have a very simple table where the attachment of the legs isn’t visible from most angles; should I go through the trouble of properly grafting the legs to the underside of the table and make it a single mesh with proper topology and everything, or should I as a matter of speaking just slap 4 rectangular boxes to the bottom of a flattened box and call it a day?
The latter method would obviously cost less polygons and, importantly, time, but is it at all proper practice?

I’m not just asking about tables, but more in a general sense:
When should I and when should I not make parts of an object a single mesh?

Also this question is mainly about props, but I’m actually also interested to know when to do this for characters. The characters I’ve made right now have seperate meshes for their clothes and actually don’t have bodies underneath :stuck_out_tongue:

if you made a table out of a single non-manifold mesh, the cost in polys would be much higher than making it out of 5 rectangles. making objects out of separate pieces is pretty standard, especially in games. also, you could cull off the top faces of the legs since they will be hidden inside the table.

what Modron said. video game engines dont care if meshes are manifold. The only clipping you need to worry about is in your animations mainly. this is true for both characters and for static objects. i regularly delete parts of body and clothing that will be hidden from view, makes it very easy to get the weight painting right to avoid dreaded poke through. even if you have interchangeable armor, that’s usually accomplished by literally swapping the entire body mesh with a different set of armor modeled in place. haha.

It depends on what the programmer says.
For rendering there is one main issue with per vertex lighting. In modern games we use per pixel or deferred shading so it really is not an issue. In less demanding games like mobile 3D games, they may use per vertex lighting which will result in a really ugly shadow or highlight.
There is a minor issue depending on the byte size accuracy. A vertex may be improperly lit because it thinks its on the other side of a mesh.
If you intersect a mesh too often it will cause a lot more calculations slowing down the game, it may also improperly light the object and push it into the background.
Manifold meshes have a purpose. There are 2 main shading steps for every DirectX game. 1st is the Vertex Shader. This shader writes to a depth buffer where each pixel holds a normal value and a depth value. In this shader step a manifold mesh will perform a lot faster. 2nd is the Pixel Shader. In this step, it takes the vertex shader data and calculates the final color by referencing textures and lighting information. In this step manifold meshes might matter depending on how the shader is written.

For gameplay purposes, its usually ideal to keep meshes as their individual pieces for things like physics. For instance for your table, if the leg is screwed in to the table then it would probably be best to keep them as 2 separate pieces of one final model. This way the leg can be broken off the table if needed. With that said, for physics you usually don’t delete faces to save some on the poly count. Its usually best if a piece of the mesh has no holes. You also usually don’t intersect geometry due to physics errors.

For memory usage, its usually best to have everything as one continuous piece. The amount of faces don’t matter, its the amount of vertices. Typically if a programmer gives you a poly budget, they would like the amount of vertices to be below that budget. The complex parts of the mesh in memory and for calculations are the individual vertices. So if you break up a mesh to excess in order to save polies, you might end up creating a mesh with too many vertices. For instance, if you have a table leg and delete the top of it to save a face, it typically makes no positive impact on rendering performance since the 4 vertices of the face are still there.

For me, I like to keep meshes as 1 continuous piece with no holes. They are a bit easier for me to texture, I can apply certain shader techniques on them with little issue like tessellation, and they typically don’t encounter shadow or lighting issues. The only time I use a separate piece in the same model is if the gameplay demands it, or there is potentially a shading issue.

This is some good information thats somewhat hard to find. I “knew” about the shader issue and the vertex count, but i didn’t know that holes in a mesh affected the way the shader did its calculations. I normally “cull” hidden faces in sub meshes just to make seaming and UV mapping easier, such as the columns on the porch of a house, etc. But I guess i’ll start cutting into the model to make places to weld. Thanks for sharing this info =D.

Im guessing that the bad practices of non-manifold meshes are pretty standard in the game industry. Ive studied exported character models from many games and they all feature lots and lots of non-manifold sub meshes (such as a leg with non-visible surfaces removed to prevent clipping in animation.) But it would be easy to simply cap off the legs or weld them in to the pants etc. Im wondering just how much of a performance hit it really is though. I’ll make a test spawner of a manifold mesh and non-manifold meshes in unity and run some tests if i get time. Might be useful data.

Yeah thanks for the awesome replies, that’s exactly the kind of information I was looking for!

Dave_K, that sounds like something I’d like to know as well! Can you post back with the results of your tests?