Terrain generation with world machine 2

In order to generate a base terrain for outside landscapes we need a terrain generator because it saves many hours of work and can enhance visual rendering.

We chose to use World machine II, because it has a free version of course and also because it can produce very realistic outdoor scenes.

With generator blocks we will output a 2D heightmap that Ogre3D will transform into a real 3D landscape saving us the modeling of the terrain.

Be careful heightmaps are only a 2D greyscale texture (white points are the highest and black ones the lowest) so it won't be able to generate caves, rocks or trees. Those will be added to the terrain later. A heightmap only represents the ground shape (think that two different height points can't be at the same place on a 2D texture).

So let's try an example, I want to achieve a simple desert terrain for Akkadia.

In order to do this I will invoke two generator blocks :

  • Advanced Perlin
  • Voronoi

Those fractal and cellular generators will produce two greyscale  textures for the terrain base. By combining them we will mix the sharp edges of the voronoi and the noise of the perlin.

Not too bad.. but the edges are still too sharp and that does not look realistic.

So it's time to add some filters, I chose a terrace, a simple transform and a blur.

  • Terrace will make the ground more sand-like
  • Simple transform is used to smooth the terrain
  • Blur is here.. to blur everything !

Blurring the texture will make the transition between greys smooth, because the sand is kind of smooth.

Time to let the time do the job. We will finish our first example with the Erosion block. This block is quite tricky, but it does the realistic job by simulating weather erosion.

Be careful when working with multiple terrains the transition between eroded terrain is lost because World Machine calculate the erosion without knowing juxtaposed terrain erosion (Pro World machine version fix that with adding some blending between terrains).

That's a good start. You have to work on the texture now.

Texturing the terrain is another topic but basically you will have to generate a big texture for the whole terrain that wont be so detailed and some detailed texture to apply only on some portions of the terrain.

That will be done using blendmaps, blendmaps are texture with two colors. I use red and black.

Say you want to add a rocky texture on the high slope parts of the terrain. To do this in World Machine, add a selector named select slope. Configure which part of the slope you want and it will result in greyscale texture.

If you want to color it with red and black you have to create two color generators with red and black.

Then add a chooser and link the red and black in the inputs and the heightfield from the select slope in the control. Ok it's almost done.

Just add the bitmap output and link it to the chooser. We will use this blendmap in another post to blend textures together !

I've added worldmachine source to this post. Try other methods and share it back :)

desert2.tmd11.62 KB