Game tech

Adding a terrain in Ogre 1.7

With the Ogre wiki tutorial #3 : Terrain, Sky, and Fog  we will have a nice looking terrain but it is not ours. So let's change the code a little bit.

First we need to understand what is done.

In Ogre3D 1.7 importing a heightmap and creating a terrain is done with the Terrain component.

The new terrain uses many classes (list available here). The first one we need to setup is the TerrainGlobalOptions (Options class which just stores default options for the terrain and provides a few getters and setters).

Dune generation with world machine

Remember how we generated our first terrain?

It was pretty for a desert landscape but it lacked sand dunes and we are going to add them now.

First of all we need the dune generator macro made by nikita, download it and load it in your World Machine macro library.

Let's start with the previous terrain that can be found in the first terrain post desert2.tmd.

Add two dunefield macro to the project, combine the first one with the heightfield output of the erosion block with a ratio of ~0.985. This will add some small dune like details to our terrain.

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.

Syndicate content