Home Technical Talk

Long dinstance terrain rendering techniques (unity, desktop game)

grand marshal polycounter
Offline / Send Message
Alex_J grand marshal polycounter
What are some techniques used in open world games for distance terrain rendering? To be clear, not talking about props which cannot be reached, but terrain which is part of the playable area, just far in the distance. 

We are loading each terrain tile as a separate scene based on player proximity. My idea is to use low poly mesh version of each terrain for the distance views. This does mean that each terrain is using a material and probably two textures (color and normal). 

I look at the size difference between a mesh and a terrain and the terrain is significantly lighter. But is there more to the picture than that? People seem to generally suggest that unity terrain is inefficient, but based on all the factors I can see, it seems lighter than using a mesh.

Does anybody know what sort of methods might be used in games like arma, just cause, Ubisoft games? 


Replies

  • bitinn
    Offline / Send Message
    bitinn polycounter lvl 6
    People seem to generally suggest that unity terrain is inefficient

    That's before 2018.3, now that Unity Terrain have instancing for terrain, it's blazingly fast.

    I don't see any benefit of loading terrain by tiles, unless you are actually making them procedural and modular.

    Most games cares more about foliage overdraw and draw distance, than the terrain itself; most engine has runtime LOD on terrain itself at this point.
  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    The bottleneck for us with terrain is two things:

    1. in order to keep decent heightmap resolution on large terrain, need to split it up.
    2. we run lots of calculations on the terrain data to determine foliage/prop placement procedurally. That seems to hit a bottleneck the larger the terrain is.

    However, we were hitting that bottleneck while spawning dense forest. Guess we ought to run test to see how big of a terrain we could get away with if not working with forest.

    thanks @bitinn
  • Eric Chadwick
    Since you're in Unity, I'd recommend looking at Jason Booth's plugins. I haven't used his tools, but I did go to one of his talks, the guy knows his shit. https://80.lv/articles/using-next-gen-terrain-engines-for-games-production-009snw/
  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    I am using his tools currently. In particular the macro textures help a lot with giving the far away terrains a sense of detail.

    We haven't done all the testing I want to do yet, but it seems like 5km terrain tiles, making use of the new instanced rendering, do alright. I don't think we will need to use any meshes, except for maybe very distance horizon fillers.

    Once we do some actual testing tomorrow i'll post results if they are interesting.
  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    Some results so far, just screen grabbed from unity viewport (nevermind the pixelated skybox):
    I used Jason Booths Microsplat for texturing of the playable area terrains, which is a 625 square kilometer area. I think I am using all of his add-ons. Stuff like macro texturing and global snow really help to prevent any visible tiling and make the terrain pretty believable. The only thing missing is some macro textures per terrain tile to give unique tint on a large scale. This would simulate different types of soil in different areas, as you can see in the image below.
     
    Those I have to do by hand though so I save it for later.

    The playable area terrains use a 2k heightmap and 1k splatmap per tile. Each tile is 5km, so the pixel per meter ratio is 2.4. I found this to be an acceptable resolution. Going higher than that didn't have much of a benefit. Down at player level you will find some ugly spots where a vertex is popped up like a tepee. I think for a larger studio you could just have artist go through and touch things up manually or even use a lot of boulder meshes to place around for more believable terrain. In my case it's too much time for a game that's mostly gameplay focused.
    For the distance view, I have two extra rings of terrain, totalling an extra 10km. They go down in heightmap and splatmap resolution. Because of the difference in heightmap resolution, that does leave some border seams. I was going to ask my programmer if he could "sew" these seams together, but I found an easier solution. I just put a plane underneath with same texture as the terrain. Since these seams are far away, that is enough to make them non-noticeable.

    In the very distant background I have an inverted cylinder with a panoramic image. It's a thing I bought from the store, but I added some normal map information and adjusted the coloring to make it fit my scene more closely.




  • jRocket
    Offline / Send Message
    jRocket polycounter lvl 18
    A big issue you may run into is the shadowing of the terrain. It is not likely you're doing to get the distant terrain to be within the shadow distance without using a ton of shadow cascades, so you may try to bake lighting and use distance shadow mask- which isn't ideal and not even supported in all render pipelines. Unreal Engine has a "Far Shadow" checkbox to solve this issue, which is like a giant shadow cascade the covers the entire landscape. You might be able to simulate something like this in Unity by adjusting cascade percentages, but probably at a performance cost.

    Otherwise, Unity terrain itself performs well enough, as long as you stay away from the built-in foliage and tree placement. Can you believe it's 2020 and Unity still doesn't have a modern instanced foliage placement tool?
Sign In or Register to comment.