Search Unity

[Official] New Terrain System

Discussion in 'General Graphics' started by bibbinator, Jul 4, 2014.

Thread Status:
Not open for further replies.
  1. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    Procedural GPU textures, which have progressed to the point of looking natural if the better algorithms are utilized, eliminate the need for canned textures forever on terrain or any natural formation.
     
    Gekigengar likes this.
  2. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853

    Got a link to a white paper or info on an implementation?
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    How about tile mapping from GPU Gems?
     
  4. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Let's be honest: Marching cubes is not best algorithm around here. It'd be better to use something that Blockscape or VoxelFarm uses when it comes to voxel algorithms. Also the issue may be with your voxel resolution. If you have big voxels (as big as Minecraft's), it won't do well. But if you increase your voxel res so 1 voxel would be around 25x25x25cm cube, that would be better.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Honestly if the existing terrains looked just a tiny bit nicer and had hole support it wouldn't be rubbish. I've no idea what what hardcore crack unity was smoking when it designed hole-less terrain but I'd like some so I can accept I don't need holes in terrains. But I do. In addition a lot can still be done regarding stretching long before you get to being forced to use triplanar with smart UVs.

    Anyway, rant over, we're using meshes.
     
  6. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Then I hope guy responsible for UV mapping in your team has lot of free time and zero distractions, because UV mapping terrains, especially detailed, with overhangs and caves is a bitch. And god forbid if they have big polycount as well!

    Can't wait to see all the seams in terrain in your game!
     
  7. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Na. What are you going to use? A Big Rock!? Well I guess that will work, look better, and perform better than expensive terrain shading/modeling techniques. This is something I am actually looking forward to doing in my environment. Cliffs and overhangs. Made in Blender not Unity. I would like mesh blending with the terrain. Not sure how expensive that technique is though. At least an option for that would be cool.

    To the team working on the terrain. I am going to shut up now:confused:. Yeah I know. Crazy. One thing I would like to ask though. Any info on the progress would be nice. I think most(not all) people would be happier to know the progress even if they will not be able to use it till 6.0. I love Unity but the current terrain system is broken. Any light at the end of the tunnel is still light. Just saying.
     
    Last edited: Apr 23, 2015
  8. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    I think one very nice addition to the new terrain system would be a fallout on the detail distance. Think of it like detail by distance.
    In the current terrain, the grass and meshes get cut off at a specific distance you set, which looks extremely bad, and to improve this, the detail should be smoothed out, instead of being cut off.

    I made a very quick extreme example, where you can clearly see the line of the detail distance. This looks 100 times worse in motion.

    terrain.jpg

    Look how much better it looks with the detail being smoothed out, instead of being cut off :p

    I haven't seen this done in Unity by anyone, so it would be very nice to have it.


    EDIT:
    How about, also having 2, 4 and 6 poly grass mesh that would also move with the wind? Would look much better than only one squared grass mesh, or having to populate the scene with separated objects from terrain.
    There could also be a quality setting for the grass, allowing to have 1,2,4 or 6 squares for each grass mesh.
    Any thoughts? :p
     
    Last edited: Apr 23, 2015
  9. Deleted User

    Deleted User

    Guest

    SPLINES! Can't miss road splines now can we?

    Anyway, this thread is 10 months old now. What's going on with all these "official" threads?
     
  10. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Agreed, it's about time one of the new Terrain devs dropped by just to say hello, and big up some of the ideas they're looking in to. Please?
     
    Gekigengar, Jither and Baldinoboy like this.
  11. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Who are you?

    Indie dev

    What kind of game are you trying to build or would like to build?

    Virtual worlds

    How does terrain fit into that?

    Should be obvious (no sarcasm intended)

    What use-cases, features, workflows do you have or would like to see?


    Better support for large/multiple terrains. As things are now there are a few issues with large terrains that absolutely require custom solutions to obtain even minimum performance.

    - Tree collider handling is broken (based on rendering instead of distance). A good built in spatial grid would be nice. I had to implement that myself to handle highly detailed terrains.

    - Smart LOD system so you can use just one large terrain vs having to stitch together multiple terrains for large maps. If that's not possible, add a built in terrain loading system to load/unload terrains within a specific range. This is another thing that is absolutely required for large terrains right now, and something we have to implement ourselves.

    - Navmesh generation is slow (compared to recastnavigation) and uses a lot of memory on large/multiple terrains. Navigation meshes should be separate things, where you can access them in scenes that don't have the associated terrain loaded (almost a requirement for server side pathfinding in large virtual worlds).

    - Dynamic/destructable terrains are definitely the future. Ideal would be a voxel based system. Short of that an easy to use system to blend meshes into terrain would be extremely useful. If it could do it at runtime even better.

    - Better tools for editing terrains. Specifically tools for carving stuff like slopes, roads, lakes, rivers, etc..

    - Procedural generation and better shaders would be nice, but if they don't offer anything beyond what tools like terrain composer or relief terrain currently provide, it's of questionable value to those of us that already use those tools. If they offered pretty much the same features but greatly increased ease of use, I could see that adding value.
     
  12. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    One more thing. Sorry:(. At first I was very upset with Enlighten because of the pre-computing process. Now I love it. It is so beautiful. I cannot really take advantage of it because of my older computer cannot handle the baking process but when I do get a new computer I would really like to have a terrain that works with Enlighten. I know the actual terrain works with it but the trees do not. They do not pick up any lightprobe data. Not sure if this was fixed in 5.0.1 but it would be a good thing to have.

    A fully compatible terrain, trees, plants, rocks, and all bouncing light around with Enlighten. That would be cool.
     
    Last edited: Apr 24, 2015
    Eric2241 likes this.
  13. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    really agreed with this, it's been to long and there's no news/info at all. . .
    how is it going "unity devs"? any info that you can share?
     
  14. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    I think the current terrain + some mesh blending option would be sufficient for most cases here.

    And yes, road splines sounds good too :D
     
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @hippocoder Just curious can i ask something about your mesh terrain system , How about the grass, details, and trees for the terrain, are you creating your own terrain detail system?
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    We just art up meshes from world machine and zbrush, then a custom tool allows us to paint vegetation on it. The custom tool handles vegetation lod, is quite lightweight (only essential mesh data is stored in scene).

    Haven't got to the situation where we need to lod the terrain chunks yet, since simply throwing this at a gpu is one of the fastest things you can do. The Unity terrain is designed for 10+ year old hardware in my opinion where every vert and triangle matters. These days, modern GPUs push geometry like nobody's business and get slowed down/stalled far more by draw calls and so on. LOD itself can be a bottleneck in some cases.

    Unity terrain requires you to practically have no lod to avoid popping so we were just flat out losing performance and struggling with issues like holes, which frankly still gets on my tits thinking about it.

    It's likely we will have some form of lod on them at a later date but currently, it's not necessary.
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    I see, yeah terrain lod might not necessary for current hardware. Damn i'm really curious about the custom vegetation system, that's the only thing that still bother me about using mesh terrain.
     
  18. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well the LOD will still be needed at some point but how it's done is individual to the game. Regarding grass and tree painting, it's just meshes like speed tree with a scatter script.
     
  19. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
  20. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    That's interesting @hippocoder Thanks a lot for the insight, one more question if you don't mind. Since you doesn't use Terrain API that's how the performance for the foliage system, especially if there's a lot of grass in one area, are they get batched or the mesh get combined in runtime?
     
  22. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I just came across this really informative article on Gamasutra about using tetrahedra for realtime deformable worlds instead of voxels.

    Towards Realtime Deformable Worlds: Why Tetrahedra Rule, Voxels Drool

    To me, this sounds fairly awesome and something I'd like to see directly integrated into Unity. Here's list of advantages quoted directly from the article:

     
    hopeful likes this.
  23. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Still deathly quiet on the terrain system news front...
     
  24. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Uh, Unity chokes on my 5 year old HW with a good terrain but absolutely cartoony trees and low number of any other meshes other then the actual terrain.

    I've seen enough of the Unity terrain to know you'd only good use case you'd want to use it for is a flight sim game and even then it's iffy - you definitely would not want to start with a Unity terrain plane and use Unity brushes to do anything.

    TerraSculptor from Lil'Chips is free and alpha but really the whole approach to creating terrains needs to be started from scratch if you're Unity. That will take longer the Unity 5 I think, maybe Unity 6? As the education market for Unity grows Unity will want users to create a level as if you were a student creating a simulation for a class project. In scientific and education terms not with this mish-mash of relevant nowhere else but in the game industry programmer dictionary of terminology and data constructs.
     
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    @goat yeah, I'd *expect* it in Unity 6 - that sounds quite reasonable.
     
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Okay so this is merely a request would be awesome if this can be added. I noticed in GTAV that their terrain have somekind of shader/Material LOD from BumpSpec to POM shader with distance fading. would be cool if unity have this :)
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    GTA doesn't use terrains, it uses meshes. Source: GTA 5 mod community.
     
  28. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    Ha! You know, that's funny this came up. My girl is playing GTA5 and I've been watching while I work. Anyway, I noticed that too. I was even going to ask why heightmaps are even necessary for open worlds in a new thread. I mean how much is it REALLY saving, as apposed to models?

    Personally, I've been on a terrain kick lately and am REALLY starting to think that it may be time to re-invent the wheel.

    I mean terrains are still doing what Starsiege was doing in the mid 90's. Two decade ago, and we're still doing things the same way.

    What I'm thinking is maybe terrain that is done in passes.

    You start off with a height map, like normal. Then you carve and add with volumetric marching cubes. Add streams, water, and roads. Polish things off per vertex. Then the player paints the map's regions (forest, desert, snow, whatever). The editor fills in the areas accordingly based off of the area type and the area type's texture parameters (Slope, height, and the like). Also the terrain editor places trees, rocks, grass, bushes, and whatnot to the terrain based on the areas. And finally you go through and tweak each model accordingly.

    The models and terrain scale with LOD, and the terrain stiches with surrounding terrain. And the distant terrain is warped to have a curvature to it to look more natural.

    This is all pie-in-the-sky stuff, but I really think it's getting time to make a dramatic shift in how terrain is approached.

    And a combination of height maps and volumetrics seems like a good starting point.

    EDIT: Also, protals with trigger points for loading to access caves and interiors.
     
    Last edited: May 10, 2015
    hippocoder and Whippets like this.
  29. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    You're right, a total rewrite and new thinking is needed. A number of other posts have talked about a layered system too - it does sound well worth pondering over.
     
    hippocoder likes this.
  30. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Oh it's simple: Terrain engines are really convenient to author. They can save a hell of a lot of dev time. There's no performance benefit (that I'm aware of) on modern GPUs where a terrain engine wouldn't just be the same performance.

    Other benefits of a terrain engine are that it's way nicer to develop a game with. You can rapidly prototype changes. You can shift bits around to accommodate better pathfinding, or a new objective. To do this traditionally with meshes is a pain. This is the main reason for a terrain engine in today's age.

    In the past, a terrain engine was actually necessary, particularly as it didn't fit into a bsp, and that it was faster to cull individual triangles. These days, terrain engines are about faster development times.
     
  31. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    I can see for editing/creating that the terrain system might be quicker to dev, but once done, a single click button to turn it into a selection of meshes with LOD would be fairly straight forward?

    Especially as a good percentage of the time, characters would be walking on meshes anyway for rocks, buildings, cliffs, spline roads/paths, etc.

    So authoring is best served by a terrain engine, but runtime performance is best served with a series of meshes?
     
  32. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    Well that makes sense then. So really it comes down to the T&E for working around current limitations, to the T&E of making a terrain editor that does them for you.

    Makes sense.

    This is only further affirmation for me then that whatever they do, making open worlds a main feature would definately make Unity easier to use and attract a lot of devs that are left with limited options.

    Right now Unity could do Skyrim, Farcry, or GTA but a dev would need to work in puzzle peices fit together and streamed at run time. In run time you could move around and hit load triggers and the like. But then in the editor every object would need to be in loaded as is and makes development a nightmare and/or your RAM would weep.

    Correct me if I'm wrong, but to do that Unity would only need tag objects that load at certain distances then have them load in the editor window based on how far the camera was. That an terrain stitching would be nice too.
     
    Whippets likes this.
  33. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    That's what I was saying. Do the height map, turn it into a mesh, then add or subtract from it with voxels/marching cubes/volumetrics/whatever you want to call it.
     
    Whippets likes this.
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah I'm with you here. Our game is open world in similar style, there's a lot of problems that crop up and there's only workarounds and lots of work at this point. I'm really hoping Unity comes out with solutions sooner rather than later :)
     
    Not_Sure and Whippets like this.
  35. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ha....i thought so....no wonder they have LOD fade
     
  36. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    Not sure if it has been mentioned before, textured on terrain looks way brighter that how it looks on a plane for example ... a PBR material using the same texture is going to stand out when you want it to blend nicely with terrain. So maybe this need to be addressed or am I missing something. ..
     
  37. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Exactly. How many triangles are visible when you view the earth (with ground based visual fidelity) from space? If you can stream textures to the GPU (Amplify) then surely the same can be done for geometry.
     
  38. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Or maybe octree-tree, like one Cube2/Sauerbraten maps are using for level geometry?
     
  39. charmandermon

    charmandermon

    Joined:
    Dec 4, 2011
    Posts:
    352
    I would like to vote to move these official unity threads about new features to their own channel so they are easier to find. They aren't really general conversation anyway. For instance this thread and the new controller thread and the Unet thread should all be in the new features category.
     
  40. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    Agreed, about terrain options of Spherical, Flat, Marching Cubes. The one massive drawback of relegating these non-standard approaches to 'it'll get done by the asset store community' is that most of those ambitious add-ons are half functional, full of crashes and bugs, or flat out abandoned. To be a versatile tool, Unity would do well to add core options for terrain (and I don't mean a bigger painting brush). How about the above, for starters, along with GPU texture generation via complex noise. If boundaries are going to be broken through, then it must be done by letting go of the same terrain salt mine that has burdened games since the very first terrain containing engine.
     
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    hmm able to finalize/ bake the terrain into mesh with LOD seems interesting now. . . :p
     
  42. Altered Reality Software

    Altered Reality Software

    Joined:
    Mar 6, 2014
    Posts:
    66
    How about the ability to access get the addpass shader for a specific terrain instance materialTemplate? The only way to change values in the terrain addpass now is to use global keywords. Is there any way to get a reference to a particular terrain's materialTemplate addpass shader? Even the GetDependency() method in ShaderUtil is not publically accessible!
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
  44. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    In a barely only-just sort of way that implies 2 years away
     
  45. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    Yep I thought it was more of marketing thing than anything else. This post came out around the time UE4 came out. Unity was S***ting their pants that many people would leave because UE4 had an awesome terrain system plus many other things and Unity terrain system meh .. I think you can make your own mind up.
     
  46. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Actually I started this post because once we had the Unity 5 launch roadmap we needed to look at the next major things we would address. So 2D, Input, nested prefabs, terrain, etc. are all what we heard from community we needed to address and we are. Most are in full production already.
     
    adsamcik, Rick-, ippdev and 1 other person like this.
  47. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    INVESTIGATIONS & DESIGN WORK = production ready?

    Well I don't think you will answer this question but hey maybe I'm wrong.

    How many people are working on the terrain system?
     
  48. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    In the past year, about 5-8 people have worked on or been involved with terrain, mostly on analyzing the feedback in this thread, feedback site, customer interviews/discussions, design and prototyping, to figure out what works and what doesn't. But we haven't settled on the final design and started full production on development yet.

    In terms of production, if you look at the roadmap for example you'll see lots being done in 2D, input has a team working on it, things related to scenes/prefabs are being worked on, same with particles, etc. Terrain is a much bigger project and is queued.
     
    landon912 and Not_Sure like this.
  49. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    3,215
    I would love to hold shift between two clicks and get a straight line
     
    Dreamaster likes this.
  50. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    YAY!

    I was wondering how the terrain was coming along!

    Can't wait to see what you guys are cooking up.
     
Thread Status:
Not open for further replies.