Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Terrain Tooling?

Discussion in 'World Building' started by joshcamas, Jul 16, 2022.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Hello,
    I am curious to see if any larger game developers have answers on their terrain workflow in Unity. I've been developing an open world RPG for around 5 years now, and am currently using Polaris for terrain, but have been running into performance issues, so I'm now looking for an alternative. Previously I used Unity Terrain, but ran into issues related to the extremely lackluster tooling centered around it. The UI, lack of shortcuts, and lack of things like stamping are huge issues in my eyes.

    SO! What do you guys use for terrain rendering? Do you use unity's terrain with unity's tooling, or do you have custom tooling alongside unity terrain? If you use a custom terrain asset, which one do you use? (assuming its not custom).

    EDIT: Looks like Unity 2022 finally added grass instancing. Lol? Just took them 10 years. It also adds stamping which is a good feature.
     
    Last edited: Jul 16, 2022
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    I'm interested in that, commenting mostly to subscribe.

    After a disastrous start, long ago, I start studying custom terrain rendering in depth to roll my own with mesh rendering, but also it's a planet game so it's not the same, I'm literally forced into replacing most of unity's stuff. Personally I'm investing in shader base semi pcg foliage (same patch in front of player, sampling a texture, and repositonning in vertex shader by hashing space position of player, grass is in atlas swapped by sampling the data texture and random number jittering, quad get invisible by making degenerate all its vertex position as 0). Fun fact I'm researching background npc pathing on vertex shader too (lerping two position in space).
     
  3. Tom-Kazansky

    Tom-Kazansky

    Joined:
    Mar 9, 2015
    Posts:
    55
    I just started developing 3D game not long ago,
    I hope they add a "snap to grid" option while painting the terrain
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I built my own non-destructive terrain authoring and rendering recently. Works great, and allows me to throw a world together (and iterate) without time cost.

    Obviously not a task everyone would find as easy to do, but if you can, it is probably worth it. Unity's terrain tooling is really poor, rock bottom in my eyes.

    Just a neglected wasteland of tooling. The API is equally bad with changes taking a long time with poor user feedback.

    Mine updates all changes instantly at monitor refresh rate so I am iterating on the terrain at game framerates. That's what's possible and that's why I decided to do it. Also had enough of the bizarre +1 texture size, popping and many other stupid outdated issues with Unity's awful terrain.

    Unity's terrain API and tooling is a restrictive antique. Worse, it doesn't even perform well. Unity won't fix it because fixing it means breaking compatibility.

    If you absolutely must have large terrains, consider using large meshes that you drop down and reuse. Unity might make a new terrain for DOTS but we wont hear from that for a long time.
     
  5. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Great to hear that I'm not alone in this. I feel like I'm going crazy when I see the newest version of unity show off their "amazing terrain tools" then I try it for myself and I am just see tooling that is nearly impossible to use beyond simple scenes. Not to blame the developers, I'm guessing there's like 2 poor terrain devs lol.

    There's some simple features like filters and masking, but no concept of presets... So we're expected to just manually change all the filter settings every time we want to paint something? That's actually insanity...
     
    Gravesend and Deleted User like this.
  6. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,775
    It's not uncommon at Unity. URP 2D renderer at one time had a whopping one engineer working on it because the other one moved on to other endeavors.
     
    joshcamas likes this.
  7. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,763
    Honestly even if there were more devs I don't think that'd really solve the workflow issues Terrain Tools has, just maybe some of the outstanding bugs.
     
  8. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    True, what they need is actual artists to use them in actual scale of a real project. They always show their tooling done in a tiny slice of a world, and don't have to worry about level design or workflows or anything.

    And now they're rebuilding the terrain system entirely, so that means years of radio silence. And while I'm sure it'll be more optimized and perhaps have new features (non destructible terrain sounds nice), but I doubt the UI workflow will be anything better.

    Anyways, I was hoping to build my own custom terrain editor that hooks into unity's internal terrain painter, but that doesn't look very viable. if anyone has ideas on improving the workflow or have used other unity assets for terrain, I'm open to suggestions. It's extremely hard to find knowledge on how bigger games in unity does it - feels like I've been struggling in the dark for years when it comes to open world terrain tooling...
     
    Last edited: Jul 17, 2022
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    They are just meshes at the end of the day. Easy to generate meshes.
     
  10. xexuxjy

    xexuxjy

    Joined:
    Feb 10, 2014
    Posts:
    18
    Have you looked at the GAIA / Procedural World tools - they are quite impressive from what little I've seen of them.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You are recommending what you have not tried?
     
  12. xexuxjy

    xexuxjy

    Joined:
    Feb 10, 2014
    Posts:
    18
    Sorry, no I have have tried them. I got the basic version for a simple game I was playing with and was quite impressed how quickly it gave me a very usable landscape, with grass instancing, flowers, trees, rocks and even a couple of buildings. I've since then bought the full version of the tools as they were on one of the asset store sales. What I haven't done is tried to use them in 'anger' for anything particularly big. I did use the built in option to create a tiled terrain made up of a 4x4 grid and it handled it very well, but I haven't played with anything much bigger or used their streaming technology.
     
  13. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    433
    I usually use Gaia Pro for terrain generation and Vegetation Studio Pro for trees/object/grass displacement. Gaia is pretty good for fast terrain generation and Vegetation Studio is absolutely amazing when it comes to performance and non-destructive workflows. However if your game world starts getting really really big and some kind of streaming solution is vital, I suggest that you write some logic that takes your main scene as input and creates subdivided sub-scenes as output. Those can be loaded/unloaded using additive loading at runtime.
     
  14. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    I have a world streaming system, definitely extremely necessary. Does make workflow a lot harder but is what it is
     
    neoshaman likes this.
  15. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    I use Map Magic for generating/textures/objects. GPU Instancer for grass and rendering those objects and MicroSplat for anti-tiling/triplanar.

    Of course, none of them work well together, and all have their constant bugs/exceptions.

    Map Magic has a strange interface and the masking is more confusing than Map Magic 1. GPU Instancer won't understand the grass height/ranges and likes to generate its own grass from scratch. Customising it using the inspector's debug mode is annoying. MicroSplat has darker shadows by default, which requires switching to different shading to fix, which can break some effects. And the Unity terrain won't let you put duplicate layers, which makes MicroSplat harder to work with.

    I laughed when Unity released their "Terrain Tools". I couldn't believe that's all they came up with.
     
    joshcamas, Lymdun and xexuxjy like this.
  16. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Moved to world building forum.
     
    joshcamas likes this.
  17. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,647
    I make alot of large open worlds, like others i use Gaia for terrain generation/terrain textures, and Vegetation Studio for trees and foliage. From there i cant stress enough, that HEAVY optimization of ALL objects and chunk streaming terrain, are the most important!. There are so many import, model, material, texture, LOD, streaming mip map, and other settings that are so crucial, that its insane. In some cases 1 bad setting can cost you alot of fps/ms drops.

    Grass is probably the biggest headache, lol. But can be taken care of a few different ways (GPU instancing, etc.). Alot of Unity comes down to optimization, settings and systems used, but then again, everyones projects are different. You have to look at your project and see where you can "shave" things, as less is better. Its about what you can do without, then what you can do with.

    Best of luck bro...
     
  18. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    The fact that everyone uses Gaia is pretty crazy. I tried using it and it seemed unstable. But maybe I should look into it again if soo many people use it in actual projects!!

    In terms of beyond terrain, yep, I have a custom foliage editor on top of GPU Instancer for tree renderer (although I plan on building my own foliage renderer using simil) and while I am currently using Polaris's grass renderer, I plan on building my own as well. I agree that grass is particularly painful due to the sheer number of verts you need to pump onto the screen, so I'm considering using Hi-Z occlusion culling similar to GPU Instancer's technique for trees - even better if I can read the depth prepass in unity 2021 instead of relying on the previous frames depth buffer, which can cause flickering.

    Luckily I can get away with a bit more than other games, since our art style is "lowpoly" (although since this means LODs are rarer, this really means the number of verts on screen is similar to a more realistic style). The big gain I get is essentially no worries related to texture memory due to this style, since the only textures in memory larger than even 256x256 are a handful of foliage textures and data-related textures like terrain and post processing.
     
  19. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,647
    TBH, 2021 is a "dumpster fire" of a version to use, downgrade to 2020. If you research around the forums, 2021 has a TON of probs, (random crashes, and too many more to list). So your choice of version will dictate alot of things. Even though you plan to custom write systems, 2021 is the absolute "worst version" to do this with.

    I personally use 2019 LTS (very stable, and asset compatable), and always use a version 2-3 years behind, as newer versions are not worked out enough. Nice that your on the "low poly side" of things, but please believe me/research, 2021 really is a dumpster fire version, and will only add to your probs...
     
  20. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Don't worry, I'm using 2020.3, and plan to stick to it for quite a while for those exact reasons. Until new versions of Unity gets stable, I'd use my own depth prepass feature I built a bit back - it would mean a foliage prepass depth check doesn't interact with foliage though, which is too bad. (since rendering foliage in depth prepass would be stupidly expensive). Either way this is just a fun addition for who knows when heh
     
    Last edited: Jul 20, 2022
  21. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Alrighty, my current plan is to switch to Unity Terrains since most tools (Vista or Gaia) support it, and then determine which tools to use. Since I already have a foliage renderer, I just need a custom grass renderer which should be pretty easy (ignoring occlusion culling features, and just using jobs for frustum culling for now).

    Wish me luck! I'll continue to post my findings as I experiment with these assets :)
     
  22. Deleted User

    Deleted User

    Guest

    I feel the same too!! :D The team also does not share the progress of anything happening with the tools and many features on roadmap haven't moved out from "under consideration" and "in progress" for a very long time!!
     
  23. Saniell

    Saniell

    Joined:
    Oct 24, 2015
    Posts:
    168
    To read from depth prepass you need to render depth prepass, which means issue draw calls :)
    What you can do instead is cull using previous depth, then cull again using new frame depth, which will basically draw remaining "false occluded" instances. Better explanation here on slide 52
     
  24. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Yep, I've built a depth prepass feature like this already, but haven't gotten much gain since by far the biggest cause of overdraw is foliage overdrawing on foliage, and rendering foliage when drawing the depth prepass would be super expensive. One whacky idea would be to save the previous frame of foliage depth only, and then combining it with the depth prepass for the current frame...