- Home /
What am I doing wrong with my trees?
I've made this scene:
Without trees it runs at 150+ FPS without problem. But when adding the trees (about 4000) the FPS goes down to around 20. I am using the free SpeedTrees as a test but am obviously not doing something right even though the LODs and billboarding is working fine.
My main confusion is why I need to do so many draw-call and have so many batches, verts and tri's. I've read up on how this works but don't really see why it would be this much. There are only three different trees in the scene and only two of them visible in the image. I thought this would batch together much more efficiently.
Any place where I could find more info on this or how to sort it out would be appreciated. As a test I tried using a draw call minimizer on the terrain but that didnt's really work at all (and as far as I understand you're not really supposed to do that.)
12 Jan: I've made some changes based on the answer before. Any other TIPs would be great!
Bump. I've made some progress but still looking for any further ideas on this.
Answer by Buckslice · Dec 12, 2017 at 10:14 PM
I haven't work much at all with trees in Unity but 4000 just seems like a lot of trees. Combined with the fact you are using shadows too will add even more batches. The LOD and billboarding mainly reduces the vert and tri counts of the scene, it would probably be much higher than 5 million if it was not working. You can also see that you are already getting ~4000 dynamic batches which is more than half of all the draw calls.
I would say just look at the LOD and shadow cascade levels and tune those further. Make the trees go to billboards at a shorter distance and such. Also look into occlusion culling, see if that could be helpful in your scene. Lastly this article about foliage optimization is bound to have some useful information for you. Good luck! the scene looks quite nice by the way.
Thanks. That's a great article! I'm looking at doing something similar but its a bit straining on my program$$anonymous$$g skills ;)
I did make some changes on the LOD etc. as you suggested which did improve a bit. Still not desirable frame rates though. I guess maybe less trees would be the best solution if I cant figure out the suggestions in the article.
Your answer
Follow this Question
Related Questions
Baked Light Maps 2 Answers
Strange static batching behaviour 0 Answers
Draw call increased on duplicated object. But not on others 0 Answers
Share material to reduce draw calls 3 Answers