Search Unity

Game runs very slowly with Alot of trees

Discussion in 'General Graphics' started by etaymarkman, Apr 15, 2020.

  1. etaymarkman

    etaymarkman

    Joined:
    Jun 26, 2015
    Posts:
    13
    Hi.

    I have a very large map in my game. which is spread over multiple terrains and uses Alot of trees whose locations are based on real world data.

    now once i put the trees on. game performance slows down to like 30-15 FPS in a strong gaming computer and i understand that for a laptop it means that the game will not want to work. the Profiler says that the problem is Camera.render-culling-prepareSceneCullingParameters. a script i have no access to

    The thing is. the map is so big(will be over 200 kilometers when finished) it requires a shifting origin script to run. and i use the floating origin script from unity wiki and multiple terrains that hide and show according to another script i found online. so that means "no static objects" until i can find a better shifting origin solution. and alot of unity's performance boosting features simply don't work even if the only object in the map that moves is the player's train.

    I tried the altTrees asset which says to boost frame rates. but it's still beta(for YEARS) and is very buggy nowadays in unity 2019.

    now i would like a solution that just like altTrees can import the existing trees from the terrain and draw them in a more efficient manner. or ways to boost the culling performance of speedTree. i am using The Palm,Conifer and Broadleaf desktop trees since they are similar enough to what can be found in real life in the area
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,453
    I think you should be able to use StaticBatchingUtility.Combine to dynamically add all the trees of a terrain tile (grouped under a root GameObject) to static batching. You should also still be able to move them via their root then.