World Machine

There are a number of tools available for creating realistic 3D terrains but none is more accomplished than World Machine. Most game engine environments start off here, even if they end up being radically different after manipulation using the engine landscaping tools. Similarly, this tool is great for all 3D projects where accurate terrain is required to form part of the scene or animation.

The interface and methodology for building terrains is, like virtually all contemporary 3D interfaces, node-driven allowing for a non-destructive and intuitive workflow:

With minimal work, you can create convincing worlds armed only with a small amount of knowledge and vision (or reference). These landscapes can look really realistic rendered inside World Machine itself but the idea is you get the landscape right in WM and export it via a heightmap (a greyscale texture which denotes the elevation of terrain per pixel):

You can image this texture influencing the height of a mesh made up of a grid of evenly-spaced vertices. Anywhere the image is white would make the corresponding terrain the highest. Anywhere where it’s black is the lowest and anything in between is interpolated so you great a great range of detail. This video does a decent job of explaining how a height map works and how it will deform the landscape mesh.

NOTE: World Machine is NOT entirely free. However, there is a free Basic version and to be honest, this will do for most game-related landscape generation tasks. The Basic version is restricted to 512 x 512 pixel outputs for the heightmap (and other bitmap outputs). The Standard version unlocks this restriction which is required for larger, more detailed terrain heightmaps. This costs $99 which isn’t too bad. The Pro version allows tileable terrain landscapes to be created for extremely large environments – which Unreal incredibly supports! The cost for this version is $250. You also get a performance increase if your machine has the power with the Pro version. You can upgrade from Standard to Pro for the difference in price between the versions which is great.

Some creatives make part of their focus dedicated to creating amazing looking terrains inside World Machine and it comes with great visualisation filters – although these are not required if you are just using the tool get generate height maps.

Check out Iri Shinsoj’s awesome YouTube videos for examples of how to create amazing look terrain.

If ultra-realism is your thing then how about generating terrain based on real world topographical information? As cool as it sounds, it’s a bit of a faf and not inherently suitable for game world due to the sheer scales involved. You also have to clean up your terrain. Although if you want to starting point inspired by a real location, it’s certainly an option.

I decided to watch a load of video tutorials on how to make landscapes in World Machine for Unreal – usually a great way to learn and be inspired. If you (reading this) fancy doing the same, I would recommend checking out this video and the Landscape Technical Guide for Unreal Engine first so you have an idea if the tutorial is gonna work when you try it.

My initial thoughts were that generating the heightmap would be straightforward. It’s just a case of a small bit of knowledge and experimentation until you get a result close to what you want. It’ll never be exactly what you want because the maps are generated by fractals with random seeds. What I did find interesting was the way some of the videos I watched generated layer masks for when it’s time to decide what type of materials are applied to the various parts of the terrain. I saw a great deal of power (and a problem).

Exporting Terrain Masks the wrong way

I started with this video series which suggested you can use a special ‘device’ (that’s what nodes are called in World Machine)  called ‘Basic Coverage’ (you can also use the ‘Splat Map’ device) to derive what parts of the landscape should be covered in sand, rock, vegetation and where erosion occurs. So basically the end result of applying different materials to the terrain. This video also suggested the same method.

Their methodology was to pack 3 greyscale textures into 3 colour channels (RGB) that represented where each type of surface would be found on the terrain:

You can imagine the above would be great for deciding where you would expect to see snow (Blue), exposed rock (Green) and sand/grass (Red).

The idea was to place this texture into your landscape material and use a Landscape Blend node with height blends for each of the 3 materials. The RGB channels from the map above would be used to mask the materials (as demonstrated in the tutorial videos mentioned above).

However, as of Unreal Engine 4.13, height blend in the Landscape Blend material node does not work in this way. This led to lots of comments on the tutorials complaining that all they see is a black shiny material. I too fell foul of this issue. I guess the authors used a version of Unreal Engine 4.12 or lesser.

There’s another issue that struck me. This method is only ever limited to 3 materials types – which, arguably, is probably not that big a deal because for performance, you shouldn’t have a shader that has to workout which material to show from a long list. 3 or 4 materials is probably about the maximum you would want to work with.

Another issue is that you only get the end result as determined from the ‘Splat Map’ or ‘Basic Coverage’ device in World Machine. These are the result of the forces that drive a lot of the calculations. It would be better if we had access to each force as a map and use Unreal’s powerful material editor to use this information as masks combined with any additional control we might want to utilise. For example, get a slope value from Unreal and combined with the flow channel influence map to designate area of carved rock by water erosion.

With this, I set about finding my own workflow…

Exporting Terrain Masks my way

Inspired by this video that used the erosion detail to create a mask:

I decided that I want World Machine to provide Unreal with all the data it is best at generating and I want to let Unreal have control of how and where to apply the various surface materials. This way I have full control in Unreal and won’t have to use World Machine again after the initial maps have been created.

World Machine uses 3 basic forces when working our erosion: flow, wear and deposition (think displaced materials via an eroding force such as silt in rivers and sand in dunes).

These forces are applied to the topology of your starting landscape mesh to create natural looking terrain.

My workflow is therefore to use World Machine to generate the eroding forces, apply them to the height map and grab the influence and power of these forces via a greyscale image I could export as a bitmap. I could then use these bitmaps when creating my landscape material as masks to decide where the various materials should be displayed on the terrain.

This the visualisation in World Machine of my terrain:

This is the resulting heightmap and the masks for deposition, wear and flow (in order):

 

 

 

 

As you can see, these are incredibly detailed and natural looking patterns which compliment the generated landscape perfectly. Here is a visualisation of the flow map applied at 1:1 scale as a color map to the terrain as a very simple material:

Now I need to work out how to solve the other issue of not having appropriately detailed materials for the landscape… I therefore turn my attention to Megascans