Terracrust: Procedural Landscape Brush Tool

Hello everyone!

I’ve been developing a terrain generator plugin and it is in stage that I could showcase it first time.

The goal for the project is to provide terrain generator software directly inside Unreal Engine. Instead if relying to imported landscape textures, the plugin can generate landscape brushes inside editor. Brushes are edited in a custom editor where you shape the generation logic by using nodes.


To paint into landscape, you place a brush into the level and assign generator graph in it. The plugin runs the generation logic made in the graph and paints height and weight data that the graph outputs. Everything is non-destructive, so you can re-generate each brush individually. The system also supports usage of brush transform in the terrain graph, so it can adapt to correct rotations or scales eg. when using aspect or slope masks.


You can create any number of inputs and outputs to the graph. Inputs are exposed to details panel of the brush, so you can change the values per brush.


Outputs are painted to landscape by adding height or weight painters to the brush where you can select which outputs are painted into which landscape layers.

I have also added a texture baker that is used to bake/pack outputs into textures straight in Terracrust Editor.

The generation logic is run on GPU, so it runs fast even on larger resolutions.

Lately I’ve been focusing on improving erosion simulation and it starts to look promising. Next step with the project is to add snowfall simulation, snow melt simulation, and bunch of new utility nodes.

The plugin will be available on marketplace once I get it ready.

To make the product as solid as possible, I am open for suggestions and improvements. If you are interested in my project, leave some comments or join to my Discord Server to have a chat.

3 Likes

Some new progress with the terrain generator :slightly_smiling_face:

I have now finalized the brush system that can paint the generated data into landscape. The system can now cache generation results, so when moving brushes it can use cached data instead of generating it again. The cache also works in the Terracrust graph editor for certain nodes, so small tweaks and adjustments are faster when you don’t have to wait heavy simulation nodes to process each time you make an edit for node that comes after it.

Erosion also got revisit and it now generates better and more masks for weight painting such as wear, loose sediment, and deposition masks in addition to water flow map. Erosion node also has new thermal erosion which gives better results than the previous one and can now simulate talus production better.

Weightmap generation also got new nodes and features such as option to prioritize certain weightmaps and contrast for blending them together. The system takes care of normalization of weights, so they all sum up to 1.0 automatically. Weight values (and any other inputs added to the graph) can be easily adjusted in the brush details panel, so you see the results immediately without jumping to external software to export-import new maps.

I also implemented landscape material that uses weight maps, supports height blending, and breakup transitions to get rid of too smooth gradients between weight layers. The landscape in the screenshot was made fully procedural without any external software or texture brushes. Material textures are from Quixel and grass foliage from free marketplace packs to demostrate how the system works.

The plugins starts to feel that there isn’t much to be done anymore until I can release the first version of it, so stay tuned :slight_smile:

3 Likes

Small update for the terrain generator :tada:

I’ve been now focusing on snow related nodes. Snowfall simulation is already working and now I’ve been trying to figure out melt simulation. Snowfall simulates precipitation of snow on top of the terrain over time and simulates movement of unstable snow via simple avalanche model. Snow accrues first into crevices due effect of wind to make it look more realistic. This is not proper physical wind erosion model but gives quite good results. Melting of snow is still under progress and it will support melting due temperature and solar irradiation. My idea is that melting would simulate temperature of the snowpack and the ground beneath it, so sunlight hitting ground surface would melt the snow faster at the areas where there are snowless areas next to snowpack.


This is current result of snowfall simulation with 4k resolution for 1x1km terrain. Terrain beneath has been generated by using ridge noise and by running slight hydro and thermal erosion in it.

2 Likes

More updates!

I decided to take a new look into hydraulic erosion simulation. The previous version had couple of issues that I wanted to address. Firstly, it was working grid based which resulted into axis alignment problems because water and sediments had to move into one of 8 neighbouring directions. Secondly, it required many dispatch passes that were processing every texel each time causing drastic performance drop when generating terrains over 1K resolution due GPU cache limitations. It also required double buffering of render targets, so it consumed large portion of GPU memory (over 5GB for 4K terrain) making it unsuitable for 8K+ resolutions for most of the GPUs.

The new simulation is based on virtual water droplet particles which are simulated in parallel in compute shader. Particles are much faster to simulate as only cells visited by droplet need to be updated. Particle based solution also offers much better results and gets rid of axis alignment problem. It also consumes less memory (~2.2 GB with 4K resolution) allowing larger resolutions without high-end GPUs.

Now the erosion simulation with default settings run only in 8.5 seconds for 4K terrain and ~0.7 seconds for 1K terrain brush.
For comparison the previous grid based erosion took ~28 seconds to simulate similarly looking results for 4K terrain and ~3.5 seconds for 1K terrain.

This is how the new erosion simulation model looks like.

I used ~9 million droplets with life time of 240 simulation steps to generate the terrain, so it calculates ~2 billion erosion operations in 8.5 seconds. (Radeon 7900 XTX).

What do you think of the new result image?

New update again!

I’ve now been developing erosion simulations further. Latest addition is rock erosion which simulates erosion of rock due thermal expansion. This simulation fits better for arid environments where hard bedrock is cracked down into smaller pieces that fall down forming noticeable talus. I also added texturing node, so you can easily preview how the landscape could look straight inside Terracrust editor.

Hello!

I wanted to post a new update. The landscape brush generator starts to be ready by now. I’ve been now focusing on landscape material which integrates to the terrain tools. All the texturing happens automatically and works by using only height brushes. Terracrust can generate required masks for landscape layers on the fly, so you can get erosion flowmaps etc without relying only on slope based layer blending.



Hello @SamiTheGreat !

This is a wonderful tool that you’re creating as landscape can be a bit hard to do by oneself. I love the progress and updates you’ve been making as it feels like you’ve been taking grand strides with creation.

In regards to the texture, will there be a way to import your own texture for the landscape? Sorry if I missed this or misunderstood through the updates! Keep up the great work!

Hi!

Yes, you can import own textures. The material is designed to be used with Quixel textures, so it’s easy and fast to test out different texturing by importing megascan surfaces. The material supports 5 automatic layers (Cliff, Slope, Ground, Vegetation, and Erosion). On top of that there are 3 manual layers that can be painted by hand or by using terracrush brushes (also any of those 5 automatic layers can be manually weight painted if needed).

The brush consist of Terracrust graph which outputs height and weightmap data that is painted into the landscape by the system. Basically you can input any custom grayscale textures to the graph or generate them procedurally within the graph and then output height/weightmap information that are transfered to the landscape.

I’ve prepared one simple graph “Simple Auto Texture Brush” which takes single grayscale terrain brush as an input and outputs height + erosion information. This type of a brush is similar as you might have seen in other tools that can be used to stamp externally generated heightmaps into your landscape but with addition to procedurally generate flowmap for the height stamp.

How the workflow basically goes is that you create re-usable procedural logic within the Terracrust graph editor (similar as UE material editor but supports multiple outputs and can run multiple passes on textures) where you declare inputs (eg. textures, parameters) and outputs (eg. height and weightmaps).

Then you place a brush actor into the level and assign any pre-made graph into the brush to tell it how the brush should function. All inputs declared in the graph can be overridden in details panel of the brush, so eg. if the graph has a texture input, you can change it to any custom texture in the details panel of the brush. When the brush is asked to render into the landscape, it evaluates the graph logic, fetches the output results and paints the generated height/weightmaps into the landscape.

So the logic flow goes something like this:

  1. UE landscape asks brush to render
  2. Brush reads inputs set in details panel (textures, floats etc)
  3. Procedural graph is processed with given inputs and it outputs certain data (eg. heightmap and weightmaps)
  4. Brush fetches generated outputs and stamp them into the landscape

Some progress with the material. I used couple of days to tweak the snow simulation compute shaders and implemented optional snow feature to the landscape material that overlays results of snow simulation on top of the other landscape layers. Additionally it has slope based method to add thin snow layer on top of all layers by using normal of the layer stack. This adds nice little details for areas without actual snow weightmap.

I am still trying to improve altitude falloff masking which can be used to remove snow under certain elevation. At the moment it looks too gradient and may require some breakup to look natural.

I was also planning to try some sort of shimmer effect for the snow which could be toggled on for better visual apperance.



Hi there @SamiTheGreat !

Thank you so much for your response as well as the shortening of the flow. It helped me a lot to visualize what you were getting across with your in depth explanation. I’m certainly going to use and keep a close eye on this tool for all the updates you provide!