Search Unity

How to make a unity terrain consume less gpu

Discussion in 'General Graphics' started by InAngel, Mar 19, 2018.

  1. InAngel

    InAngel

    Joined:
    Dec 30, 2017
    Posts:
    33
    Hello,
    I have made a terrain using gaia(I have tried without gaia and got the same problem).
    When i set a player with a camera in the terrain and check my fps its nearly unplayable,
    My best fps score is up to 50 when i look at the sky and when im trying to walk and looking anywhere else i have about 13 fps.
    I'v tried some things like changing the properties of shadows in the editor and Lod Bias, with little effect.
    I would love any help or tips to make my terrain preform better.
     
  2. Mlackey

    Mlackey

    Joined:
    Dec 5, 2014
    Posts:
    41
    Need more information regarding the terrain size, your computer specs, whether you've placed grass or trees on it, size textures applying to the terrain, how many textures applying to the terrain, camera view distance, etc.

    One things to make sure of is that you only have 1 active camera, the more you have the more it affects performance.
     
  3. InAngel

    InAngel

    Joined:
    Dec 30, 2017
    Posts:
    33
    The terrain size is 2048 x 2048, my computer specs are : Processor: intel i7-3770 , and Graphics Card: NVIDIA Geforce GTX 650.
    there's grass and more details, plenty of trees, its meant to be a forest.
    the textures are max sized to 512 and the compression is set to normal.
    about the camera you were right, it was a really big deal. i had a camera with post processing behavior on it and when i deleted it from the scene my fps jumped up to nearly 60 fps.
    is there anything else i should change to make better performance.
     
  4. Mlackey

    Mlackey

    Joined:
    Dec 5, 2014
    Posts:
    41
    A GTX-650 should be more than enough for a standard terrain.

    Adjust the camera viewing distance to about 300-400 since you are dealing with a thick forest, add fog effect to the edge of the maximum viewing distance to cut off the player's view distance since you're dealing with forest.

    You'll want to have 1 camera for the scene and you'll want to decide if you want 1st person or 3rd person. The camera angle can affect performance.

    For trees, I suspect you're starting with SpeedTree. The two that Unity comes with is highly performance heavy and placing many are taxing on the system. You'll want to purchase or create a tree asset for the forest. I recommend, if you decide to purchase, one by NatureManufacturer for 20 bucks. It comes with rocks, trees, grass to get you started and already have LOD (Level of Detail) worked into it.

    The next problem with Unity is that grass and trees are performance heavy, high detail grass can eat up memory like crazy, this is where deciding how you will do grass comes into play. It'll require a lot of tweaking of grass size, color, as well as resolution to get your desired effect.

    Lighting plays a role too, if you're planning on using the entire map, you're dealing with a lot of grass and trees that realistically a player will not navigate, I recommend actually reducing the terrain size to 1024x2014 or even 512x512. You'll also be able to work more with the finer details of the map's texturing.

    Unity's terrain is highly unoptimized and is an old system from back in 2008/2009. It is a system that I recommend buying plugins for, GAIA and Vegetation Studio make for an amazing combination of terrain creation, Veg. Studio also lets you work with the GPU and multithreads your terrain's materials such as trees and grass in a manner that is most effective for your GPU. Since using the 2, I've improved the looks of my game and increased the performance.

    I don't know where you stand financially but they are something to consider.

    ------------

    I should add, a better graphics card (GTX 1060) or above is really needed as your graphics card is on the lower end of gpu's in today's computing world. Your processor is good, (I run a 4790k w/ a R9 390) since my target is more for mid-level computers.