Part One deals with the creation of images that will be imported into Torque to create the terrain. The purpose of this process is to use real-world data such as contour maps, GIS data, satellite imagery, etc., to generate the terrains in Torque.
Part Two covers the creation of images used to texture the terrain.
Later sections will other explore in-world terrain creation and editing techniques.
There are two types of images that will be used in this process:
The heightfield images were developed in Part One; this section deals with the creation and use of textures on the terrain after it's built.
Step 1. As stated above, the terrain textures must be 24-bit PNG format images and must be 256 x 256 pixels in size. Terrain textures are stretched to 2048 world units (WU) if the terrain squareSize = 8. This means there are 32 repetitions of a terrain texture across one terrain width or depth (1 terrain rep). This also means there are 8 WU per texture pixel (texel).
65536 WU / 32 texture reps = 2048 WU per texture rep 2048 WU / 256 pixels = 8 WU per texel
If the terrain squareSize is set to 4 in the mission file, there will still be 32 terrain texture repetitions but each repetition will only cover 1024 WU of the terrain.
These textures should be placed in a subdirectory under /fps/data/terrains; they will also work directly in the terrains folder but that would not be great file management.
And, although not a requirement, these textures most likely will look best when they are seamless; that is, opposite edges match so that when tiled you can't see the edges. The images below are test textures: they are 256 x 256 (the left one with each white or black section sized 128 x 128 pixels; the right with white lines every 32 pixels and red lines at 128 pixels). I used these images to calculate the total terrain size with respect to the dimensions of objects created in the QuArK map editor and to calculate the terrain square size with respect to terrain textures. Also, the right image can be used to create sight lines when manually adjusting terrain heights. .
Step 2. Place these images in a subdirectory under /fps/data/terrains/. Then open Torque and select the mission you created in Part One. Press the F8 function key to switch to "fly" mode; fly up above the terrain a bit and look down. (Use F7 to switch back).
Now press F11 to open the World/Terrain Editor. From the Window pull-down select Terrain Texture Painter.
You will now see a selection window to the right; here you can highlight the material you want to paint with or change or add new textures.
If you'd like to do the latter, click on an add or change button and you will get a new texture image selection window. Highlight the image you want and click the "LOAD" button; that image is now in your selection set.
And from the Action pull-down menu, make sure ""Paint Material" is checked.
Step 3. Now go up to the Brush pull-down menu and select your brush size.
Keeping in mind that we are using the default terrain squareSize (TSS) = 8, the table below lists the area of the terrain that is influenced based on brush size:
| Brush size | Texels | World Units (texels * TSS) |
| 1 x 32 = 32 | 32 x 8 = 256 | |
| 3 x 32 = 96 | 96 x 8 = 768 | |
| 5 x 32 = 160 | 160 x 8 = 1280 | |
| 9 x 32 = 288 | 288 x 8 = 2304 | |
| 15 x 32 = 480 | 480 x 8 = 3840 | |
| 25 x 32 = 800 | 800 x 8 = 6400 |
Below are screencaptures of a texture applied with the brush size set to 1 and the corresponding terrain grid (F9 to see this view).
In these images we see the 32x32 texel influence area for one brush that corresponds to 256 WU for the terrain squares shown in the grid view.
Many thanks to Keith Sponburgh for his feedback and corrections!
Step 4. Now let's create our own terrain texture.
Please contact me if there are errors or areas that need more elaboration. Hope this helps.
|
Last Modified: September 22 2002 | Copyright 1997-2007 Desmond.Fletcher@usm.edu School of Construction | URL: http://holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/terrain/terrain_tex.shtml |