Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

The New Terrain System Questions

Discussion in 'World Building' started by N1warhead, Oct 10, 2018.

  1. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    I just read the blog post at https://blogs.unity3d.com/2018/10/10/2018-3-terrain-update-getting-started/
    Amazing work and information!

    However,

    One thing I'm curious about, is technically two questions I apologize.
    Question 1: Is there a built in way to handle height information for textures? So we can like, protrude rocks on surfaces, etc. (Parallax/Tessellation, etc.)
    Question 2: If not, will this be made in a way that we can modify the shader to put this? Or is it some hard coded shader that we can't modify?

    Thanks.
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    No, have to nag HDRP/LWRP team to update their shader.
     
    N1warhead likes this.
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    1,658
    The terrain layers that hold the textures/normals also has a new mask texture

    The default use for the channels in the documentation is this.

    R: Height - used when doing height based blending
    G: Smoothness
    B: Metallic.

    But as it gets passed to the shader any shader could have its own data in the mask texture.

    If you want to make a custom just duplicate the unity standard terrain shader, rename it and do your changes.


    Image 659.png
     
    hippocoder and N1warhead like this.
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    Thanks mate, didn't realize there was documentation for it yet, I just downloaded the beta yesterday again hoping to have new terrain in it, wasn't :( so didn't even think to check if docs existed for it yet.
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    1,658
    The new terrain is in the beta.
    If you look at the inspector there is some new paint tools, also on the settings "tab" there is an instancing checkbox to get the new GPU based rendering.
     
  6. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    1) The current built-in terrain shaders do not support parallax or tessellation. This first pass was mostly about performance and API updates. Though we are planning to look at more visual improvements along those lines in the near future.

    2) Yes, you can override the terrain shader & material with a custom material (in the settings). As noted above, you can re-purpose the mask textures in the terrain layer to define your height maps. We are hoping to make the terrain layers more general in the future, to support custom properties.
     
    christoph_r and hippocoder like this.
  7. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    1,658
    is there a spesific format needed or could you add a RGBAFloat texture to the mask and pass more data?
    The shader would of course have to know this and decode.
     
  8. marcs_unity

    marcs_unity

    Unity Technologies

    Joined:
    Sep 28, 2018
    Posts:
    1
    The latest beta does support the new terrain! I have it running on my machine here. If you're running beta 2018.3.0b3 or newer, you should be set. I'm new to Unity, so it may have been in earlier betas, but I know for sure it's in at 0b3 and newer. So grab 0b5 via the Hub if you haven't already.

    Regarding documentation! We are actively working on updating this right now. Keep an eye on this page and subpages: https://docs.unity3d.com/Manual/script-Terrain.html It should be updated with at least a first pass of new information before 18.3 leaves beta!
     
    hippocoder and N1warhead like this.
  9. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    That's strange, it did the standard purple not supported thing, was there another update today or something?
     
  10. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    Awesome! Gonna check it out now! Thanks so much mate! Height maps aren't extremely important for my current game, just thinking of future stuff. I mean, is there some real technical issues with supporting parallax maps and such? Seems like it should be just as simple as any other parallax map, I've made plenty of shaders in the past, but it always stumped me to why on terrain it has to be much more complicated in general, like the few assets that do support it (for the now old gen terrain), it was only specific slots that supported it, not all of them.
     
  11. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    If you are already using a custom terrain shader/material, that shader probably needs to have instancing support added to it. We are working on some instructions on how to do that.
     
  12. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    It was the shader that came with it that turned purple.
    I honestly didn't even look for options, just figured automatically it wasn't supported yet lol.

    I see the options for it now, ticked the instance thing and the purple went away, it did however go invisible. Just assuming gotta check the docs out and just mess with it a bit...

    Appreciate it everyone! So excited :D


    EDIT: Yeah I can't seem to figure out how to remove the invisible mode.

    I created two new layers, put an albedo and normal map on each and add them to the terrain, even trying to paint, I see the brush, just nothing is visible.
     
    Last edited: Oct 10, 2018
  13. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,365
    a) Does terrain shader building will be supported like in unreal by graphs? So devs could build terrain shader in shader graph? --> Layered material node, layered blend etc... This would give alot because we could change whole meaning of each layer/material in shader. Epic features would comes from users creativity and they would be able to set any feature to any layer themselfs.
    b) Does terrain will support shared material --> baked array so in fact it would support every amount of layers in first pass.?
     
  14. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    223
    Somebody has to ask:
    1. Holes in Terrain?
    2. Caves?
    3. Terracing (sometimes it actually is desirable)...don't make it impossible?
    4. Export / extract terrain collision data for use in server builds?
    5. NavMesh Enhancements:
      • Auto-generate Navigation Areas from terrains based on textures so we can assign costs?
      • Ability to paint, or mark off with polygons, Navigation Areas directly onto terrains so we can assign costs?
      • Improved Agent performance on terrains?
     
  15. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    If you are using HDRP or LWRP, you will need to update to at least version 4.0.0 (preview) to get the new terrain shaders. You may have to enable 'advanced->show preview packages' in the package manager in order to see it.
     
    N1warhead likes this.
  16. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    1. Caves -- Terrain remains a heightmap.
    2. We actually have a terracing tool in the tool pack we are working on -- it is much more controllable than trying to use 8-bit quantization to achieve your terracing effect. :)
    3. Holes -- We're working on it!
    4. Collision -- I'll have to add this to our list of things to look at. Are you wanting a mesh or a heightmap export? Or some kind of stand-alone Terrain collider component?
    5. NavMesh -- I'll add this to our list as well. Nothing currently planned.
     
  17. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    @ChrisTchou : One thing actually, how is the performance for terrain destruction in runtime? Such as, putting a crater from a nuke or an asteroid kinda thing. (Obviously not a million miles big), but ya get my drift.

    Being we're talking about features, a simple feature to do just that might come in handy, not just for that sort of stuff, but perhaps for people who want to make level editors for their game(s). A runtime terrain editor would be nice feature (obviously that can be done later down the road). I'd rather this be very performant and have the real necessary features now.

    Appreciate your support mate! (Perhaps you can make this an official post for new terrain system) to post help questions here, I didn't see any, that's the only reason I made a new one.
     
  18. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    @ChrisTchou - we're using Houdini's new workflows at the moment - just trying things out.

    One thing that would be totally beyond valuable is the concept of actual layers of height, so we can do broad changes with the unity brushes, then finer work on other "height" layers.

    Or we could paint big broad changes on height A, finer local changes on height B and import some kind of erosion on height C.

    And being able to pick the order of these, and the blend mode like photoshop would be incredibly empowering. So often when painting a terrain, you erase the local changes when making big moves. This would easily fix it and is a common workflow shared among most painting packages and even zbrush in kind.

    (Also using the word layer for splatmaps wasn't the clearest terminology...)
     
    DragonRider and N1warhead like this.
  19. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    223
    On a headless server I need an accurate collider that I can raycast against and that can use physics materials to interact with server-side rigidbodies in simulations. Nothing visual but it would be derived from a normal terrain and exportable to a separate project that may not have the original terrain. A scene in a server project / build only needs NavMesh and colliders...no mesh renderers.
     
  20. hunternx

    hunternx

    Joined:
    Oct 1, 2016
    Posts:
    3
    I know that Terrain's improvement work is at the beginning but I want to ask one thing, does Terrain's vegetation system (specifically grass and details), which overloads too much, have plans? Like the same as the GPU Instancing of Terrain Core?
    Another one I would like in the future is to be able to make shader modifications or create a custom shader (HDRP) in the same way that we modify the build-in shader, things like TextArrays. CustomTextChanneling, ColorMaps, Wetness, Anti-tiling ... which are usually more individual features for projects but can still be implemented by dev from changes in the shader. I say this because I have my custom terrain shader in the old pipeline and would like to reimplement it / update it in HDRP but still get my features.
     
  21. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,641
    I would like the max Detail Distance larger than 250, like 500 or even more.
     
    DragonRider and ChrisTchou like this.
  22. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,131
    Hey . maybe you can help me . I have updated my asset on the store ( TerraPainter ) to support new Terrain Layers and users are happy. So, great work.
    I am creating few features using the capability to expand the terrain painters. and i need to take a look to a shader that i cannot find either in GitHub source code either in separate shader download on beta dowload page. I understand from the code that unity editor load few resource from an asset bundle. I am refering to the shader called
    "s_CreateBrushMaterial = new Material(EditorGUIUtility.LoadRequired("Brushes/CreateBrush.shader") as Shader);"
    Hope you can address me
    Thanks
     
  23. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    64
    Suggestions:

    Allow Multi-select tree paintbrush! So you can paint multiple types at once (other engines have this). This is useful for creating patches of random plants trees. This should be quite easy to do!

    Allow user to set the resolution of the billboard texture for all the trees so that it does not get really pixelated when you add 10 trees or more when in the distance.
     
    ChrisTchou likes this.
  24. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,365
    This is also usefull when you got big and small trees/plants. Small tree doesn't need full resolution.
     
    ChrisTchou and philc_uk like this.
  25. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,176
    @ChrisTchou any plan to also add errosion brush/Tools in it? would be pretty use full to have it
     
  26. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Checked on this -- it is an arbitrary texture of any format, it just gets passed down to the shader. The only consideration is if you want to pre-blend the mask textures into a single LOD texture in the distance (similar to basemap for color), you have to specify the format and size multiplier in the BaseGen shader. But for local texture heightmaps, you probably just want to drop the data altogether in the LOD texture.
     
    antoripa likes this.
  27. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Yeah, it's fairly simple to implement, but gets very expensive very quickly -- the parallax calculation has to sample the blend map and multiple heightmaps at every step. So a 4-layer blend with parallax is effectively making you pay five times the perf as a single layer parallax (and all texture fetch cost too, which is already the bottleneck for terrain). There are ways around this, such as caching the blended heightmap result into a flat texture around the camera. We're working on something along these lines!
     
    Mauri likes this.
  28. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    It's on our list, but may take a while (it's a big list).

    No. Baked arrays & index maps are very nice in a lot of ways, but texture arrays are not supported on all platforms, and there are some other complications with LOD; so it's a little lower on the priority list.
     
    antoripa likes this.
  29. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Depends a lot on your game, platform, and how large of a crater you are making. :)
    But in general I would say you should expect to drop some frames when you edit terrain.. not that bad if you can flash the screen to white to cover the frame drop for a large explosion.
     
  30. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Yes, we're working on it.

    Yes, in general we want every shader to be customize-able. You should be able to still use your HDRP Terrain shader, you'll just need to add instancing support to it in the vertex shader if you want to render instanced. You can take a look at the terrain shader included in HDRP (or LWRP) package version 4.0.1, to see an example of how to add instancing support.
     
  31. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    443
  32. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Can't see the images in there (link dead?) But I assume you are talking about flipping the quad diagonal based on local curvature?
     
  33. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    443
    i updated the post, but that would be even better :)
     
  34. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    Added to the list. I think the biggest issue is backwards compatibility, or if we make it an option, having to manage and test another variant of Terrain. I think ideally we would get the system to a point where things like this can be modified from C# / shaders on a per-project level.
     
    Flavelius likes this.
  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    In my previous request (to HDRP team, wrong place) - I asked for 1 layer, a primary later for pixel displacement. There is never a good reason to sample 4+ layers for POM, just a single one. 4 would actually probably result in ugly rendering as well...

    Ideally you apply it to your rocky or most busy layer only.
     
  36. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    18
    We actually had a rename of TerrainLayer to TerrainMaterial, but it got lost somewhere on the road to 2018.3. :( We may version it to change the name in the future.

    And yeah, real layers would be awesome! It's something we are looking at, but is a very large task.
     
    hippocoder likes this.
  37. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    Please do, now is the time for these changes. Also, you can use Material Element or other logical similar phrases. It's not out of beta yet, so please do the right thing.

    I promise I'll spend a few months guiding people who are lost for the transition if necessary ;)
     
    Flavelius likes this.
  38. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,365
    Thats why at unreal it's an option in layered material to check it as shared. This means that high end stuff could use it, but mobiles etc still could work on normal pipline.
     
    antoripa likes this.
  39. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    556
    Big congrats that finally after so many years terrain updates are coming up.

    I probably start with small things like bugs :) . There is currently one bug which I keep facing every day. Built in tree billboards are not updating lighting when directional and ambient lighting changes. Billboards only gets updated when camera starts rotating. I guess, quite easy fix would be to check if there are directional lights in the scene and if their rotation or intensity has changed. In such case, refresh tree billboards.

    Also if somebody is building a list of remaining features, a good resource could be the previous forum thread, which is now closed: https://forum.unity.com/threads/official-new-terrain-system.255232/ . Through over 4 years there are enormous amount of ideas. Some of them are probably already overlapping but there are also quite a lot unique ones as well.

    Was it also considered using the new Package Manager as most of the new Unity's features are coming through there and they allows packages to be less bound to the main release cycle? But I guess now it's quite good that it goes directly to the engine until the terrain core will be updated, cleaned and refactored :).

    Once again, big congrats on starting up terrain updates!
     
  40. trj_1

    trj_1

    Joined:
    Jul 12, 2017
    Posts:
    2
    Really happy to see terrain updates coming, also kind of sad to not see anything regarding volumetric terrain. Are there plans to implement volumetric terrain?

    Thanks!
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    Unity is aware of it, but it's locked now so people are directed to beta + world building forums.
     
  42. antey3064

    antey3064

    Joined:
    Mar 21, 2016
    Posts:
    5
    I want to make voxel landscape (youtube.com/watch?v=B3GoyGlWLFc) and adapt to the new system Terrain technologies such as" marching cubes "and" dual contouring" Is it possible? Or you will have to write your Terrain system and Terrain Shader?
     
    Last edited: Oct 11, 2018 at 11:11 PM
  43. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    264
    Hey Unity,

    Thanks for the needed terrain update.
    Though, I don't understand why the mask for the terrain doesn't follow the mask in the HDRP shader.

    Smoothness should be in the Alpha Channel....
    First to be consistant and second because there is more precision having it in the alpha channel.

    I would really like if all the teams could follow the same guidelines cause it doesn't make much sense.

    I really hope that you will normalize all of that, or it will be a nightmare in production do handle the creation of thoses mask if they differ for regular material and terrain material.

    Thanks

    EDIT: Maybe the quote was from an older documention, cause this one: https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/Terrain-Lit-Shader use actually the same channel. To be confirmed
     
    Last edited: Oct 12, 2018 at 2:25 AM
  44. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,365
    Another thing that you should mention - easy to fix.
    ATM - you put objects with LOD's sysem doesnt generate billboards
    Would be epic if there will be an option to put billboard from unity as last lod even when you got LOD's. I know there are speedtree and other but... sometimes we want to overwrite it or simply many devs don't know how to build cross/billboard properly.
     
    LDiCesare likes this.
  45. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    64
    You can already - do it in code or in debug view of the inspector - changing it back to normal will reset it though!

    Unity- please fix duplicating terrains too. It does Not work as it does not copy the asset, just the script where you then have two terrains pointing to the same asset which is not what the user is expecting (workaround currently is fixing it again in debug mode).
     
  46. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    3,534
    I'm rolling my own anyway, and it never hurt to ask, and we have already discussed why current terrain are bad idea (pole, navigation and out of atmosphere landmark).

    I'm still looking at clever pole transition (like having strip of looping quad terrain, and specific terrain for the cap, but how do you transition (coordinate) between the two in a way that make sense?)
     
    hippocoder likes this.
  47. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    Where exactly is the shaders for the beta? I can't find the shaders so I can mess with the new terrain shader.
     
  48. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,293
    Are you using HDRP? Should be included with 4.x
     
  49. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,282
    Yeah I am... But can't find it. No idea where the 'hidden' stuff is.
    I tried searching for 'Hidden' and 'Terrain' in my project, tried also looking for the Shaders download in the archive.

    EDIT:
    Found it finally.
     
    Last edited: Oct 13, 2018 at 5:59 AM
  50. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    556
    I think spherical terrain geometry could be partially solved if terrain game object rotation would be fixed. In such case if you rotate the game object, to which the terrain component is attached, the terrain would actually rotate. At the moment if you rotate the game object, nothing happens for terrain as terrain normal is always pointing towards positive Y direction in the world.

    If terrain rotation would be working, the simple solution would be to generate 6 terrains tiles with different rotations so that they would represent a cube (this would give something like Inception world :) ). And finally adjust heights so they would follow sphere geometry. In such case none of these 6 tiles would have slopes much larger than 45 deg and heightmap standard wouldn't be violated.

    At the moment it looks a bit weird that we can rotate freely game objects with meshes, but not game objects with terrains.

    Other options to get towards non-standard heightmap terrains might be solved by making terrain systems more modular. I.e. making it possible to use tree, tree billboard, grass billboard and other systems outside of the terrain. In that case for example the same trees with build-in billboards could be used on any mesh terrain. So this could solve the case of terrains with caves. I.e. users could make their own mesh terrain with holes and also benefit by re-using built-in tree and grass billboards.
     
    Last edited: Oct 13, 2018 at 11:47 AM