Tutorial 6: Creating a Terrain

In this next tutorial, we're going to begin to look at how you can create quite realistic terrains, mountains and other landmasses using the DreamScape Terra module.


In 3ds Max, select File->Open, and from your \Scenes\DreamScape\Tutorials folder, select the Tut6-start.max file.


To start, this scene only has a camera and DreamScape Sun light present. We have to create the land from scratch.


Go to the Command Panel->Create->Geometry, and from the dropdown menu, pick DreamScape Objects.

Click on the Terra button to select it, then in the Top viewport and click on the coordinate system center and drag the mouse in any direction and create a Terra mesh that has a Width of about 2000 units. For now, the Height is not important.



Note that only a flat mesh will be created at this point, without any features applied to it. This is where the fun starts!


With the DreamScape Terra object still selected, go to the Modify panel and click on the Open Editor button.


This operation will open the main Terra dialog as shown below.



The way that the Terra Editor works is by using a grayscale height map that defines how the surface is to be built. You can paint various heights or load maps to indicate heights. White areas within the window will indicate maximum height while black areas will indicate no height. It follows that since the entire Terra window is currently black, the entire terrain is flat.


So the first thing we need to do is create a base map to work with. As has just been mentioned, DreamScape's Terra module allows us to load existing 3ds Max maps into the Terra Editor so we'll do that now.


Open the Material Editor, click on the Get Material button, then double-click on the DreamScape: Noise map from the Material/Map Browser to select it.



NOTE: It will be a Map type (with a green diamond icon, not a blue sphere icon), found in the lower half of the browser.


Close the Material/Map Browser window.

In the Material Editor, under the Noise Parameters rollout go to the Noise dropdown and choose the Hetero Terrain noise type.



In the Parameters group of controls, set the Size spinner to 0.3, then set the Offset spinner to 0.4.

Next, drag the DreamScape: Noise map from the Material Editor to the Terra Editor's Displacement Map slot within its Generate Terrain rollout.



When asked whether you want to copied map to be an Instance or a Copy, choose Instance.


The first thing you should see is that after loading the map, the terrain primitive in the 3ds Max viewports changes to reflect the height map within the Terra Editor dialog as shown below.



However, before we can render the terrain, we have to generate a terrain grid.


Click on the Generate Grid button to create the terrain.


When complete, the Terra Editor dialog will inform you that the grid has been created, as shown below.



It is critical that we generate the terrain grid, otherwise several important things won't happen. First, as mentioned before, the terrain will not render (unless we have made the Render as Geometry checkbox active), and second, we won't be able to make any modifications to it or paint on the map.


Within the Terra Editor menu, choose the Modify->Edges filter.



You will be presented with another smaller floating dialog (shown below) that acts much like a Photoshop-type filter, and is intended to modify the height map image within the Terra Editor's window.



Set the Size slider to 16, then make sure the Square Edge Type radio button is selected and click OK.


This filter will lower the edges of the terrain so the nearest mountains will not block our Camera.


In the Modify panel set the Terrain's Height spinner to 800.


The Terra ground is now ready for mapping, but if you were to try and render at this point, you would not see any ground. This is because the Terra object is currently procedural (meaning there is no actual geometry present), and it needs to be shaded via the DreamScape Sun light. Since we already have the DreamScape Sun we need to add the DreamScape atmosphere effect so the Sun can calculate the proper light color for the terrain and is needed as the "renderer" for non-geometrical versions of Terra objects.


Go to the Rendering->Environment menu, then from the Atmosphere rollout click Add.

From the Add Atmospheric Effect dialog choose the DreamScape entry then click OK to add it to the Effects list.

Under the Daylight Controls rollout, activate the Render Daylight checkbox.


Now that we have created the Terra object and the DreamScape Sky we can try a render.


Make sure the Camera viewport is active, and render the current frame.



While the representation of the geometry in the 3ds Max viewports is fairly smooth, when rendered, you can see a large amount of procedural information is put into the DreamScape Terra object. Now we need to apply a map it.


Go back to the Material Editor and select the Material #2 slot.

For the Diffuse Color choose a Dark Gray (RGB 80, 80, 80).

Open this new material's Maps rollout.

Click on the Diffuse channel map to open the Material/Map Browser and select the DreamScape: Terrain map.



The Terrain map is designed to apply colors (or other procedural or bitmap maps) based on the height and slope angles of the geometry it is applied to. You can layer as many of these maps on top of one another using the DreamScape: Composite map as the base. For now, we'll just use the one map.


For the Base color choose a solid White (RGB 255, 255, 255).

Activate the Slope Min. checkbox but leave the value to 0.0.



Activate the Slope Max. checkbox and change it's spinner value to 55.0.



What these two settings do is limit where the Base color is placed. In the case of the slope, it looks at the angles of the faces that makes up the terrain and looks for angles between 0 degrees (perfectly horizontal) and 55 degrees. Any angle that is steeper will not get the white Base Color.  


Drag and Drop this new material to the Terra land in any viewport.

Select the Sun01 light and in the Modify panel go to the Shadow Parameters rollout and activate the Geometry->Geometry checkbox.

Next, within the Parameters rollout for the Sun01 light, check the User Color checkbox for the Sun/Scene group of controls.

Finally, activate the Camera01 viewport and re-render the scene.



If you want, you can continue tweaking the maps for your mountain terrain, and by using features like the Use Falloff checkbox, you can smooth out the edges between the white, snow layer and the gray terrain beneath.