Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Low FPS when instantiating Objects

Discussion in 'Editor & General Support' started by TrickShotMLG, Jun 7, 2019.

  1. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    I am currently creating a survival game.
    I have a terrain with 16384m x 16384m. I wanted to spawn trees on this terrain so i can harvest them with a script. Everything works fine. But after 13000 spawned trees I only have 2 fps ingame.
    On each tree is a lod-group.

    Any ideas how I can fix that?

    I hope this is the right place for this question...
     
  2. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    38
    Does the fps deacrease in a linear way or is there a point where suddenly the fps takes a dive?
    What does the stats say about CPU and GPU limitations?

    Did you already try GPU Instancing?


    Games like Crysis etc. that have a lot of trees are using 2D sprite replacements for 3D tress at a distance.
    https://assetstore.unity.com/packages/tools/utilities/amplify-impostors-beta-119877

    or just go full Turok and have fog at a 1 meter distance ;-)
     
  3. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10


    this is the verison with GPU-Instancing.
     
  4. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    upload_2019-6-7_14-1-37.png

    Probably these mmany Tris/Verts are the problem.
    Do you have any idea how i could fix it?
     
  5. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    2,771
    I do not know your hardware setup but drawing 250.000.000 Triangles is not a good idea.
    You should look into culling , billboards and level of detail to get that number way down.
     
  6. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
  7. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    I already have billboards etc
     
  8. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    and culling doesn't work. I always get the message: out of memory in Tome Generator
     
  9. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,138
    Check on the assets World Streamer or SECTR also has solution for giant worlds like this. They both have different solutions and ways to solve the problem.
     
  10. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    I will try it. Thanks
     
  11. TrickShotMLG

    TrickShotMLG

    Joined:
    Jun 3, 2018
    Posts:
    10
    i have tried it and it worked. Thanks