Search Unity

4 Terrains vs 1 Terrain

Discussion in 'General Graphics' started by tanmaykulkarni, Jun 9, 2021.

  1. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Hey dudes, I have a scene that I am trying to optimize. What my scene is a huge forest. I want the best performance as my target platform is mobile. When baking global illumination using more terrains can help to increase the scale in lightmap per each terrain. But can using 4 terrains instead of 1 can cause performance issues? I think it's causing.. I just wanna know that using 4 terrains instead of 1 is good or not(for performance).

    Also, my terrain has a large number of trees.
     
  2. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,749
    Terrain is a resource hog in Unity, so 1 terrain is better than 4, as far as optimization goes.
     
  3. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Thanks for the quick reply! I appreciate your help.
     
    warthos3399 likes this.
  4. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    See the reference
    ALWAYS use lowest res hightmap for mobiles
    Also always use billboard for trees for mobile platforms
    1. You can change unity height map resolution to reduce terrain triangles(note: after changing height map resolution, your created height map will be lose)
     
    tmonestudio likes this.
  5. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    But when lowering the resolution, will my shadows become blurry?
     
  6. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    As I am using baked shadows with subtractive mode
     
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    No
     
  8. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Thanks for the help!
     
  9. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Hey, do you have a solution for blurry baked shadows on terrain?
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    in the real world the shadows are blurry
     
  11. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    not too blurry as I am getting
     
  12. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    any solution to get more sharp shadows on terrain?
     
  13. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You can use 2048 or 4096 lightmap size in lighting window
     
  14. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    I am already using 4096 x 4096 lightmaps with a resolution of 150 texels per unit.
     
  15. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    send screenshots from shadows quality
     
  16. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Here are my screenshots of blurry shadows and lighting settings
     

    Attached Files:

  17. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    So you must use 4 terrains to have higher lightmap resolution
    Your current 1 terrain is too big and has limitations on lightmap resolution
     
  18. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    That again comes to the title of this thread, 4 terrains can cause performance issues right?
    But I actually had tried using 4 terrains of dimensions 250 x 250 instead of one big terrain of 1000 x 1000 with the highest scale in lightmap, and then also the shadows were as same as one terrain has...

    What the issue is this? Any solution?
     
  19. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    So there is no solution right?
     
  20. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    This is technical limitations
    Terrains shadows are always blurry because the terrain size is big by default
     
  21. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    so I have to sacrifice shadow quality for no reason
     
  22. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    The reason is that your terrain is large... because the terrain must be large!!!
    A large mesh's lightmap (terrain) on a 4096 texture size... This is a logical problem
     
  23. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    I didn't understand what you are trying to say
     
  24. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Large models has lower lightmap resolution
    Your terrain must be 64x64 in size to have higher lightmap resolution and higher shadows quality
    So you can not get high shadow quality when using terrains because your terrain should be at least 512x512 to be useful for games
     
  25. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    My terrain is 650x650. I cannot make the terrain smaller because my scene is a forest, and it needs to be big.
    I cannot use 4 terrains due to performance issues.

    So therefore I need to sacrifice shadow quality for my scene at last...
     
  26. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    I tested on a 1024x1024 terrain and the result is amazing (4096 lightmap size):
    Untitled.jpg

    Also you must use 1 as lightmap scale for terrain
    - Select your terrain
    - Go to final tab (settings)
    - Fin scale in lightmap and set it to 1
    123.jpg
     
  27. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    What are your lighting settings and parameters? Pls send one screenshot of your lighting settings
     
  28. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
     
  29. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Thanks for sharing this!
    According to my experience, baked shadows for sharp objects such as cubes seem to be sharp but when it comes to complex models like trees, the shadows become worst.

    Also in my scene, the baked shadows of sharp objects are sharper than that of curved objects such as trees...