Control the Atmosphere

Terragen 2 gives you quite a bit of control over the atmosphere in your scene.  In this post, I’ll cover the Main options tab including a video that shows how some of the options on that tab.

In my sample scene (download here), we have set a yellow sun and a smaller red sun several degrees above the horizon, with the camera pointed directly that them.  The amount of haze in the environment, the color of that haze, the density of “Bluesky” (non-haze component of the color) and “Bluesky” color (which can be any color… we’ll change it to red) can all be modified.  Have a look at what some changes look like:

Notice how the haze settings control how much haze you get and what color it is, while the Bluesky controls manage the color of the sky itself (what’s “behind” the haze, or if you look in a different direction away from light sources) and how intense that color is.

The Bluesky additive and Redsky decay modify the Bluesky density and Bluesky horizon color… they look to be another way of thinking of sky coloration but change the same rendering parameters at the end of the day.

For more information and insight on atmosphere rendering, have a look at the bottom of Page 16 of the User Interface Overview.

Posted in Environment | 2 Comments

Adding Objects

Procedural terrains are great at simulating hills and mountains, but some scenes just need objects – trees, houses, cars, or pretty much anything else.

You can create your own objects using 3D modeling tools like Maya, Lightwave, SketchUp and many others.  That requires specialized skills.

There are tons of models already out there.  Some can be purchased, while others are completely free. A good starting point for free models is the Google 3D Warehouse.

There are many format out there for 3D models, only some of which can be imported into Terragen 2.  Files in the .obj format and in the .lwo format can be imported directly.  The popular .3DS format can be converted to one of those two formats using the free Anim8or program.

Once you have your object (and possibly an associated texture file that tells Terragen 2 how to render the surface… in the case of .obj files the associated file is a .mtl file), you’re ready to place it in your scene.  This video shows you how (there’s no sound, view full screen and select the best resolution you can):

A sample project complete with Ducky (d2.obj) is available here.

Posted in Objects | Leave a comment

Distributing Things

In a landscape there are many things that might be distributed around the scene: Trees, rocks, sheep, flowers, patches of grass to name a few. The Distribution shader provides a means to do just that. The sample project file for this post can be downloaded here. This shader lets you determine how much of the surface should be covered by it (Coverage) and how regular or fractalized the coverage should be (Fractal breakup). In the sample project, we first edit the Base colours shader to draw the underlying terrain in grey, then use a Distribution shader to add green patches (simulating for example moss growing on stone).

Looks good so far.  Now let’s simulate little purple flowers by adding another Distribution shader on top of the green one with, you guessed it, a nice purple.

Here’s what it looks like up closer (note the use of fractal technology allows us to zoom way in, giving almost endless detail both for the terrain and for the colors covering it).

The Distribution shader has the Altitude constraints and Slope constraints available in the Surface shader.

Posted in Shaders | Leave a comment

What’s a Fractal, and Why should I Care?

For a detailed and very well written answer to “What’s a Fractal”, have a look at the Wikipedia entry.

As for the “Why should I care?” part of the question, let’s have a very short look at what a fractal is and then discuss how they apply to Terragen 2:

  1. A fractal is a geometric shape that looks approximately the same no matter how close in or far away you are, and it maintains fine structure at all scales.  This is called self-similarity.
  2. Fractals conveniently also often look like things in nature (clouds, mountains, thunder, frost crystals, …).
  3. Fractals can be represented by a (usually straightforward) mathematical formula.

Terrain rendering software can use those three properties to draw landscape that is convincing both close in and far away.  Certain fractal formulas look just like mountain ranges both close in and far away.  The program just needs to evaluate the formula for the area being rendered.  Need to draw a cloud?  Other fractal formulas make convincing clouds.  Just evaluate that formula to get a cloud.  Want to zoom in really close to the mountain?  The self-similarity property ensures it will look pretty convincing.

To see a simple case of fractals in action, consider the Von Koch curve.  It’s created simply by drawing a triangle, then taking each edge of the triangle and inserting the tip of another triangle.  Then take each edge in the resulting shape, and insert the tip of another triangle.  That can be repeated indefinitely.  If you do that 100 times and then zoom in on a small segment, it will look pretty similar to how it looked after you did it 2-3 times.  Here’s an example:


Fractals are used in many parts of Terragen 2.  Hopefully this brief overview (and the Wikipedia article if you have the time) will give you a better understanding of just what they are.

Posted in Math | Leave a comment

Hitting the Slopes

In the previous post, I discussed the Altitude constraints tab on the Surface layer shader.  Today let’s have a look at the next tab over, the Slope constraints.

The whole project file for this post is available here.

Conceptually the Slope constraints work very much like the Altitude constraints, except that the shader looks at how steep the terrain is at the point being rendered rather than how high up it is.

Our Gaussian hill starts out shallow (low slope), gets steep for a while above the base, then flattens out toward the top.  At the very top of the hill there is no slope.  To illustrate the Slope constraints tab, the following picture shows the hill with a base color rendered in dirt color, while everything from 50-60 degrees of slope is rendered in white.  Not very realistic terrain, but useful to see how it works.

Note some white specs above and below the large white bands.  This is due to the “bumpy” nature of the surface (we added some fractal detail).

A common (realistic) use for this kind of constraint is to define zones where grass grows vs. areas that are too steep for it to gain a foothold, allowing underlying terrain to show through.  The following scene just shows a fractal heightmap with a base color mix of brown (high color) and grey (low color), overlayed with a Surface layer of green with a maximum slope of 25 degrees and a fuzzy area of 10 degrees.

Posted in Shaders | Leave a comment

Let It Snow! Using the Altitude Shader

Shaders are at the core of many of the cool things you can do with Terragen 2.  Simply put, a shader colors the pixels on the landscape using some sort of formula.  There are many different shaders that offer many different formulas.

Today we’re going to have a look at a shader that can color terrain based on the altitude of the point being drawn.  The Surface Layer shader can do just that.

NOTE: Download the Terragen 2 project file used for this post to follow along.

In this project I’m using a “hill” that has a special shape known as a Gaussian curve.  For now it’s only important to know that this kind of curve looks a lot like a hill but is very smooth, making it easier to visualize certain concepts.  The “hill” shape comes from a heightfield included in the download called Gauss.ter.

Let’s put some snow at the top of our hill, and have the grass run up the side a bit.  To get that picture, we’ll use three shaders.

First, the Base colours shader will provide the “dirt” color.  Select it, and change the Colour tab to pick a good dirt color.  Make sure Apply colour is checked.  Everything that is not explicitly shaded by another shader will get the base color.

Now have a look at the Surface layer (Grass) shader (renamed from the default Surface layer 01).  If you’re not using the provided project file, you would add a new Surface layer using the Add Layer button.  Set the Colour to a nice, grassy green.  Have a look at the Altitude constraints tab.  Get the grass to go up the mountain 1000 meters by checking Limit maximum altitude and entering 1000 for the maximum and 0 for the fuzzy zone.  We’ll look at what the fuzzy zone does in a bit.

Time to add some snow now.  The steps are pretty much the same as for the grass shader, but instead check Limit minimum altitude with a value of 3000, and pick a light gray color for the snow.

Here’s our first result

This looks like a shaded mathematical curve, not a hill.  By default Terragen 2 adds fractal detail to imported heightfields.  I turned off that fractal detail for the first landscape picture.  Let’s turn it back on now.

Notice the bumps.  We’ll cover fractals in much greater detail in future posts.  For now, let’s see what happens if we double the strength of parameters that drive the shape of the fractal

Our pictures show a pretty sharp line between the grass and the dirt, and between the dirt and the snow.  In real life, there’s never a sharp dividing line.  Remember the fuzzy zone parameter we set to zero? That parameter let’s us decide how many meters wide we want to transition to be from one shader to another.  Change those parameters to 500 meters and we get nice transition zones

In the next post, we’ll have a look at using the Slope constraint tab of the same  shader.

Posted in Shaders | Leave a comment

Why read about Terragen 2 here?

Terragen 2 is an awesome program for creating computer-generated landscapes.  The trouble is, it’s not very well documented and not always intuitive.  There is some documentation and there are a few good tutorials, but for the most part the best strategy I found is to ask specific questions in their forum or just learn by trial and error.

I started a fairly ambitious, long-term personal project with Terragen 2 and am learning a lot of things that are obvious to long time users but maybe not so obvious to new users like myself.

My approach is to start with the simple and build up to the complex.

It’s a small extra step to write down my discoveries and do so hoping it will help others in the same situation.

To get the most out of this blog, please familiarize yourself with the documentation that is available.  I’m not going to talk about basic operation of the program, but rather about parts that I experiment with to reach my goals.

Here are some good places to learn the basics before returning here.

Terragen 2 Documentation
Creating Your First Scene

Posted in About | Leave a comment