Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How can I represent different biomes on a Terrain object?

Discussion in 'General Discussion' started by Snubber, Jul 21, 2020.

  1. Snubber

    Snubber

    Joined:
    Jan 20, 2020
    Posts:
    65
    Hello! I am using the Unity Terrain object in my procedurally generated terrain. I want to have different biomes on my terrain (i.e desert, forest, ocean, etc.) I want to use different textures for the different biomes but if you see in the documentation for TerrainLayers (https://docs.unity3d.com/Manual/class-TerrainLayer.html) at the bottom it says that having more than 4 Terrain Layers on a Terrain object will impact performance (for URP which I am using). My understanding is that a Terrain Layer is needed for each texture you want to use on the terrain. It seems odd to be limited to 4 textures, especially because I'd like each biome to have 4 textures on it's own at least!

    My terrain is procedurally generated so I am breaking it into chunks. So I could restrict each chunk to be one biome. But there would be a really gross contrast between biomes, with no gradual shift between them.

    Is there a better way to solve this problem?

    If I do have to have harsh contrasts between biomes I was thinking maybe I could have the world consist of hexagons which could produce a cool looking result. But the issue with that is that the Terrain objects seem to need to be a square mesh (please tell me if I'm wrong).

    I would love to use Unity's terrain system because of all of it's awesome features.
     
  2. xald

    xald

    Joined:
    Mar 24, 2018
    Posts:
    19
    It is not limited to 4, it is just recommended. From my own experience, slightly exceeding that limit doesn't hurt performance. My suggestion would be this;
    I am assuming you have completely 4 different layers on each terrain part (or chunk)
    Use 5 layers on each part, the parts own 4 layers + a layer of a neighbor terrain, for smooth transition or blending.
    IMO this is a way more easy and simple solution than using hexagon tiling.