Trees - separate or grouped for performance?

Apologies if this has been asked already (have searched without luck):

I have a bunch of trees that will be placed (either automagically or manually) within the scenes. They are all low-poly meshes <30. I expect around 100 or so visible at any one time. They will all use the same texture.

Is there a considerable difference in performance depending on how these trees are grouped? Would unity perform better if the trees were grouped as to make each group hold 3-400 polys, or is it fine to have a large number of separate meshes with few polys?

Not sure if I’m making myself clear here. Basically: is there a large overhead when having many, small meshes compared to few moderately sized ones?

TIA!
Dan

Depends on your release date :wink:

For now:
Yes, there is a significant overhead. The rule of thumb is that you always pay for 1000 triangles no matter how many you draw.

So join away - group nearby trees until you you have 1000 polys in each.

(somewhat) Near future:
There is work going on to let Unity do this at runtime: basically, you have a bunch of trees and parent them to a GameObject with a custom script. Then they will all get rendered as one object.

So if you can live with it, I would recommend going with seperate meshes.

I have a script that does about this now. The only thing remaining, if I recall correctly, is for me to transform the normals into the new space of the combined mesh. Otherwise a recalculate normals call fixes that.

So, in conclusion, the original poster could get a programmer to help with this right now. The new mesh interface allows it. Just nothing out of the box. (As you all probably know, I’m just being clear. :slight_smile: )

Cheers,
-Jon

Thanks for the replies! Will go with separate meshes and automate joining if needed.

…or you could post your code. :stuck_out_tongue: :wink:

Again, thanks everyone!
Dan