- Home /
Vehicle Parts - Bones or Separate Objects?
I am making a game with a lot of vehicles in it.
I am thinking about how I should I divide up my meshes for performance so I wont have to backtrack and remake things. I have had no issues thus far I want to think ahead now because more bots=more fun.
I could continue to divide the meshes by the obvious parts that move (wheels, turrets, doors etc). Or I could use bones, (each wheel gets 1 bone, door bone, turret&gun bones).
What is most efficient?
Deforming a mesh? Rotating objects? Another option?
Answer by Kiloblargh · Dec 15, 2013 at 07:28 AM
Generally skinned mesh renderers are not efficient. I know there is a thing where you can get better performance by 'abusing' the skinned mesh renderer to make everything be one mesh but I don't think your project is such a case.
The most efficient thing is probably to use sharedMesh for all meshes that are the same and sharedMaterial for all materials that are the same, and (most importantly) have as many objects as possible use the same sharedMaterial with one texture map (with their UVs mapped to different parts of it) so dynamic batching is possible. Maybe you're already doing that, but if not, you're optimizing up the wrong tree.
But why not just test it yourself? Make 100 vehicles with "wheel bones," an identical scene 100 vehicles with separate wheel meshes, and a simple script to just spin the wheels, open the Stats window on each, see which one is performing better.
It appears you were correct.
I did a save as on my truck and separated out the wheels into thier own objects and deleted the armature. Trucks have 6 wheels. So the boned-wheels truck is made of 4 objects (2 visible), and the truck with independent wheel meshes is made of 8 (7 visible)
The results:
Little difference below 100 cars
At 100 or more cars the difference stars to become noticable
Using bones reduces draw calls
bones cause increased render time, main thread time, decrease fps
separate wheels cause huge number of draw calls
separate wheels reduce render time, main thread time, increase of 10-15 fps
So I wont bother making bones for vehicles.
Answer by autoparts15 · Aug 13, 2020 at 08:12 AM
Great question from you for all auto parts retailer. If you want to more information about this question please visit us at: https://5starsautoparts.com/
,, i appreciated to you. Make 100 vehicles with "wheel bones," an identical scene 100 vehicles with separate wheel meshes, and a simple script to just spin the wheels, open the Stats window on each, see which one is performing better. if you want to know More information please visit us at: https://5starsautoparts.com/
Your answer
Follow this Question
Related Questions
'Pre-create object VS Create when needed' Performance difference 1 Answer
Re-meshing Static Objects as one mesh? 1 Answer
Moving bones without moving mesh 1 Answer
Mesh collider cost 1 Answer
Performance Problems - Object Quantity 0 Answers