Search Unity

Improve performance with terrain trees

Discussion in 'World Building' started by MikeyJY, Apr 24, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    I have an terrain with a lot of trees, they are gameObjects, not Terrain tree instances:
    upload_2020-4-24_19-53-2.png

    They are not causing global lagg, but when the player is near this island the framerate is going down. How to improve performance(Without LOD)?
     
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Try this:
    • Setting the trees material to instanced (should trigger GPU instancing).
    • Ensuring the trees are static (triggers static batching).
    • Building occlusion so hidden trees are not displayed.
     
    mivasiliauskas and MikeyJY like this.
  3. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    An additional thing to do would be to combine the meshes of the trees into groups reducing the draw calls Unity has utilities for doing this.

    Although really you should try and add LODing with reduced polycount trees and ideally instancing (sprites used for distance objects) unfortunately unity does not have a built in way to do this.
     
    MikeyJY likes this.