- Home /
Combined Meshes for Dynamic Objects
I'm trying to reduce Draw Calls in an arcade-style bowling game, and have hit a wall with the pins. My game actually features 100 pins per level (all 10 frames), so, uncombined, we're talking about 100 (x2 materials) draw calls for the same simple pin mesh.
To keep things clean, I have 10 Master Pins which instantiate 9 Slave Pins each at start up. This works fine except for the excessive Draw Calls. I have tried making the slave pins children of the master and using CombineChildren, but this makes them share the master pin transform, and I need them to keep independent transforms so they can move freely when struck by the ball or other pins.
I'm not sure, but I THINK CombineMeshes will leave me with the same problem.
Thoughts? Thanks!
Answer by Mortennobel · Apr 15, 2011 at 07:21 PM
Since you need independent movement of each pin I don't think CombineMeshes will help you.
Would it be possible to have only one material for all pins? This would save you 100 draw calls.
I found this good answer about optimization.
http://answers.unity3d.com/questions/7247/whats-the-best-way-to-reduce-draw-calls
Yeah, good call on the combining the pin materials at least. An obvious oversight on my part.
Answer by DaveA · Apr 15, 2011 at 07:28 PM
I'm just wondering how you have this set up. You have 100 pins. Is that in 10 lanes? You say 'all 10 frames' which implies there are really just 10 on screen at any time. If that's the case, I'd go with just 10 pins total. If you have more lanes, and they don't get used (just for decoration), then you can combine those into one mesh.
No, I don't think I explained it well. It's 10 consecutive frames in one big LONG roll through an outdoor course. It's kind of the big twist for my game.
Ok. Well if all 100 could be seen on screen, and each may have its own arbitrary position and rotation, there aren't many options. If you can hide them until they're needed, and hide them again once the player gets beyond seeing previous ones, that might help. Or you can use a single 10-pin mesh until they get hit.
Your answer
Follow this Question
Related Questions
New to unity, struggling to make objects combine into single physics object. 0 Answers
Combine meshes at runtime without all mesh as children of mesh 0? 1 Answer
combining littles sprites into one big sprite ? 1 Answer
Mesh.CombineMesh() results in different heights between objects 1 Answer
Save drawcalls with animated figures 0 Answers