Search Unity

How to Set LOD for Terrain Mesh?

Discussion in 'World Building' started by ChiliStudio, Jan 5, 2020.

  1. ChiliStudio

    ChiliStudio

    Joined:
    Jan 19, 2018
    Posts:
    33
    I have a very large terrain.

    I would like to make it so there are less/lower poly's when viewed from farther away, including in the inspector camera view.

    How would I go about this?

    What the mesh currently looks like(consistent tri-density throughout entire terrain mesh)
    LOD.png
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Use Unity's Terrain system, it does this for you.
     
  3. RetroFlight

    RetroFlight

    Joined:
    Nov 16, 2019
    Posts:
    41
    Increase "pixel error" in your terrain settings.
     
  4. ChiliStudio

    ChiliStudio

    Joined:
    Jan 19, 2018
    Posts:
    33
    I am using Unity's terrain system as far as I know. Do you just mean Create -> Terrain? That's what I did, and the mesh wireframe looks like this.
     

    Attached Files:

    • yrtt.png
      yrtt.png
      File size:
      500.2 KB
      Views:
      752
  5. ChiliStudio

    ChiliStudio

    Joined:
    Jan 19, 2018
    Posts:
    33
    I tried that and it didn't change how the mesh wireframe looks..
     
  6. RetroFlight

    RetroFlight

    Joined:
    Nov 16, 2019
    Posts:
    41
    It changes a lot from 1 -20. From there until 200 there is not much difference.

    Another way to see what it is doing - set pixel error to 1 and play your scene in editor with the stats running. For me like 350k triangles. Now set the pixel error to 50... like 30k triangles.
     
  7. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I don't know if this is the sort of thing you are looking for, but you might browse Horizon[On]. It's not really a terrain solution, and it's not really updated (though I believe it still works with the standard pipeline at least in 2018 LTS).

    What you do is you put your player terrain in the center and then use the Horizon mesh to handle distant details.
     
  8. ChiliStudio

    ChiliStudio

    Joined:
    Jan 19, 2018
    Posts:
    33

    For some reason, changing pixel error has no effect on the number of vertices. It is very annoying that when looking from afar at the terrain it renders over 700k vertices. Does anyone have a solution? I don't see why this isn't built-in.
     
  9. Deleted User

    Deleted User

    Guest

    Dump the Terrain Component, convert to meshes, get a good splat shader (CTS), you need color maps for the LOD/Distance blend, each section needs LOD naming:

    Terrain1_LODs [Group]
    Terrain1_LOD0
    Terrain1_LOD1 (Reduce 30% ??)
    Terrain1_LOD2(Reduce 60% ??)

    Unity will auto create the LOD components for you..
    http://wiki.unity3d.com/index.php/TerrainObjExporter

     
    Last edited by a moderator: Jan 20, 2020