Forest Generator help optimization

So I’m working on spawning forests on my terrain however I’m running into problems with the routes im trying.

So if I simply instantiate trees all over the terrain procedurally, having like 2k trees is causing performance issues.
So I looked into batching
for some reason none of them will batch even if I declare them as static, I thought about forcefully combining them all into a static batch but I read that that is a horrible idea with forests.
plus 2k trees spread out all over the terrain looks like a savannah not a forest

Now I know there must be something I can do to optimize the draws on my forest

  • If I take the same tree and throw it into the terrain editor and paint them on, I could literally fill the terrain with trees and not have much of a performance hit.

Anyone know of ways I can optimize my forest
and or hack my trees into the terrain system

batching will only work with certain conditions, have a look online for unity batching conditions.
I think there is an option somewhere called dynamic batching

Also the trees all have to share the same shared material
and they all have to be lit by lights with - render mode-not important

You can also combine all the trees into one object using combined mesh, I personally use combine mesh extended version which is awesome. For them to combine they have to also share the same materials, it will create as many combined objects as there are different materials. Example 2, the bark and the leaves, also the limit of combined mesh is a few thousands vertices.

It took ages for me to figure out batching and combining, it’ s best off to start simple and make changes and see if you can keep batching from the simple setups through all the changes.

thank you zoom but through recent trial by fire i learned a lot.

So trees and terrain is its own little system. definitely the most efficient system, the terrain create billboards (basically a particle representation of an object) of the trees at a certain distance away from the player. This is ideal for forests and sort of the only way to truly do this with the quantity of meshes involved for a forest. There is a painful way to get trees into the terrain procedurally which is hard and as bad as uving a model.

i learned of combining and batching for a different problem
THIS SHOULD NOT BE DONE WITH FORESTS!!!
never combine meshes that are far separated this is because if you go to render one object in front of you then all the objects its combined with are rendered too (probably one reason why they have a vert cap on combine) so combine is best for clusters.

Batching is good practice but does not alleviate mesh population. if you have alot of meshes in one place batching will not solve the problem