Creating and Texturing Terrains with Terranim8or (3)
B. UV mapping and texturing terrains
The following applies to any terrain – imported, or made by Terranim8or.
In order to be textured, the terrain must have UV coordinates. Four possibilities should be considered for UV mapping:
- planar mapping, for low resolution, mostly plain terrains
- spherical (or cylindrical) mapping, for low resolution mountain peaks
- TAN8 UV mapping, for highly detailed terrains
- using external UV mappers
Terranim8or terrains are generated by default with planar mapping. This is acceptable for low detail terrains with small bumps. For terrains having high peaks, there is a problem with stretching the texture along the sharp slopes.
Spherical, or cylindrical UV mapping could be a solution for a single peak. It does not work for scenery containing more peaks, or plain terrain. There is a Terranim8or plug-in for spherical and cylindrical UV mapping, downloadable here.
External tools, like “UV Mapper” won’t help too much. In general, people won’t paint terrain textures, so the use of these tools is limited to special cases.
TAN8 UV mapping and texturing
Highly detailed textured terrains are hardly handled by Anim8or using
standard methods. Beyond the problem of a good UV mapping method that avoids
stretching the texture, there is the problem of the texture itself. Even in the
ideal case of perfect UV mapping, the size of a texture image could be
unacceptably large for a highly detailed terrain. Repeating the texture is out
of question when the texture is connected with the details on the terrain. And
last, but not least: how to get a texture that fits the details of the terrain?
TAN8 UV mapping was designed for such cases. It means assigning custom texture
coordinates, specially tailored for each unique terrain. It’s done with Build
> Terrain > TAN8 UV Mapping. These texture coordinates work together
with special terrain textures created by Terranim8or (blending original
textures). The result is a relatively small texture image, which, combined with
the special TAN8 UV mapping, makes possible custom texturing of highly detailed
terrains. The texture has the same resolution, regardless of the polygon count
of the terrain and does not repeat itself!
Creating special TAN8 textures for TAN8 UV maps
To generate a TAN8 texture map, click Build > Terrain > CreateTAN8 Map. The TAN8 Terrain Texture Editor pops up inviting you to load four texture images of exactly the same size. These textures will define the patterns applied by Terranim8or on the different areas of the terrain. Terranim8or distinguishes four kinds of areas:
- Slope in the highland. This area usually requires a rock texture.
- Plain in the highland. Usually alpine grass, or a snow texture fits here.
- Slope in the lowland. Some kind of bare soil, or mud goes here.
- Plain in the lowland. Could fit a grass texture, ground, or sand.
These are suggestions only. The actual scenery decides what kind of textures to load for each area. More than one area may use the same texture.
There are two sliders in the TAN8 Terrain Texture Editor. They control the contributions of the different images to the final texture. By default, these sliders are positioned at 50%, allowing equal contribution of each separate texture. With the default settings, the highland region is the upper half of the terrain mesh (measured on the Y axis). Moving the vertical slider towards “More highland”, the final textured terrain will display highland textures on more areas, beginning from a lower altitude till the highest peak. In the same manner, moving the horizontal slider towards “More Plain”, the textured terrain will have extended regions of plain texture, while the slope textures will be seen only on the really high-slope areas.
After clicking OK, select the file where to save the created texture.
Example of creating a TAN8 texture
Let’s texture the terrain created from height map in the first part of this tutorial! First, examine what will see the camera. The panorama animation will show a close look of the terrain and there will be little differences in altitude. These conditions suggest no (or little) differences between highland/lowland. We’ll use two flavors of grass for plain regions, just for a little variation. For slopes, we’ll use also two matching stone textures.
Because the camera will see a lot of plain terrain, we have to boost the contribution of the slope textures to have more variation. Therefore, we set the slider more to the high slope end, at 30%. After clicking OK, we save the created texture.
Still in Terranim8or, open the file containing the terrain created from height map. Select the terrain and click Build > Terrain > TAN8 UV Mapping. Now it has TAN8 texture coordinates! If you have previously configured Terranim8or with Anim8or.exe’s path, just click the Anim8or icon (on the left of the “Cut” tool). This will save the current file containing the terrain and opens it in Anim8or. Otherwise, save the file and open it in Anim8or yourself! Create a new material with Ambient = 0.2, Diffuse = 0.8, Specular = 0 and the other settings left to default. In the diffuse texture slot, load the newly created TAN8 terrain texture. Apply the material and you are done!
|Click to view panorama animation!|
One more example:
Let’s texture the terrain generated in the second part of the tutorial! In Terranim8or, select the terrain and click Build > Terrain > TAN8 UV Mapping. Now, design the texture for it. The terrain is intended to be used as a background. We'll have a rock texture for the highland slopes, a soil texture for the lowland slopes and the same grass texture for high- and lowland plains (see below).
Leaving the sliders at their default 50% position, click OK, then save
the texture file from the window that pops up. In Anim8or (or Terranim8or, if
you wish) make a new material like the one used for the height map terrain. Load
the newly created texture in the diffuse slot and apply the material over the
terrain. You'll get a terrain like the one in the image below, where I added
twice the same terrain to the scene:
If you need a close look to the terrain, you'll need to subdivide it with tension 1. You may apply a Noise Modifier with a low value (ex. Radial 0.2), but this is optional at this level of detail. Click again Build > Terrain > TAN8 UV Mapping to apply TAN8 texture coordinates to the new faces. Now, the camera may zoom in more without disturbing texture artefacts.
With TAN8 UV mapping one can obtain surprising results. The key is to have small faces on the terrain mesh and proper textures! Small faces is a relative term and means either a mesh placed in the background, or a very detailed mesh. At the time of writing this tutorial, I don't exactly know a recipe of how to make proper textures. As a guideline, the separate textures used to combine the final texture should have high frequency noise (that's a fancy way of saying "a lot of small details") and should fit together.