L3DT users' wiki
Large 3D terrain generator

 

Grass, sand, rock, snow

The most basic climate generally includes a land type for steep bits (e.g. rocks/cliffs), a land type for flat bits (e.g. grass), and a land type for shore/seafloor (e.g. sand). If you want high mountain ranges, then you'll probably also want a land type for snow. In this chapter we'll make a basic climate with these four elements.

I'll assume at this point that you've followed the previous 'getting started' guide, and now have a new empty climate waiting for some land types.

Grass

To create a grass land type, double-click on the '« new land type »' option in the climate editor. L3DT will ask you for the name of the land type ('grass', in this case), and afterwards will open the land type editor (shown below), which is where the fun begins.

Display colour

On the general tab, set the Display col. to something green. This option is just the colour used to represent this land type in the attributes map display, but it's sensible to pick a colour that's fairly close to the final texture colour. You'll soon see what I mean.

Base Score

On the parameters tab, set the Base score option to 100. Leave all other settings at their defaults (usually zero).

With these settings, your 'grass' type will always get a score of 100% in the land type calculation, irrespective of gradient, water-level, altitude, salinity, etc. For other land types to 'beat' grass, and thereby be assigned to the attributes map (and texture, alphas, etc.), they must score higher than 100%.

Material

On the appearance tab, we now have to select the right material for this land type. Materials are the objects that determine how a land type will look in the final terrain texture map, and contain settings for bump-map and texture images, and various other settings like blend options, strata layer settings, etc. Anyway, later in this tutorial I'll explain how to generate new materials, but right now we'll just select one of the standard materials:

For the grass land type, select the 'std_grass' material.

Sand

Name and display colour

Okay, let's go back to the climate editor and create another land type, called 'sand'.

Before I get carried away with parameters, I'll also set the display colour to something yellow (otherwise it defaults to a hideous magenta colour, so as to remind you to set the colour.)

Quick way: Altitude Range

The quick and nasty way to make a sand-like land type is to set an appropriate altitude range, such as “10m above sea level and below”. This is the way Terragen 1 did it, and it's probably the most intuitive way for new users. Thus I start here.

In the parameters pane, set the following values:

Base Score 120
Min. Alt. (check box) disabled
Max. Alt. (check box) enabled
Max. Alt. (value) 10
Max. Alt. ramp 0

First things first. The Base Score value of 120% is greater than that of grass (100%), and so within the defined altitude range (discussed next), sand will out-score grass.

Next. You'll notice above that there are four numbers given for the altitude range. Normally, you might think there would only be two; a minimum height and a maximum height. Indeed, with the values I've given above I've set the two Min values and the two Max values to the same numbers (respectively), so it will work as if there are only two numbers. Anyway, what the four numbers do is fade-in and fade-out the score of the land type, as shown in this little graph:

:tutorials:l3dt:newclimate:02:altrange.png?450

It works like this:

  • If the altitude is between MinAlt and and MaxAlt, the land type's score is Base Score.
  • If the altitude is below MinAlt by a distance less than Ramp, the score decreases from Base Score to 0.
  • If the altitude is above MaxAlt by a distance less than Ramp, the score decreases from Base Score to 0.
  • If the altitude is outside the above ranges, the score is zero.

These Min/Max/Ramp altitudes are in units of metres. If you're not so familiar with the Système international d'unités, think metre = yard (it's near enough).

Anyway, back to out climate. With the Min Alt checkbox disabled, I've ensured that sand will go all the way down to the bottom of the sea (and below, if needs be). With Max Alt set to 10, the sand will go up to 10m above sea level.

That's the theory. Let's test it:

:tutorials:l3dt:newclimate:02:am_grass_sand5.png :tutorials:l3dt:newclimate:02:hf_grass_sand1.jpg
The attributes map The heightfield
grasssand_3dview2.jpg
The 3D view

Yup. Looks like it worked.

Better way: Base Score and Water

Now, I'm not a big fan of the altitude-defined sand trick. What happens if you have a lake above sea-level? What happens if you have a valley below sea-level? What happens if you have lakes at different altitudes in your map?

Answer: You're out of luck.

This is why L3DT has water table modelling, and why the land types have a Water parameter. To use these features, I'm going to go to the parameters tab in the land type editor and first disable both the MinAlt and MaxAlt check-boxes.

I'm then going to set the following values:

Base Score 80
Water 40

What this means is that sand will by default score 80%, and in the presence of water can get as much as another 40% (depending on water level, etc). For terrain that's underwater the score will max-out at 120%, which will beat the score of grass (which is 100% everywhere). The score for sand will decrease with distance from the water's edge, eventually dropping below 100%, at which point grass will take over.

If I close all the climate editor/manager dialogs and generate a map, I get an attributes map that looks like this:

:tutorials:l3dt:newclimate:02:am_grass_sand1.png :tutorials:l3dt:newclimate:02:hf_grass_sand1.jpg :tutorials:l3dt:newclimate:02:wm_grass_sand1.jpg
The attributes map The heightfield The water map

To work out when the grass→sand transition occurs, I could go into Sapphire (the 3D viewer/editor) and have a look around. However, that requires me to make the texture, and that takes time. Instead, I'm going to do something kind of shifty. Using the image drape feature ('view→image drape') I'm going to overlay the attributes map on the water map, which gives a display something like this:

:tutorials:l3dt:newclimate:02:wm_am_grass_sand1.jpg
Water map, with attributes map overlay.

(note I've zoomed-in on the lower-right corner of the map.)

Here I have a 50-50 mix of the attributes map and water map. When I double-click on the interface between grass and sand, which is clearly visible, I get the following info box:

:tutorials:l3dt:newclimate:02:info_grass_sand1.png

So, what this means is that sand is turning to grass whwn the water table is 10m below the surface, which happened to occur when the land altitude is at 30 metres above seal-level (~100ft). That's pretty high for a sand dune!

Hmmm…time to go back to the climate editor and tweak the settings for the sand land type:

Base Score 75
Water 35

I've decreased both the Base Score and the Water parameters. There's no real reason I've chosen this combination; you could happily decrease one or the other, but I've done both. Anyway, the result with this set of parameters is:

:tutorials:l3dt:newclimate:02:wm_am_grass_sand2.jpg
Water map, with attributes map overlay (#2).

And a sand→grass cross-over at a water table depth of 5m, and an altitude of 15m:

:tutorials:l3dt:newclimate:02:info_grass_sand2.png

Still a tad high, but I'm going to leave it as is. If you want less sand still, you can go on decreasing these values. The point at which you'll get no sand anywhere is when the Base Score + Water for sand equals less than 100%, which you'll recall was the Base Score value for grass.

Just in case you're wondering why this is better than the altitude range method above; remember that this will work for water at any level, not just sea-level. It will work if you've got a lake on the side of a mountain. It will work if you have a dam. However, and this is important, it will only work if you flood the water table.

Material

Whoops. I nearly forgot to set the texture material for sand. Using the same method as for grass, I go to the 'Appearance' tab in the land type editor, and select the 'std_sand' material.

Let's see what the texture looks like:

:tutorials:l3dt:newclimate:02:tx_grass_sand2.jpg
The texture map

Looks OK to me.

Rocks

From the two examples above (Grass and Sand), you should be okay to create the rocks land type without me detailing every step. The basic parameters I'll use are:

Base score 80
Gradient 100

The Gradient parameter will give an extra 100% to the score of rocks when the gradient is 1:1 (that's 45 degrees); less for flatter land, and more for steeper land. This is the resulting attributes map:

:tutorials:l3dt:newclimate:02:am_grass_sand3.png
The attributes map

Remember to set the material for rocks. I recommend 'std_cliffs'.

Snow

For snow I am going to use the altitude range trick I decried above for sand. This is perhaps more legitimate here, as above the snow-line you're not going to get unfrozen terrain again. Anyway, the settings I'll use are:

Base score 120
Max Alt. (check box) enabled
Max Alt. (value) 200
Max Alt. ramp 100

Here I'm using a relatively low snow-line (somewhere between 200m and 300m above seal-level) merely because the map I'm using for this tutorial has a pretty low altitude range. Normally you'd want a snow-line in the 1,000's of metres (depending on latitude, climate, etc.)

:tutorials:l3dt:newclimate:02:am_grass_sand4.png
The attributes map

..and again, the material should be set to 'std_snow' on the appearance tab.

Screenshot

What does it look like in 3D? I'm dying to know. Well, here it is:

:tutorials:l3dt:newclimate:02:grasssand_3dview.jpg
Obligatory L3DTVi2 screenshot.

For the above screenshot I rendered a 4x high-res attributes map, an 8x high res light map and an 8x high res texture map.

Further work

The climate we've made here is still very simple. Generally, you would want to add many more land types, such as lush grass, dry grass, etc. You would probably also want to add more variation to the transitions between different land types using the perlin options. These extra complexities will be handled in subsequent chapters.

Next chapter

Back to tutorial index

 
tutorials/l3dt/newclimate/02.txt · Last modified: 2017/08/31 06:51 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki