Search Unity

2018 HDRP Terrain

Discussion in 'General Discussion' started by zelmund, Jun 12, 2018.

  1. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    I alredy read somewhere about fail around terrain in HDRP.
    Can someone share a good experiance with? Im trying to upgrade project o HDRP, but simply cant do it because of missing terrain shader.
     
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Nobody can share good experiences with it because HDRP has not supported terrain up to this moment. Unity are working on it, and once it reaches a stage where people can actually try it, you will hear a different story. Probably still not a perfect story initially, but only time will tell.
     
  3. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    While it doesn't support the built-in terrain at the moment there is an excellent workflow you can use. The new Standard Lit Shader can be layered and can be vertex painted for painting layers and for placing foliage and objects. You simply use your own custom 3d mesh for terrain sections. It uses height based blending and looks great under the new rendering pipeline. Take a look at their demo of what can be done with this workflow. It's simply stunning.

    https://blogs.unity3d.com/2018/03/1...aking-real-world-objects-into-digital-assets/
     
    zelmund likes this.
  4. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    that sounds better for me =)
    thx for advice.
     
    JamesArndt likes this.
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The shader looks like a common multi texture shader on objects, also using detail texture in the shader.

    About terrain mesh, this will work great when your game is about a small game level It won't work if you are making an open world because you'll need terrain mesh LOD.
    Anyway ShaderLit is a good shader for those making photogrammetry.
     
  6. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    no problem to create common LOD (component) for mesh terrain.
     
    zenGarden likes this.
  7. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I was meaning progressive LOD.
    As you move the camera the mesh nearest parts are detailled while far ones have less polygons, a real terrain LOD.
    Perhaps some vertex shader could work.
     
    JamesArndt and angrypenguin like this.
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    How do you avoid seams?
     
  9. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    While there are benefits to the built-in LODing functionality of the terrain you can still use large terrains with custom geometry. Naughty Dog does this with all of their games, using Maya as the level editor and to produce the terrain meshes. You have to learn how to work in that workflow. You can create your own LODs for the terrain chunks and LOD them in a very similar way that the built-in terrain does it's LODing. You would also want to put a heavy focus on using a culling system or just use the built in occlusion culling. Mask things in fog for long draw distances and then hide your terrain chunks that fall well beyond the fog. There are a ton of tricks you can do to get amazing performance. You get performance improvements out of the box using custom terrain. Create a default Unity terrain and then import in your own custom mesh terrain and you'll see right away you are saving draw calls on your mesh terrain, depending on how complex the material is on your custom terrain.
     
    SirTwistedStorm likes this.
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Very easily in my case whenever I did mesh lod terrain: I simply decimate polys inside the cell instead of the border edges, which are always the lod 0 density. This way there is never an issue, and while there is a little waste along the edges, it is never enough to worry about.

    All LOD tools I know of have a preserve edges option.

    There are conditions where if your lod 0 is super-duper high (it shouldn't be if it's a game anyway) then these super dense polygons really far away could potentially cause problems, I haven't seen any yet.

    I prefer a dedicated terrain system because speed / ease of authoring, not really for performance.
     
    Ryiah, zenGarden and angrypenguin like this.
  11. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Just got done watching the Unite 2018 Roadmap stream. I dont want to go into detail or I will probably get something wrong, but broadly speaking 2018.3 is the new target for all manner of terrain system improvements, including pipeline-related and performance stuff.
     
    hippocoder likes this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Won't be able to listen to those cos, well I can't - so I'll wait for subs or some docs going on :)
     
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Ahh, that makes sense. Is it noticeable or odd looking to have low poly areas surrounded by high poly strips? I presume not since it's only in the distance.
     
    hippocoder likes this.
  14. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    To be honest they had to cram so much in that most of the actual detail was on the slides rather than spoken. I might attempt a few choice screenshots.
     
  15. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Just rewound the livestream to the earlier roadmap talk and to be honest the youtube closed captions actually seemed to be working quite well, albeit I only tried them for a very short portion of the talk.

    Anyway, screenshots of some relevance to this thread...

    Roadmap-TerrainTools.png
    Roadmap-TerrainRendering.png
    Roadmap-TerrainScripting.png
    Roadmap-TerrainPerformance.png
    Roadmap-TerrainPerformanceUpdated.png
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Absolutely excellent (it was actually bang on what I was estimating) - but lovely to see it in print, thanks :)
     
    angrypenguin likes this.
  17. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, simple meshes LOD can do the job, it's possible to make great levels with meshes, last game using them is God Of War on PS4. Not everyone is making open world games.
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Heck yeah. That'll help out a current project immensely.

    Fingers crossed that it actually gets into our hands.
     
    hippocoder likes this.
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Thery need a system where they handle stitching "pole" tile neighbor, at least 3 (7 neighbors) and 5 poles (9 neighbors) on top of poles (typical 8 neighbors) and it will be universal and planet ready.

    The great is that is they still only to mach 4 edges to 4 distincts neighbor (diagonal only are problem, BUT they don't factor on the math or code).

    Basically just something to skew the mesh, on a plane, onto a sphere or arbitrary curvature, in order to have non euclidian but still quad tiling.
     
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Regarding spherical terrain (planets):

    There are so many dependant systems that it would make much more sense to not do that... yet.

    So the idea that it should be the same terrain from space to ground level, that's not really logical from a perf or tech perspective due to the amount of things that would just not work at all (nav/physics/etc).

    Instead I would have a (still flat) tiled terrain that duplicates at the edges, to represent the planet at ground level, and a proxy 3D planet model with tessellation that matches up to those stiched terrains conformed to a box-sphere model, then at a suitable point, crossfade between them, probably when entering the atmosphere.

    A shader can give the same curvature during the transition to ground. It's work to do, but considerably more reliable, stable and effective than trying to make terrain support planets from anywhere in the solar system while still supporting all the other Unity features.

    Done right, I don't even anticipate people noticing.
     
  21. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    That's absolutely how it must be done, distant terrain don't need anything fancy and interactive at all, and don't have to be the same than gameplay terrain. In fact keeping the two distinct is exactly what you propose and it's the right solution. Crossfading is still needed, it's what no man's sky does anyway.

    HOWEVER

    It's mathematically impossible to navigate (and many other things) a sphere with a flat tiling, even if you limit to no gameplay, no collision and have a short visual distance radius with heavy fog. You will have to cross edges and pole eventually. And technically it's basically just allowing for controlled shearing.

    If you have just loose landmark visible from space, like a super sparse network of distant city, you won't be able to reach all of them on planet. Flat tiling has so many problems I can't start to evoke them all.

    I know I tried them all, here is my current implementation:


    You can do flat tiling and other trick (like not tiling the pole at all and make them pure random wilderness), but you would have to lose thing I really need (works for simple gameplay with simple generation and no landmarking), especially when I want gameplay driven level design PCG on top of it. And I won't stop at sphere either, those kardashev scale lovecraftian civilisation aren't fond of sticking to sphere.
     
  22. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502