Você está na página 1de 110

Ef

PnP TerrainCreator
Manual

Version 1.2.2
07 – February – 2009

i
1 Contents

1 Contents...........................................................................................................................................................ii
2 PnP TerrainCreator Basics..............................................................................................................................1
2.1 Terrain Project’s Architecture....................................................................................................................1
2.1.1 Sector’s Detail....................................................................................................................................2
2.2 The User Interface....................................................................................................................................3
2.3 2D Mode...................................................................................................................................................3
2.4 3D Mode...................................................................................................................................................3
2.4.1 3D Settings.........................................................................................................................................4
2.4.1.1 Base settings for 3D rendering.......................................................................................................4
2.4.1.2 Texturing settings...........................................................................................................................4
2.4.1.3 Object rendering settings...............................................................................................................5
2.4.1.4 Vegetation rendering settings.........................................................................................................5
2.4.1.5 3D movement settings...................................................................................................................5
2.4.1.6 Sky rendering settings....................................................................................................................6
2.4.2 3D Navigation.....................................................................................................................................6
2.4.3 Human Reference Model and Scale Reference..................................................................................7
2.4.4 Environment Simulation......................................................................................................................7
2.5 Creating a new Terrain..............................................................................................................................8
2.5.1 Detail Heightmap Creator...................................................................................................................8
2.6 Setting the Terrain Parameters.................................................................................................................8
2.6.1 Resizing an existing Terrain................................................................................................................9
2.7 Terrain Documentation..............................................................................................................................9
2.7.1 Sector Comments...............................................................................................................................9
2.7.2 Comment Placements......................................................................................................................10
3 Heightmap Editing.........................................................................................................................................11
3.1 Manual Heightmap Editing......................................................................................................................11
3.1.1 Definition Heightmap Editing.............................................................................................................11
3.1.1.1 Parameters for Heightmap Editing...............................................................................................12
3.1.2 2D Sector Detail Heightmap Editing..................................................................................................12
3.1.3 3D Sector Detail Heightmap Editing..................................................................................................12
3.1.3.1 Holes in the Terrain Surface.........................................................................................................13
3.2 Falloff Effect PlugIns shipped with PnP TerrainCreator...........................................................................13
3.2.1 Step Falloff Effect (PnPTC)..............................................................................................................14
3.2.2 Gradient Falloff Effect (PnPTC)........................................................................................................14
3.2.3 Smooth Falloff Effect (PnPTC).........................................................................................................15
3.3 Automated Heightmap Generation..........................................................................................................15
3.3.1 Parameter Settings for Terrain Generation.......................................................................................16
3.3.2 Generation of a single Sector...........................................................................................................16

ii
3.4 Heightmap Generator PlugIns shipped with PnP TerrainCreator............................................................16
3.4.1 Diamond Square (PnPTC)................................................................................................................16
4 Heightmap Filter Functions............................................................................................................................18
4.1 Applying the Heightmap Filter.................................................................................................................18
4.1.1 Applying to a whole Sector................................................................................................................19
4.2 Heightmap Filter PlugIns shipped with PnP TerrainCreator....................................................................19
4.2.1 Average (PnPTC).............................................................................................................................19
4.2.2 Flatten (PnPTC)................................................................................................................................19
4.2.3 Gaussian Noise (PnPTC).................................................................................................................19
4.2.4 Median (PnPTC)...............................................................................................................................20
4.2.5 Raise/Drop (PnPTC).........................................................................................................................21
5 Surface Texturing..........................................................................................................................................22
5.1 Terrain Texturing Basics.........................................................................................................................22
5.2 Initialization of Texture Manager.............................................................................................................22
5.3 Manual Terrain Texturing........................................................................................................................23
5.3.1 Texture picking.................................................................................................................................25
5.4 Automated / Randomized Terrain Texturing............................................................................................25
5.4.1 Automated Texturing Definitions ......................................................................................................26
5.4.2 Sector Texturing...............................................................................................................................26
5.5 Texturing Modes.....................................................................................................................................26
5.5.1 Non Blended Texturing.....................................................................................................................27
5.5.2 Linear Blended Texturing..................................................................................................................27
5.5.2.1 Heightmap elements affected by manual texturing......................................................................27
5.5.2.2 Flipping of triangle orientation within one terrain quad..................................................................27
5.5.3 Texturemap......................................................................................................................................29
5.6 Lightmaps and Dynamic Lighting............................................................................................................29
5.6.1 Dynamic Lighting..............................................................................................................................29
5.6.2 Lightmaps.........................................................................................................................................29
5.6.2.1 Lightmap Definitions.....................................................................................................................29
5.6.2.2 Lightmap Creation........................................................................................................................30
5.7 Texture Manager PlugIns shipped with PnP TerrainCreator...................................................................31
5.7.1 File based Textures (PnPTC)...........................................................................................................31
5.8 Texturing PlugIns shipped with PnP TerrainCreator................................................................................31
6 Oceans, Seas and Rivers..............................................................................................................................32
6.1 Ground Water Level................................................................................................................................32
6.1.1 Types of Water.................................................................................................................................32
6.1.2 Ground Water Level of the whole Terrain.........................................................................................33
6.1.3 Ground Water Level of a single Sector.............................................................................................33
6.1.3.1 Sector Ground Water Level definition in 2D.................................................................................33
6.1.3.2 Sector Ground Water Level definition in 3D.................................................................................33

iii
6.2 Local Lakes.............................................................................................................................................34
6.3 Rivers......................................................................................................................................................34
7 Terrain Vegetation.........................................................................................................................................35
7.1 Initialization of the Vegetation Manager...................................................................................................35
7.2 Placing Trees..........................................................................................................................................35
7.2.1 The Tree Manager............................................................................................................................35
7.2.2 Forest Definition...............................................................................................................................36
7.2.3 Placing and editing single Trees.......................................................................................................37
7.2.3.1 2D Tree placements.....................................................................................................................37
7.2.3.2 3D Tree placements.....................................................................................................................38
7.2.3.3 Alternative 3D move mode for Trees............................................................................................39
7.2.3.4 Tree Placement Settings..............................................................................................................40
7.2.4 Spraying Trees onto the Terrain.......................................................................................................40
7.2.5 Removing Tree Placements.............................................................................................................41
7.2.5.1 The Tree Rubber Tool..................................................................................................................41
7.2.5.2 Additional Tree Commands..........................................................................................................41
7.3 Grass Coverage......................................................................................................................................41
7.3.1 The Grass Manager..........................................................................................................................41
7.3.2 Manual Grass Coverage Editing.......................................................................................................42
7.3.2.1 Spraying Grass onto the Terrain..................................................................................................42
7.3.2.2 Removing Grass Coverage..........................................................................................................43
7.4 Automated Vegetation Generation..........................................................................................................44
7.4.1 Parameters for automated tree placement generation......................................................................44
7.4.2 Automated tree placement generation..............................................................................................45
7.4.3 Parameters for automated grass coverage generation.....................................................................45
7.4.4 Automated grass coverage generation.............................................................................................47
7.5 Vegetation Manager PlugIns shipped with PnP TerrainCreator...............................................................47
7.5.1 Vegetation Files (PnPTC).................................................................................................................47
7.5.1.1 PlugIn settings..............................................................................................................................48
7.5.1.2 Ogre Mesh files............................................................................................................................48
7.6 Vegetation Generator PlugIns shipped with PnP TerrainCreator.............................................................48
8 Static 3D Objects...........................................................................................................................................49
8.1 Initialization of Object Manager...............................................................................................................49
8.2 Placing static 3D Objects........................................................................................................................50
8.2.1 Alternative 3D move mode for static Objects....................................................................................52
8.2.2 Snap To Grid....................................................................................................................................52
8.2.3 Object Placement Settings...............................................................................................................52
8.2.4 Removing Object Placements..........................................................................................................53
8.2.5 Additional Object Functionalities.......................................................................................................53
8.2.5.1 Align to Ground............................................................................................................................53

iv
8.2.5.2 Flatten Ground Below...................................................................................................................53
8.2.5.3 Set to Zero Height........................................................................................................................53
8.2.5.4 Place on Ground..........................................................................................................................53
8.2.5.5 Rotate..........................................................................................................................................53
8.3 Object Manager PlugIns shipped with PnP TerrainCreator.....................................................................54
8.3.1 Static Object Files (PnPTC)..............................................................................................................54
8.3.1.1 Ogre Mesh files............................................................................................................................54
8.3.2 CS Objects (PnPTC)........................................................................................................................54
9 Sounds..........................................................................................................................................................56
9.1 Ground Sounds.......................................................................................................................................57
9.2 Environmental Sounds............................................................................................................................57
9.2.1 2d Environmental Sound Editing.......................................................................................................58
9.2.1.1 Context Menu for a Sound Placement..........................................................................................59
9.2.1.2 Context Menu for Free Space......................................................................................................60
9.2.1.3 Standard Sound Placements........................................................................................................60
9.2.2 3D Environmental Sound Editing......................................................................................................60
9.2.2.1 Alternative 3D move mode for Sound Placements.......................................................................61
9.2.2.2 3D Environment Sound Simulation...............................................................................................61
9.2.3 Sound Dependency Functions..........................................................................................................61
9.2.4 Sound Playlist Settings.....................................................................................................................63
9.2.4.1 Playlist playback type...................................................................................................................63
9.2.4.2 General playlist settings...............................................................................................................63
9.2.4.3 Sound playback settings..............................................................................................................63
9.2.4.4 Sound transitions.........................................................................................................................64
9.2.4.5 Environment sound simulation.....................................................................................................64
9.3 Sound PlugIns shipped with PnP TerrainCreator....................................................................................64
9.3.1 fmod Sound Engine (PnPTC)...........................................................................................................64
10 Roads and Rails..........................................................................................................................................66
11 Additional Functionalities.............................................................................................................................67
11.1 User Defined Data Elements.................................................................................................................67
11.1.1 Defining User Defined Data Elements............................................................................................67
11.1.2 Applying User Defined Data Elements............................................................................................68
11.2 Input Devices........................................................................................................................................68
11.2.1 Space Mouse..................................................................................................................................68
11.2.2 Pressure Sensitive Pen Tablet........................................................................................................68
12 Physics Simulation.......................................................................................................................................69
12.1 Physics Simulation PlugIns shipped with PnP TerrainCreator...............................................................69
12.1.1 ODE Physics Simulation (PnPTC)..................................................................................................69
12.1.2 Meqon Physics Simulation (PnPTC)...............................................................................................69
13 Terrain Import..............................................................................................................................................70

v
13.1 Importing a single Sector.......................................................................................................................70
13.1.1 Heightmap Import from Bitmap (PnPTC)........................................................................................70
13.1.2 Terrain Import from L3DT...............................................................................................................70
13.1.3 Heightmap Import from RAW (PnPTC)..........................................................................................71
13.2 Importing the whole Terrain...................................................................................................................72
14 Terrain Export..............................................................................................................................................73
14.1 Exporting the whole Terrain...................................................................................................................73
14.2 Exporting a single Sector......................................................................................................................73
14.3 Exporter PlugIns....................................................................................................................................73
14.3.1 Grass coverage to BMP Export (PnPTC)........................................................................................73
14.3.2 Heightmap to 3DS Export (PnPTC)................................................................................................74
14.3.3 Heightmap to B3D Export (PnPTC)................................................................................................75
14.3.4 Heightmap to BMP Export (PnPTC)...............................................................................................76
14.3.4.1 Exporting a single sector............................................................................................................76
14.3.4.2 Exporting the whole terrain.........................................................................................................77
14.3.5 Heightmap to OBJ-File Export (PnPTC).........................................................................................77
14.3.6 Heightmap to OGRE xml mesh Export (PnPTC)............................................................................78
14.3.7 Heightmap to RAW Export (PnPTC)...............................................................................................79
14.3.8 Heightmap to X-File Export (PnPTC)..............................................................................................79
14.3.9 Lightmap to BMP Export (PnPTC)..................................................................................................80
14.3.10 Normalmap to BMP Export (PnPTC)............................................................................................81
14.3.11 Obj/Veg Placements to TXT Export (PnPTC)...............................................................................81
14.3.11.1 Obj/Veg placement TXT file format..........................................................................................82
14.3.12 Object placements to XML Export (PnPTC).................................................................................83
14.3.12.1 Object placement XML file format............................................................................................83
14.3.13 Sound placements to XML Export (PnPTC)..................................................................................83
14.3.13.1 Sound placement XML file format............................................................................................84
14.3.14 Template based Scene Export (PnPTC).......................................................................................85
14.3.14.1 Template File Format...............................................................................................................86
14.3.15 Terrain to 3D Game Studio HMP-File Export (PnPTC).................................................................93
14.3.16 Texture map to BMP Export (PnPTC)...........................................................................................94
14.3.17 Texture Splatting Alphamap Export (PnPTC)...............................................................................94
14.3.18 Texture Splatting Indexmap Export (PnPTC)................................................................................97
14.3.18.1 Texture index correspondence TXT file format........................................................................97
14.3.19 Vegetation to XML Export (PnPTC)..............................................................................................98
14.3.19.1 Vegetation placement XML file format.....................................................................................98
15 Program Settings.........................................................................................................................................99
15.1 Render Device Settings.........................................................................................................................99
15.1.1 Optimize the Rendering Speed.......................................................................................................99
15.2 Loaded PlugIns.....................................................................................................................................99

vi
15.3 Customizing the Window Layout.........................................................................................................100
15.4 Keyboard Layout.................................................................................................................................101
16 Glossary......................................................................................................................................................viii
17 Index.............................................................................................................................................................ix

vii
2 PnP TerrainCreator Basics

PnP TerrainCreator is a heightmap based terrain creator/generator integrating all design tasks for large scale
terrain creation in one single tool. This manual will describe in detail all features of PnP TerrainCreator.
We will first describe the terrain project’s architecture in section 2.1 as its knowledge is essential to understand
the functioning of the different edit modes. In section 2.4 we give a short introduction to the necessary settings
and control mechanisms for the 3D view modes of PnP TerrainCreator. After creating our first terrain in section
2.5 and learning the basics of PnP TerrainCreator’s user interface in section 2.2, the following sections (3 to 9)
will describe the single edit modes in more detail.
We suggest to read chapter 2 carefully before creating the first terrain. Lets first take a look at the elements of
the main screen in the following image. They will be discussed in detail throughout this chapter.

2.1 Terrain Project’s Architecture


PnP TerrainCreator was designed to enable the creation of really huge terrains. Therefore the terrain data is not
stored in one single file but divided into a large number of files each containing the data of one part of the ter­
rain. We call this file collection the terrain project. All these files are located in subdirectories below the terrain
project’s main file.
The project file (with the extension .pnptc) contains only a few base definitions of the terrain, like its size for ex­
ample. The whole terrain is divided into small sectors of uniform size. All terrain definitions (heightmap, textur­
ing, objects, sounds etc.) are stored in separate files for each sector. These files are located in the “SECTORS”
subdirectory. This separation enables the creation of huge terrains and enables the cooperative work of several

1
designers on the same terrain at the same time, because relevant/changed parts of the terrain can be easily
transferred by copying the corresponding files.
When PnP TerrainCreator is started the terrain’s definition
map will be displayed as can be seen in the figure to the left.
The definition map is a low resolution heightmap of the terrain.
You can also see the single sectors within this definition map
separated by vertical and horizontal lines. By moving the
mouse cursor over the definition map the <Info> tool window
(see 2.2) will display the sector number, the position of the
cursor within this sector and the height of the definition map
below the cursor. Editing the definition heightmap will be de­
scribed in section 3.1.1.
Using the definition map's context menu (as
seen in the image to below, one can switch
between a grayscale and colored heightmap
representation. Furthermore the scale dis­
play at the bottom right screen corner can
be deactivated.

2.1.1 Sector’s Detail


For the detailed editing of a sector it has to be opened in detail edit mode. Simply double
click with the left mouse button on a sector or open its context menu by clicking with the
right mouse button and afterwards selecting <Edit> from the context menu.
The sector’s detail heightmap will be
created upon the first opening of the
sector from its definition map. The
detail heightmap is created using the
<Detail HMap Creator> as it is set in
the terrain project’s settings (see
2.5).
When a sector’s detail is opened the tool window (see 2.2)
<Sector detail editing> will appear. You can save all
changes you made to this sector by clicking the <Save>
button within this tool window. Clicking the <Close> button
will close this sector and return to the terrain’s definition
map.
The sector's 2D map can be moved with the scroll bars to the left and bottom. Alternatively one can scroll the
map by holding down the <space> key or the middle mouse button while the mouse is over the map and then
moving the mouse. The 2D map will follow the mouse's movements.

2
2.2 The User Interface
The user interface of PnP TerrainCreator uses predominantly standard windows controls.
We won’t go too deep into detail here. All functions can be accessed via the menu, context
menus, command buttons or function keys. When the editing functions of PnP TerrainCre­
ator are described later in this document it will be explained in detail, in which ways these
functions are accessible. We will focus here on a special not windows standard control we
call tool window. On the right hand side of the application’s main window you can find the
tool window bar with several tool windows on it.
At the top of this tool window bar you can find some colored icons. By using these icons you
can select the edit mode of PnP TerrainCreator. Depending on the current edit mode and
view settings the relevant tool windows will be displayed on the tool window bar.
It might happen, that not all tool windows can be displayed completely at the same time.
You can use the scroll bar at the right of the tool window bar to bring the desired tool win­
dow into view. Alternatively you can minimize the tool windows you don’t need by clicking
the icon in the tool window’s title bar. The tool windows are categorized by their content
into <Editing> and <Environment> tool windows. You can switch between these two tool
window sets by clicking on the according button left to the tool windows.
At the bottom of the tool window bar, special context sensitive tool windows are located. In
the image to the right, the <Color scale> is shown as special tool window. The di­
vider can be used to change the amount of space used by the special tool windows.
With the button at the left border of the the tool window bar one can select, whether or not
to display the tool windows using two columns.

2.3 2D Mode
The program always starts in 2D display mode, in which the terrain is displayed as heightmap, that is a 2D bit­
map in which every color or gray scale value represents a height value of the terrain surface. The overview map
of the whole terrain as well as the detail map of the sector, which we have seen earlier in this chapter are ex­
amples of such heightmaps. Most of the different editmode described in the remainder of this manual work in
2D as well as 3D displaymode. However, some of them only work in 2D while others exclusively work in 3D. If
one editmode exclusively works in 3D or 2D, the program will automatically switch into the right viewing mode.
In 2D view mode the tool window <2D mode> is visible, in which basic settings of the 2D
display can be set. If the check box <Show water> is activated, the water settings (see sec­
tion 6) will be shown as overlay to the 2D heightmap. The check box <Show trees> activ­
ated the display of the tree placements (see section 7.2.3.1). This option is only available, if the sector is opened
in detail edit mode.

2.4 3D Mode
After opening a sector’s detail you can switch to the 3d view and edit mode by
clicking the button <3D> above the view and editing area. The view and editing area will display a realtime 3d
scene of the current terrain sector. Render settings like coloring and texturing are described in section 2.4.1, the
navigation through the scene is described in section 2.4.2.

3
2.4.1 3D Settings
The rendering settings for the 3d scene can be changed in the <3D mode> tool window. The following rendering
settings can be applied here:
• Show surroundings: Whether or not a small part of the surrounding sectors
should be rendered. Surrounding sectors will be rendered in a different base
color (see below).
• Show grid: Whether or not the terrain surface grid should be displayed. (Key­
board shortcut <G>)
• Show textures: Whether or not the surface texture should be displayed.
• Show objects: Whether or not the static objects should be displayed.
• Show trees: Whether or not trees should be displayed.
• Show grass: Whether or not grass placements should be displayed.
• Show water: Whether or not the water should be displayed.
With the slider at the lower border of this tool window the base movement speed can be set.
Some more rendering settings can be applied on a second dialog that can be opened by clicking the <Settings>
button or selecting the menu <settings, 3d view settings>.
2.4.1.1 Base settings for 3D rendering
Within the first tab <Base Settings> of the <3D view
settings> dialog, the base rendering parameters can
be set. First of all the maximum viewing distance
measured in meters for the scene can be set in the
<Max. viewing distance> text field.
Within the <Colors> frame the colors used in the 3d
view can be set. <Surface color> is the color used for
rendering the terrain surface if no textures are
rendered. <Surface color (surroundings)> is the ter­
rain surface color for rendered sectors surrounding
the currently edited sector. <Background color> is
the color of the 3d background, the sky.
The Color of the lightning can be set in the <Lighting> frame. The check box <Use Lighting> determines whether
or not the 3d scene should be rendered with lightning effects. If the lightning is turned on the color of the sun and
the moon can be set. Additionally ambient light colors (for surfaces that are not lit directly by the sun or moon)
have to be set. The position of the light source (sun or moon) depends on the day time. The day time can be set
within the <Environment simulation> tool window (see 2.4.4).

2.4.1.2 Texturing settings


Within the tab <Texturing>, parameters for the sur­
face texture rendering can be set. <Ground texture
size> determines the number of heightmap ele­
ments over that one surface tex­
ture extends. The figure to the
right illustrates the extension of
one texture for a parameter
value of 2.
The next parameter, the <Texturing mode>, defines
the way how the transition between different textures
is rendered. The available texturing modes are de­
scribed in detail in section 5.5.
<Texturemap pix. per. el.> defines how many pixels per heightmap element are created for the texture map.
Please see section 5.1 and 5.5 for a detailed description on the meaning of a texture map.
To give the terrain a more natural look, a second texture – a noise texture – can be laid over the terrain. After
activating the check box <Detail texture overlay> the combo box <Overlay texture size> defines the size of this
overlay texture analogous to the <Ground texture size> parameter. From the combo box <Texture> you can se­
4
lect the texture which will be used as overlay texture. To the right you can see the build in noise
texture which is used if you select (default) from the combo box. To add textures to that combo
box, simply copy the desired texture files into the “MISC_DATA\OVERLAY” directory of your ter­
rain project directory. All texture files located in that directory will be shown in the combo box and
are therefore usable as overlay textures. Depending on whether or not a texture is tileable, the
texture addressing mode has to be set to mirror or repeat in the <Texture addressing> drop down list.
2.4.1.3 Object rendering settings
Parameters for the rendering of 3d objects can be
applied within the <Objects> tab. First of all one can
set the maximum viewing distance for rendered ob­
jects within the <Max. viewing distance> text field.
With the check box and text field <Max. Rendered
objects> one can set the maximum number of
rendered objects. If the check box is activated, only
the objects with the closest distance to the viewer
position are rendered.
With the check box <Render wireframe> one can set
whether or not the objects should be rendered as
wireframe or solid mode.
Within the lower frame <PlugIn settings> of this dialog, object manager PlugIn specific settings can be applied.
The contents of this frame are created by the PlugIn that is selected as object manager for the currently loaded
terrain project. If PlugIn specific settings are to be applied, they are described with the PlugIn in section 8.3.

2.4.1.4 Vegetation rendering settings


Parameters for the rendering of vegetation objects
can be applied within the <Vegetation> tab. First of
all one can set the maximum viewing distance for
rendered trees and grasses within the <Max. viewing
distance tree> and <Max. viewing distance grass>
text fields.
With the check box and text field <Max. Rendered
trees> one can set the maximum number of
rendered trees. If the check box is activated, only the
trees with the closest distance to the viewer position
are rendered. <Max. Rendered grasses> is the
same functionality for grass placements.
Within the lower frame <PlugIn settings> of this dialog, vegetation manager PlugIn specific settings can be ap­
plied. The contents of this frame are created by the PlugIn that is selected as vegetation manager for the cur­
rently loaded terrain project. If PlugIn specific settings are to be applied, they are described with the PlugIn in
section 7.5.
2.4.1.5 3D movement settings
Parameters for the 3D movement of the viewer can
be seen on the <3D Movement> tab. Within the
<Camera settings> frame one can specify how the
camera will be moved over the terrain. Setting
<Height over ground> to “1st person“ will move the
camera in a way as if walking over the terrain in a
first person shooter game like style. An alternative
value for this setting is “Level flight“, that will keep the
viewer at a constant hight. A third mode is the
“Straight flight” mode, in which the motions are al­
ways exactly along the viewing direction.
The PlugIn used for physics simulation (see section
12) can be set within the <Physics simulator> frame. The parameters within the <Physics PlugIn settings> frame
are PlugIn specific and are therefore also described in section 12.

5
2.4.1.6 Sky rendering settings
Within the <sky Rendering> tab, parameters for dis­
tance fog can be set. Distance fog allows for a
smooth transition between terrain and sky at the hori­
zon. First one has to activate this fog by checking the
<Activate fog> check box. <Fog color> is the color
into which the terrain will be blended in the distance.
It should be the same as the sky color. If a sky box is
used (coming in future versions), this color should
match the overall sky color as good as possible. The
parameters <Fog start distance> specifies the dis­
tance from the viewer, where the blending will start.
The parameter <Fog end distance> specifies the dis­
tance from the viewer, where the terrain will be completely faded out into the fog color.
Within the bottom frame <Sky rendering System> you can specify how you want the sky to be rendered. First
you have to select the <Rendering system>. Possible values there are <no sky> in which the sky is simply
rendered in the color specified within the base rendering settings tab (section 2.4.1.1), sky box, sky dome and
sky sphere. All of which are very common and well known methods, so we will not describe them here in detail.
For the sky dome and sphere one texture file is used, which will be spanned over the sphere/dome. This texture
file can be selected from the <Sky texture (set)> combo box. Copy the texture files, which you want to use as
sky textures into the “MISC_DATA\SKY” directory of your terrain project directory. All texture files located in that
directory will be shown in the combo box and are therefore usable as sky textures.
For a sky box a set of 8 textures have to be copied to that directory. Those textures have to follow a naming
convention to be used correctly within PnP TerrainCreator as sky box textures. The texture file name of the front
(north) texture of the sky box has to have the suffix “_FR” (for example “SKY_FR.BMP”). The texture of the right
(east) “_RT”, of the left (west) “_LF”, of the back (south) “_BK”, of the top “_UP” and of the bottom “_DN”. If all 8
textures of such a sky box are found, its name (without the suffixes) is displayed within the <Sky texture (set)>
drop down list. The way in which the sky box textures are put next to each other is not standardized. In the fol­
lowing image to the left you can see a sky box texture set used by OGRE, to the right one from Irrlicht. The left
one has to be used with a clockwise setting of the <Texture order> drop down list, the right one with a counter
cw setting. Additionally the vertical textures (top and bottom) are bound to different horizontal textures. This
parameter can be set with the <Vertical texture pos> drop down list. The correct values are Front for the OGRE
scene box and Right for the Irrlicht scene box in the following illustration.

2.4.2 3D Navigation
The navigation through the 3d terrain scene is similar to the navigation mechanisms known from popular 3d
games. Using the cursor keys you can move the current viewing position forwards, backwards and sidewards.
Holding the <Shift> key down will result in faster movements, holding the <Alt Gr> key down in slower move­
ments. With the slider at the button of the <3D mode> tool window, you can set the base speed in a range
between 1 and 20 km/h. The viewing rotation can be changed using the mouse. Locate the mouse pointer
somewhere within the 3d view and then keep the middle mouse button pressed. All subsequent mouse move­
ments will result in rotations of the current viewing direction. The same functionality can be achieved by holding
the <Shift>+<Y> key down while moving the mouse. As alternative for moving with the cursor keys, one can hold
down the <Y> key and at the same time move the mouse. The 3D viewing position will follow the mouse move­
ments.
The viewing height over the terrain surface can be changed either by scrolling the mouse wheel or using the
<Page Up>/<Page Down> keys.

6
The current position measured in meters on the terrain sector, the viewing height, and the current speed can be
seen in the <3D mode> tool window (see section 2.4.1). You can jump to a position on the sector by entering the
coordinates in the text fields <x> and <y> and afterwards clicking the <Goto> button. Alternatively one can hold
down the <J> key and afterwards click with the left mouse button somewhere onto
the 3D terrain surface. The current viewing position will be transferred to the
clicked heightmap position.
Pressing the <N> key will display a 2d map as navigation assistance in the upper
left corner of the 3d scene window. The current position on the map is visualized
as red dot. The current viewing direction (up/down and orientation) can also be
seen at the right side of this overlay. You can use the and buttons at the bot­
tom left of this navigation window to zoom the map. Clinking with the left mouse
button will zoom in/out stepwise, clicking with the right mouse button will set the
maximum/minimum zoom factor directly. By clicking the button at the bottom
right corner the size of this navigation window can be changed.
You can simply click with the left mouse button on the map and the 3d viewing position will be set automatically
to that position. By clicking with the right mouse button on the map the viewing direction will be set in a way that
you will look from your current 3d position to the position clicked with the mouse.

2.4.3 Human Reference Model and Scale Reference


When modeling in 3D it might be helpful to view the relation of the
terrains heights with respect to the size of a human. Therefore you
can place a human reference model of 1.80 meters height on the
terrain. Hold down the <R> key on the keyboard and subsequently
click with the left mouse button on the terrain where you would like
to place the model.
Holding down the <R> key an clicking with the right mouse button,
a scale object with 8 meters in height is placed on the terrain sur­
face.

2.4.4 Environment Simulation


A second tool window <Environment simulation> will open in the <Environment> section of the tool window bar,
whenever the 3d mode is activated. Within this dialog one can set environment condition that will for example af­
fect the lighting of the terrain or the playback of environmental sounds (see section 9.2.2).
You can set the environment conditions by placing the sliders in the following way:

• sets the current day time.


• sets the month.
• sets the current lightning condition.
• sets the temperature.
• sets the current wind speed.
• sets the amount of precipitation.

The <day time> parameter affects the lighting direction and color for the dynamic lighting mode (see section
5.6.1). It computes the east-west (right ascension) angle of the lighting direction with respect to the time in a
quite natural way. Furthermore it switches from day light to night light colors (see section 2.4.1) at 18 h (6 pm)
and back to day colors at 6 h (6 am).
The <wind> parameter is passed to the vegetation PlugIn. If the underlaying vegetation rendering engine (see
section 7.5) supports wind effects, you can control the swaying of trees and grasses with the wind strength.

7
2.5 Creating a new Terrain
To create a new terrain project select the menu
<File, New>. The following dialog will open.

You have to name the project to be created in the


text field <Name> and you have to select a
<Base directory> for the storage of the project’s
files by clicking the <…> button. PnP TerrainCre­
ator will automatically create a new subdirectory
with the name of the project below the selected
base directory and place all newly created files in
it.
Next you have to select the number of sectors in
x and y direction to be created (Text fields <Num Sectors (x)> and <Num Sectors (y)>). Each sector’s definition
map will have the border size given in the text field <Sector definition size> (see section 2.1) and each sector’s
detail map the border size given in the field <Sector detail size> (see section 2.1.1). The parameter <Detail ele­
ment size> specifies the size of one height map element in the sector's detail map in meters. It is a horizontal
scaling factor for the terrain. The following images illustrate an element size of 1 (left image) and 5 (right image)
with respect to the human reference model.

The terrain’s height range can be set in the text fields <Minimal height> and <Maximal height>. The text field
<Initial height> defines the height to that all sectors will be initialized upon the creation of the terrain project.
The drop down lists within the frame <Used base function PlugIns> define the PlugIns to be used for special
functions of PnP TerrainCreator. <Sound Engine> will be described in section 9, <Texture Manager> in section
5, <Detail HMap Creator> in section 2.5.1 and <Object Manager> in section 8
The drop down lists within the frame <Default generator PlugIns> define the PlugIns to be used by default for
automated terrain generation. <Heightmap> will be described in section 3.3.

2.5.1 Detail Heightmap Creator


As mentioned in 2.1.1 PnP TerrainCreator will create a high resolution detail map for each sector from a lower
resolution definition map. This process can be done by a heightmap creator PlugIn as it is used for automated
terrain generation (see 3.3). By default the <Internal default Creator> is used which will create a linearly interpol­
ated and smoothed detail map.

2.6 Setting the Terrain Parameters


Most of the parameters set during terrain creation
(section 2.5) can be altered later by selecting the
menu <File, Terrain properties>. The same dialog
as describe above will open, where you can
change the selected PlugIns and adapt the minim­
al and maximal height. Terrain name and storage
location can not be changed. Within the <Terrain
size> frame the dialog is a bit different from that
described above. Behind the <Minimal height> and
<Maximal height> parameters you can find a new
button <Adapt>. Pressing this button adapts the
minimal and maximal heights to the heights used by your terrain. This functionality is extremely useful if export­

8
ing the terrain heightmap to a bitmap file, as the limited bitmap's grayscale range can so be exploited best. PnP
TerrainCreator's StandardEdition can resize an existing terrain by pressing the <Resize> button as described int
the following sub section.

2.6.1 Resizing an existing Terrain


Within the following dialog an existing terrain can be resized. The new terrain size can be larger or smaller than
the existing one. It is strongly recommended to make a backup of the terrain project. The old project will be
overwritten by the new one, so if you decrease the terrain size or if you move some sectors outside the range of
the new terrain, the data will be lost.
Within the upper frame <New terrain size> you can set the size
(number of sectors) of the new terrain. In the lower frame <Loc­
ation of existing terrain> you can specify where the existing ter­
rain should be located within the new terrain. Using the arrow
buttons you can move the "old“ terrain over the "new" one. Sec­
tors of the "old" terrain that will be copied to the "new" one are
highlighted in green, sectors which are not copied and therefore
deleted are highlighted red.

2.7 Terrain Documentation


Especially for larger terrains it is very useful to document the terrain and place comments on the terrain to high­
light locations where some more work has to be done. These comments are especially useful if working in a
team on a complex terrain. Therefore most of the features described below only apply for the larger scale Pro­
fessional-Edition.

2.7.1 Sector Comments


Comments for a whole sector are available from the terrain overview map (see section
2.1). Sectors to which a comment has been assigned are highlighted with an orange tri­
angle in the upper left corner. To create/edit a comment for a sector, open the sector's
context menü with the right mouse button and select <Sector comments...> from it. In
the following dialog, you can enter any arbitrary text as comment for the sector.

9
Information The sector comments are not available with the Standard and Community Edition of PnP Terrain­
Creator.

2.7.2 Comment Placements


In the sector's detail view (see section 2.1.1), one can place comments onto the terrain
surface in 2D as well as in 3D view. Within the tool window <Sector comments> on the
<Environment> tool window bar section all comment placements for the opened sector
are listed in the <Comments> list. This list displays the priority of the comment in
braces and the caption of the comment. If the check box <Show comments> is
marked, the comment placements will be displayed inside the 2D and 3D views. If you
select one comment from the list, it will be highlighted in 2D and 3D view as can be
seen in the following two images.

To add a new comment placement, first press the button and afterwards click on the desired location on the
terrain in 2D or 3D view. To remove an existing comment placement, first select it from the <Comments> list
within the tool window and afterwards press the button. To edit an existing comment placement, simply
double click on it within the <Comments> list or directly in 2D or 3D view. A double click on a comment in the list
will additionally bring the selected comment into view in 2D and 3D view. When adding or editing a comment
placement, the following dialog will open.
First you have to specify a meaningful <Title> for the comment
placements. Every comment placement has a numeric <Priority> in
the range from 1 to 10. If you use the comment placement to high­
light terrain locations where additional mapping work has to be
done, you can give the most important placements a high priority
value. The <Author> field is always initialized with the login name of
the current user, but of course it is a simple text field and can be ed­
ited. The <Date> field is initialized with the current date time when
the comment was created. You can enter any kind of text here. To
insert the current date and time simple press the button right to the
text field.
The comment itself is inserted into the large text field <Comment
text> at the bottom of the dialog.
Information With the Standard and Community Edition of PnP
TerrainCreator only one comment placement can be
created per sector.

10
3 Heightmap Editing

Generally speaking there are two different ways of how to create heightmaps with PnP TerrainCreator. You can
create everything manually to get exactly the heightmap you want to (see 3.1) or you can let PnP TerrainCreator
automatically create a heightmap for you (see 3.3).

3.1 Manual Heightmap Editing


The process of manual heightmap creation is separated into two major steps. First you create a low resolution
definition map where you have to define the gross shape of your terrain (see 3.1.1). Afterwards you will model
the heightmap for each terrain sector in more detail in 2d (see 3.1.2) and 3d (see 3.1.3).
The manual heightmap editing mode is activated by default when you start the PnP TerrainCreator. You can
switch to the heightmap editing mode by one of the following ways:

• Click the icon on the toolbar.


• Select the menu <View, Heightmap editing>
• Use the keyboard shortcut <Alt> + <H>

3.1.1 Definition Heightmap Editing


The gross shape of a terrain can be defined using the definition heightmap. When you
move the mouse cursor over the definition map the cursor will change its shape to a
cross . The tool window <Info> will display some information about the heightmap
element at the center of the cross.
The height of this heightmap element can be raised using the <cursor-up> and lowered using the <cursor-
down> keys. With every keystroke the height will be raised/lowered by 5 meters. Holding down the <Shift>
key at the same time will raise/lower the terrain by 50 meters, holding down the <Ctrl> key by 1 meter. Al­
ternatively you can edit the terrain heightmap using the mouse buttons. Right to the viewport you can see
the mouse tool selection as shown in the image to the right. The currently activated tool is highlighted in
green. The first tool is the selection tool. Use this tool to open a sector for detail editing as described in
section 3.1.2. The second tool is used for raising the terrain. Holding down the left mouse button, you
can raise the terrain below the mouse cursor. Every click or mouse movement raises the terrain by 0.5
meters. If you hold down the <Shift> key while raising the terrain this way, it will change its height by 5
meters, holding down the <Ctrl> key, it will raise by 0.1 meters. The third tool works in the same way as
the second, but instead lowers the terrain. The fourth tool will be described below.
Heightmap manipulations will not only affect the heightmap element at the cursor position but also the surround­
ing heightmap elements even across the sector’s borders. The way by which the surrounding elements are af­
fected can be defined using the <Heightmap editing> tool window described in the following subsection.
To level an area of terrain elements to one height simply hold down the <L> key and move the mouse over the
terrain. All heightmap elements will be set to the height of the heightmap element where the <L> key was
pressed. For performing this leveling operation with the left mouse button instead, select the fourth mouse tool
button .
The following figures illustrate the raising of a terrain element and the subsequent leveling of a ridge to the same
height.

11
3.1.1.1 Parameters for Heightmap Editing
Within the <Heightmap Editing> tool window all parameters that affect the way by which
the heightmap is manipulated can be set. First one has to select the <Tool size>. The
shape of the tool can be either a circle or a rectangle.
Using the buttons below the tool size, the Falloff Effect used for the heightmap manipulations can be selected.
Falloff Effects are added to the application by PlugIns. They implement the method by which the heightmap ele­
ments within and around the brush are affected by the user's heightmap manipulations. The parameters to be
set for the different Falloff Effects and their detailed functioning are described in 3.2.
The check box <Update textures> is activated in 3D view mode as soon as surface texturing is enabled/activ­
ated. Checking this check box makes PnP TerrainCreator test the textures of all heightmap elements affected
by the heightmap changes against the applied texture settings (see section 5.4). Whenever the new height/slope
of a changed heightmap element violates these settings an appropriate texture will automatically be set for this
element if available.

3.1.2 2D Sector Detail Heightmap Editing


After opening a sector’s detail you can edit its heightmap in the same way as you edit the definition map (see
3.1.1). Raising and lowering can be done with the <cursor-up> and <cursor-down> keys. The height by which
the terrain is raised/lowered per keystroke is less than for the definition map editing. Without any function key
held down the terrain is raised/lowered by 1 meter. With the <Shift> key held down by 10 meters and with the
<Ctrl> key by 0.5 meters. The leveling functionality (key <L> or mouse tool) is also available. Alternatively you
can again use the mouse button to edit the terrain exactly as described above.

3.1.3 3D Sector Detail Heightmap Editing


The best control and the best visual feedback for the heightmap editing can be achieved using the 3d edit mode.
When moving the mouse over the terrain a red poly line will visualize the working area of the current <Tool
size>. The center of this tool – the terrain vertex closest to the mouse cursor – will be highlighted by a red box.
Activate the mouse tool to raise and lower the terrain by dragging a selected terrain vertex by holding down
the left mouse button and moving the mouse up and down. The terrain vertices within the tool radius will follow
these movements and the terrain vertices outside it will be adapted according to the settings of the used Falloff
Effect (see 3.1.1 and 3.2). When using the right mouse button only the height of the selected terrain vertex will
be changed but all surrounding vertices remain unchanged. The following 3 figures illustrate these 2 edit modes.

Using the mouse tool or holding down the <L> key, you can level the terrain surface below the mouse.

12
3.1.3.1 Holes in the Terrain Surface

It is possible to remove single heightmap elements (quads) from the


terrain surface. When holding down the <V> key, the red heightmap
selection tool will vanish and a blue selection tool with the size of just
one terrain quad will show up. When click with the left mouse button
while holding down <V>, the terrain quad below the mouse will disap­
pear. The terrain quad can be made visible again in the same way.

3.2 Falloff Effect PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the Falloff Effect PlugIns that were shipped with the PnP TerrainCreator will
be described in more detail. Remember: If you use 3rd party or your own PlugIns they could behave in very differ­
ent ways than described here. So please refer to the documentation of the used PlugIn, if available.

13
3.2.1 Step Falloff Effect (PnPTC)
The Step Falloff Effect is the simplest possible heightmap editing mode. This effect only affects the heightmap
elements within the brush. All heightmap elements outside the brush are not affected and
therefore a step between the brush and its surrounding will arise. This effect can be activ­
ated by pressing the button.
The Step Falloff Effect has only one parameter that can be set within its settings window.
The <Preserve form> parameter controls how the elements within the brush are affected
when the terrain is raised/lowered. If this option is activated, all elements within the brush will be raised/lowered
by the same value and therefore the heightmap will preserve its shape. If it is no activated, all elements within
the brush will be set to the same height. The following figures illustrate these two editing modes.

3.2.2 Gradient Falloff Effect (PnPTC)


The Gradient Falloff Effect extends the Step Falloff Effect (3.2.1) by affecting the height­
map elements outside the brush to create a uniform gradient. The effect can be activated
by pressing the button. The image on the effect's settings window illustrates the func­
tioning of the effect.
The effect has two additional parameters. The
parameter <Max. gradient> sets the maximum
gradient in degrees outside the brush. The para­
meter <Workspace size> sets the maximum dis­
tance to the brush's center until which the
heightmap elements are afftected by this Falloff
Effect. The following figure illustrates the result
of this Falloff Effect.

14
3.2.3 Smooth Falloff Effect (PnPTC)
The Smooth Falloff Effect is an extension to the Gradient Falloff Effect (3.2.2). It can be
activated by pressing the button and adds one more parameter to the settings win­
dow. The <Transition size> defines the size of an area in which the maximum gradient is
smoothly increased from 0 to the value set by the <Max. gradient> parameter. The follow­
ing figure illustrates the result of this Falloff Effect.

3.3 Automated Heightmap Generation


Besides the manual heightmap editing mode, the complete terrain heightmap can be
automatically created. The automated generation facility is provided through generator
PlugIns. The default heightmap generator PlugIn for a terrain can be set in the terrain
properties dialog. Open this dialog from the menu <File, Terrain properties>. Select
the PlugIn you want to use by default from the combo box <Heightmap> within the
frame <Default generator PlugIns>.

By pressing the
<Generator set­
tings> button, a
second dialog
will open in which the parameters for the
automated generation can be set. How the
settings have to be applied will be de­
scribed in the following sub section 3.3.1.
After all parameters have been set, the ter­
rain can be auto­
matically created
by selection the
menu <File,
Automated terrain generation>. The following dialog <Random terrain generation> will
open.
First select the generator PlugIn you want to use for the heightmap generation from
the combo box within the <Heighmap genera­
tion> frame. When the dialog opens, the ter­
rain’s default generator PlugIn will be selected.
Mark the check box <Create heightmap> to
create the terrain heightmap with the selected
generator.
If you want the sector details to be created together with the definition
maps, additionally mark the check box <Create sector detail>.
Press the button <Generate Terrain>, to start the automated terrain gen­
eration process. The dialog will close as soon as the generation process
finishes.

15
3.3.1 Parameter Settings for Terrain Generation
When opening the parameter settings dialog for automated terrain generation you first have to choose the
<Generator PlugIn> whose parameters you would like to set. The current parameters of the selected generator
PlugIn will be displayed within the <Parameters> frame. You have to check the <Apply parameters> check box
for the PlugIn first in order to set its parameters. If this check box is unchecked the parameter settings will be
discarded and the dialog is deactivated.

These generator settings can be applied for the whole terrain as described in the pre­
vious section but it is also possible to set the generator parameters for a single sec­
tor. Just open the sector’s context menu from 2D the terrain definition map by right
clicking with the mouse on the sector which’s parameters you would like to set and
select <Settings for automated generation…> from it. The same dialog as described
before will open.
When the generator PlugIn creates the heightmap it will first search for sector specific parameters and will only
fall back to the parameters defined for the whole terrain if the sector’s parameters are not set.

3.3.2 Generation of a single Sector

Of course it is not necessary to recreate a whole terrain when only the parameters of
a single sector have to be changed. Click with the right mouse button on the sector to
be recreated within the 2D terrain definition map, to open the sector’s context menu.
Then select <Automated sector generation> from the menu. The dialog <Random ter­
rain generation> will open which we have already described in section 3.3.

3.4 Heightmap Generator PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the heightmap generator PlugIns that were shipped with the PnP TerrainCre­
ator will be described in more detail. Remember: If you use 3 rd party or your own PlugIns they could behave in
very different ways than described here. So please refer to the documentation of the used PlugIn, if available.

3.4.1 Diamond Square (PnPTC)


This PlugIn implements the well-known diamond square terrain creation algorithm. The diamond square al­
gorithm is a fractal generator using midpoint displacement. We will only give a brief description of it here. The al­
gorithm executes 2 different steps iteratively until the whole heightmap is set:
The diamond step: Taking a square of four points, generate a random value at the square midpoint, where
the two diagonals meet. The midpoint value is calculated by averaging the four corner values, plus a random
amount. This gives you diamonds when you have multiple squares arranged in a grid.
The square step: Taking each diamond of four points, generate a random value at the center of the dia­
mond. Calculate the midpoint value by averaging the corner values, plus a random amount generated in the
same range as used for the diamond step. This gives you squares again.
The following figure illustrates these two steps.

16
Now we will describe the parameters for this heightmap generator:
First you have to set the <minimum height> and <maximum
height> of the terrain or sector to be created. The initial bor­
der point heights will be set randomly within this range. All
other heights created during the plugin’s work will be capped
to these values too.
Next the <Random value range> has to be set. This is the
maximum displacement value for the first diamond step of
the algorithm. The displacement value will be created ran­
domly within the range of –20 to 20 for the settings of the
image to the left.
The <Random value range> will decrease with every step of the algorithm. The <Roughness> parameter sets
the “speed” by which the random range will decrease. A roughness of 20% means that the next step will have
20% of the random value range of the previous step. Using the settings of the image, the second diamond step
will have a random value range of 4. The higher this value is set the rougher the terrain will be.

17
4 Heightmap Filter Functions

One of the key features enabling efficient terrain creation are filter functions that can manipulate larger terrain
areas with only very few user interactions.
To apply filter functions to your terrain you have to open a sector’s detail map first. Filter functions can be ap­
plied in 2D and 3D view on the definition as well as the sector detail maps. You can switch to the filter functions
edit mode by one of the following ways:

• Click the icon on the toolbar.


• Select the menu <View, Heightmap filtering>.
• Use the keyboard shortcut <Alt> + <F>.

A new tool window <Filtering> will open where you can select the filter to be used and
apply the necessary settings for this filter. First you have to set the <Filter region>. This
is the radius of heightmap elements which will be affected by one usage of the filter.
The region will be used by all filters in the same way. Next you can select the desired fil­
ter from the drop-down-list. The input controls below the drop-down-list specify the set­
tings of the selected filters. They will be described in section 4.2.
The check box <Update textures> is activated in 3D view mode as soon as surface texturing is enabled/activ­
ated. Checking this check box makes PnP TerrainCreator test the textures of all heightmap elements affected
by the heightmap changes against the applied texture settings (see section 5.4). Whenever the new height/slope
of a changed heightmap element violates these settings an appropriate texture will automatically be set for this
element if available.

4.1 Applying the Heightmap Filter


As you move the mouse over the terrain the filter region will be visualized by a red circle borderline, as you can
see in the picture above. The heightmap elements within this circle will be affected by the filter function. Pressing
the left or right mouse button will apply the filter. A single click with the mouse will apply the filter one time. But it
is possible as well to keep the mouse button pressed and move the mouse over the terrain. Doing this the filter
will be applied to the terrain with every movement of the mouse resp. of the filter region. The filter functions are
activated if the mouse tool is selected. The mouse tool can be used to level the terrain as described in
section 3.1.

18
4.1.1 Applying to a whole Sector
By pressing the <Apply to whole Sector> button within the filter tool window the currently selected filter we be ap­
plied to all heightmap elements of the sector. Depending on the filter function this application may take quite a
long time.

4.2 Heightmap Filter PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the heightmap filter PlugIns that were shipped with the PnP TerrainCreator
will be described in more detail. Remember: If you use 3rd party or your own PlugIns they could behave in very
different ways than described here. So please refer to the documentation of the used PlugIn, if available.

4.2.1 Average (PnPTC)


With the Average filter it is possible to make the terrain smoother or remove sharp steps from it. The filter will go
through every element of the affected region using a so called filter mask, compute the average (mean) of all
heightmap elements around and set this average as new heightmap value at the current
position.
This filter needs an additional parameter, the <Filter Mask Size>. With this parameter
you can set the border size of a rectangle over which the average around one height­
map element will be computed. The larger this value is set the smoother the result of
this filter application will be.

Example After creating a plateau with the Flatten filter for example (left image), you might want to remove
(smoothen) the sharp steps that where arisen around this plateau. The middle image illustrates
one single application of the Average filter to this step with a filter mask size of 3. For the right im­
age we used a filter mask size of 8.

4.2.2 Flatten (PnPTC)


The Flatten filter is a very simple filter function. It will take the height at the center of the filter region and set all
other heightmap elements within this region to the same value. This filter does not need any additional paramet­
ers to be set.

4.2.3 Gaussian Noise (PnPTC)


As opposite to the Average filter the Gaussian Noise filter will make the terrain rougher. Using this filter you can
bring some natural noise to homogenous terrain areas.
The control parameter to be set for this filter function is the <Half value width> of the
gaussian distribution. The larger you set this value the rougher the result of this filter will
be.

19
Example The following images will illustrate the effects of different half value widths on an homogeneous
(left image) terrain surface. The middle image shows little roughness with an half value width of
50 and the right image shows heavy roughness with an half value width of 150.

A second parameter that can be set is the Averaged flag. Usually a gaussian distribution of a terrain height dis­
placement will not look very natural. The following image will illustrate the result of this filter without the Average
flag been set. When the Average flag is set the gaussian displacement values will be averaged (in the same way
as it is done by the Average filter with a filter mask size of 3) before they are added to the terrain heightmap so
they look more natural.

4.2.4 Median (PnPTC)


The median filter is an edge and form preserving smoothning filter. The filter will go through every element of the
affected region using a so called filter mask, and order all elements within this mask by their height. The middle
element of this sorted list will be set as new heightmap value at the current position.
This filter needs an additional parameter, the <Filter Mask Size>. With this parameter you
can set the border size of a rectangle over which the median around one heightmap ele­
ment will be computed. The larger this value is set the smoother the result of this filter ap­
plication will be.

Example The following images will illustrate the Median filter applied to a step after the creation of a plat­
eau. The middle image illustrates one single application of the Median filter to this step with a filter
mask size of 3. For the right image we used a filter mask size of 9. You can see, that the noise of
the surface and the “frayed” corner is smoothed but the step is preserved. Please compare these
results with those of the Average filter in 4.2.1.

20
4.2.5 Raise/Drop (PnPTC)
The Raise/Drop filter can be used to raise and drop the heightmap efficiently from within the filtering edit mode
without the need to switch to the heightmap edit mode. While moving the filter region over the terrain all height­
map elements within this region will be raised/dropped by a constant value. Pressing the left mouse button will
raise the terrain pressing the right mouse button will drop it.
The parameter <Raise value> sets the height in cm by which the terrain is
raised/dropped with every filter application
When the Average flag is set the displaced heightmap will be averaged (in the same
way as it is done by the Average filter with a filter mask size of 3) in a subsequent step
within the same filter region.

Example The following images will illustrate the raising of a small ridge with and without subsequent aver­
aging.

21
5 Surface Texturing

The following sub sections will describe PnP TerrainCreator’s capabilities for terrain texturing.

5.1 Terrain Texturing Basics


We will here describe briefly the way by which PnP TerrainCreator renders textured terrains. We will focus on
the blended texturing mode with lightmap overlay. The blended texturing mode is based on a technique known
as splatting (described by Charles Bloom here http://cbloom.com/3d/techdocs/splatting.txt), but slightly modified.
First of all it has to be noticed, that a terrain sector is divided into smaller patches of a border size of 128, so
129x129 vertices. These patches are important not only for scene management and culling but also for overlay
textures. The texture files created for the lightmaps (see section 5.6) and texturemaps (see section 5.5.3) heav­
ily depend on the size resp. the texture coordinates of the underlaying patch.
But now back to the blended texturing: Please take a look at the left picture below. You can see a small part of a
terrain with two different textures. There are terrain quads rendered with a grass texture and other quads
renderd with a dirt texture. As we don't want to manually create transition textures between all possible textures
for all possible directions, the interesting terrain quads of the rendering process are those, building the transition
between two textures. We want the rendering process to automatically create a smooth transition between tex­
tures. Therefore PnP TerrainCreator renders in a first rendering pass the background for the transition quads by
using an untextured color blend. The vertex colors used for this pass are taken from the 1x1 mip map of the cor­
responding textures.
In a second render pass the textures are rendered. The terrain quads without a texture transition are rendered
completely opaque. The quads with a texture transition are rendered with an alpha fade from completely opaque
to completely transparent, achieving a rendering result as can be seen in the middle figure.
If you would leave out the first color rendering pass, the result would be something like that of the right figure.
You will have a region in the middle of the blend which is not completely opaque, where you can see the back­
ground (the blue sky) shining through.

The lightmap is simply used as a second texture within the rendering passes, which modulates the resulting
pixel colors.

5.2 Initialization of Texture Manager


The loading and managing of textures is implemen­
ted using PlugIns. In this way experienced users can
easily add their own PlugIns to support own file
formats in PnP TerrainCreator. Before you can apply
textures to your terrain you will have to select the
PlugIn managing your textures. You can select this
PlugIn when you create a new terrain or via the menu
<File, Terrain properties> for an already existing ter­
rain.
The “File based Textures (PnPTC)” PlugIn selected
in the right image is the default texture manager
PlugIn of PnP TerrainCreator. It is described in more
detail in 5.7.1. There is another global parameter, which can be set for texture manager PlugIns: The location of

22
the texture files <Texture location>. The setting “Project directory” specifies that the texture files are stored be­
low the terrain project directory in the “Textures” subdirectory. The actual path to be used is shown in the <Tex­
ture directory> field. A second possible value is “Application directory”, which specifies the “Data\Textures” dir­
ectory below the installation directory of PnP TerrainCreator as source path for the texture files. Finally one can
select “User defined directory”, which enables the possibility to select any arbitrary directory by clicking the <...>
button behind the <Texture directory> text field.
If all settings have been applied you can open PnP TerrainCreator’s texture manager with the menu <PlugIns,
Textures> from the program's main screen. In the following window you can view the textures managed by this
PlugIn and apply some basic settings to them.
All textures are grouped by the PlugIn into categories and sub categories. This categories are visualized with the
folders in the <Textures> tree view. By pressing the right in front of a category folder you can open this cat­
egory an get access to its sub categories and
textures.
You can select one texture by clicking with
the left mouse button on its name within the
<Textures> tree view. The selected texture
will be highlighted and a preview of it will be
displayed in the lower left corner of this win­
dow. The tab control on the right will display
the basic settings of this texture on the
<Base texture data> tab.
In the text field <Label> you can set the
name to be
displayed
for this tex­
ture. The
text field <Name / ID> is for informational issues. It displays the internal ID of
this texture for the texture manager PlugIn.
Textures that had been defined previously but are no longer available – for ex­
ample because of a deleted bitmap file – will be highlighted by the icon
within the <Textures> tree view. You can remove such missing textures from
the list by pressing the <Remove unused texture> button which will appear as
soon as you select a missing texture from the <Textures> tree view.
The tab <Automated Texturing Parameters> will be described in detail in chapter 5.4. The <Ground Sounds> tab
will be described in detail in chapter 9.1. On the <Comments> tab a single textual comment for the texture can
be defined. In that comment field you can enter values which can be exported and later on used within the tar­
get/game engine. On the <User defined data> tab, predefined data elements can be set for this texture, which
can also be exported and used in the target engine. User defined data definition and editing is described in
chapter 11.1.
When you made changes to the texture sources (new/changed/deleted texture files) you can reload all surface
textures by pressing the <Reload> button.

Information All texture information is stored in the file “textures.ttex” in the root directory of your terrain. You
can simply copy and paste this file to other terrain projects if you want to reuse your settings.

5.3 Manual Terrain Texturing


To manually apply terrain surface textures you have to open a sector’s detail map first. Surface textures can only
be applied in 3D view, so you have to activate it and then switch to the texturing edit mode by one of the follow­
ing ways:

• Click the icon on the toolbar.


• Select the menu <View, Texturing>
• Use the keyboard shortcut <Alt> + <T>

23
A new tool window <Texturing> will open where you can se­
lect the texture to be used and apply all necessary settings for
the manual terrain texturing. First you have to set the <Tool
size>. This is the radius of heightmap elements which will be
set with the new texture.
The <Coverage> parameter determines the percentage of
heightmap elements within the tool that will be textured. If you set this parameter to a value
below 100, some randomly selected elements within the brush will not be textured.
Next you can select the desired texture from the drop-down-lists. The textures in these
lists are organized by their categories using a tree view similar to that of the texture man­
ager described in 5.2. You can only select “real” textures but no categories within this list.
To enable faster switching between frequently used textures it is possible to select up to 6
different textures at the same time. The option buttons <1> to <6> in front of the drop-
down-lists determine which one of these textures will be used for the surface texturing. You can select one of
them by clicking the option button with the mouse or using the keyboard shortcuts <Alt> + <1> to <Alt> + <6>.
The currently selected texture will be visualized at the bottom of the texturing tool window.
To initially texture a whole sector you can do this by clicking the <Auto Texturing> button. The dialog appearing
will be described in 5.4.2.
To apply a selected texture to the terrain surface simply move the mouse over the 3d terrain. Around the current
mouse position the tool with the given <Tool size> will be highlighted with a red line. All terrain heightmap ele­
ments within this tool will be affected by the texturing. When clicking the left mouse button the currently selected
texture will be applied to this tool area. You can hold the left mouse button down while moving the mouse over
the terrain surface to apply the texture to a larger terrain area like you were moving a paint brush over a piece of
paper.

Alternatively you can click with the right mouse button on a terrain heightmap element to apply the currently se­
lected texture not to the whole tool area but just to the heightmap element hit by the mouse click.

24
5.3.1 Texture picking

As alternative to selecting the desired texture from the drop down


tree list, one can also pick a texture from the already textured terrain
surface. By holding down the <P> key or by pressing the button
within the <Texturing> tool window, the tool visualization in 3D view
will change from red to blue and change its size to one, as can be
seen in the image to the right. Now simply click with the left mouse
button on a textured terrain surface within the 3D view. The texture
at that terrain position will automatically be selected for texturing.

5.4 Automated / Randomized Terrain Texturing


To efficiently and naturally texture a terrain, PnP TerrainCreator’s has a built in automated/randomized texturing
functionality. It can texture the terrain based on height and slope values of the terrain surface and based on
probabilities of textures. The following two sub sections describe the texturing definitions and the texturing pro­
cess in detail.
(The automated texturing is currently implemented directly within the main program. Future versions will imple­
ment it as PlugIns)

25
5.4.1 Automated Texturing Definitions
Within the Texture Manager (see section 5.2) you
can set the <Slope> and <Height> range in which a
texture can be applied for every single texture or tex­
ture category on the <Automated texturing paramet­
ers> tab. In order to apply these settings, the check
box <Apply random parameters> has to be checked.
If you apply parameters for a category and for single
textures within this category too, the parameters of
the texture have higher priority than the parameters
of the category. If you only set the parameters for a
category and not for the textures within the category,
the parameters of the category will be applied for all
textures within this category.

Information The automated texturing can only works, if you have at least activated the random parameters for
one texture or one texture category. If you haven't activated any texture, the automated texturing
can not apply any textures to the terrain.

5.4.2 Sector Texturing


After the texturing parameters have been set, we can now
start to texture the terrain. Therefore you have to open a ter­
rain sector in 3D mode and switch to the texturing edit mode.
Press the <Auto texturing> button within the <Texturing> tool
window and the following dialog will come up. On the left
side of this dialog you can set the probabilities of all available
textures. The probability in percentage defines how likely a
texture will be randomly selected and applied to the sector.
On the right side of the dialog parameters for the automated
texturing can be set. The only parameter to be set there is
the <Max. blot size>. The terrain is textured with small blots
of one texture. And this parameter defines how large such a
blot maximally can be.
Clicking <OK> will store the probability settings and start the automated sector texturing.

5.5 Texturing Modes


PnP TerrainCreator supports three different modes for terrain texturing. The texture mode can be set within the
3D view settings dialog, described in section 2.4.1. Within the <Texturing Mode> you can switch between <no
blending> (section 5.5.1), <linear blend> (section 5.5.2) and <texturemap> (section 5.5.3).

26
5.5.1 Non Blended Texturing
This is the simplest texturing mode supported by PnP TerrainCreator. Every quad of the
heightmap is rendered with exactly one texture. If two neighboring quads have different tex­
tures, there will be a sharp transition between them as can be seen in the following figure.

5.5.2 Linear Blended Texturing


The linear blending mode is the more natural texturing mode. Different textures of neighbor­
ing terrain quads are faded smoothly into one another. The figure to the right shows such a
faded transition. This texture mode is implemented in the same way as described in section
5.1.
Some things, when manually texturing the terrain are a bit special for this blending mode. We
will describe them in the following sub sections.
5.5.2.1 Heightmap elements affected by manual texturing
Take a look at the following 5 figures. When applying a grass texture to the center quad of the first figure in lin­
ear blending mode, you will get the result from the second figure. When switching back to no blended texturing
mode, one can see that four quads have been textured with grass. This means, the texture applied to one quad
is associated with the bottom left (south/west) vertex of the quad. So when texturing one quad in blended mode
all four vertices of that quad have to be textured and therefore the surrounding three quads have to be textured
too.
When applying a texture to one quad using the right mouse button in blended mode, the texture will only be as­
signed to that single quad and therefore only to the bottom left vertex as can be seen in the fourth and fifth fig­
ure.

5.5.2.2 Flipping of triangle orientation within one terrain quad


As the terrain quads have to be rendered with triangles, there are always to possibilities of
how to devide the quad into two triangles (see the figure to the right). The way by which it is
devided affects the shape of the terrain and the texture blending as well.
Let's take a look at the center quad of the following two figures. Within the left figure, the
quad is devided by a diagonal from the top left to the bottom right into two triangles. Within the right figure, the
quad is devided by diagonal from the bottom left to the top right.

27
You can change the orientation of the diagonal of a single quad by holding down the <F> key on the keyboard
and afterwards clicking with the left mouse on the quad you want to flip.

28
5.5.3 Texturemap
The texturemap texturing mode overlays one patch (see 5.1) with one single texture like
that you can see at the right. The texturemap is created automatically by combining the
detail textures into one single texture.
The parameter <Texturemap pix. per. el.> of the <3D view settings> dialog (see section
2.4.1) determines how many pixels per heightmap element (terrain quad) will be created.
So when using 2 pixels per element you get a texture of the size 256x256 for each patch.

Information This texturing mode looks best, if it is overlayed with a noise texture (see
2.4.1). Below you can see a scene rendered with a texturmap without overlay (left) and with an
overlay noise texture of size 16 (right).

5.6 Lightmaps and Dynamic Lighting


PnP TerrainCreator supports two different lighting modes for the terrain surface, dy­
namic and precomputed lighting. When the 3D view mode is activated the tool window
<Lighting> is visible, in which one can select between the dynamic and the precomup­
ted lightmap based lighting mode. Both lighting modes are described in more detail
within the following sub sections.

5.6.1 Dynamic Lighting


The default method for terrain lighting is the dynamic lighting. This is based on the usual 3D shading mode
which computes the light, falling on a surface, by the angle of its surface normal to the direction of light. The ad­
vantage of this lightning mode is, that it does not need any precomputions except for the normals, but the disad­
vantage is that it can not efficiently render terrain self shadowing.
Within the environment simulation (2.4.4) you can set the lighting direction and color which you can define within
the 3D settings (2.4.1). The light for this lighting mode has to be turned on within the 3D settings (2.4.1) or by
pressing the <L> key.

5.6.2 Lightmaps
The lightmaps are precomputed textures which are laid over your terrain (see section 5.1). If <Lightmap> is se­
lected in the <Lighting> tool window, one can choose between an arbitrary number (limited to 3 for the Com­
munity Edition) of lightmap definitions from the drop down list. The selected lightmap definition will be used for
the terrain rendering. The lighting of static objects and trees will be done by standard surface normal based light­
ing using the light source definitions of the activated lightmap. You have to turn on the lights to allow object/tree
lighting within the 3D settings (2.4.1) or by pressing the <L> key.
5.6.2.1 Lightmap Definitions
The computation of the lightmaps is based on the position and the color of the sun and moon. These definitions
can be set in a separate dialog that opens, if you press the <...> button of the <Lighting> tool window.

29
You can create an arbitrary number of lightmap
definitions for different lighting situations. On the
left side of the <Lightmap definitions> dialog you
can see a list <Lightmaps> with all lightmap
definitions so far created. You can create a new
lightmap definition by pressing the button and
delete the currently selected lightmap definition
by pressing the button. The parameters of the
currently selected lightmap are displayed within
the right <Lightmap definition> frame of the dia­
log.
First of all every lightmap definition has to have
an unique name, that can be set in the <Name>
text box. Next you have to chose which light­
sources are active for that lightmap definition, by
checking the checkboxes <activate sun light>
and <activate moon light>. For every of the two
light sources, you can set the <Light color> and
the <Ambient color>. The light color is used for
all terrain elements that have direct sight to the
light source and the ambient color is used for all
terrain elements that don't have a direct sight
(slightly simplified).
At least you have to set the position of the light source, by either setting the angles directly in the corresponding
text fields (<RA> and <Dec>) or by positioning the yellow circle at the desired light position with the left mouse
button. <RA> stands for right ascension and means the east-west position of the light source, while <Dec>
stands for declination and means the north-south position of the light source.

Information If you create a lightmap using terrain self shadowing (see below) the terrain in the shadow of a hill
will be lit by the ambient light color only. Therefore the shape of the terrain might not be visible.
We suggest to always use a second light source with a dark light color at the position 0 RA and 0
Dec to shade these regions at least a little.
Information All lightmap definitions are stored in the file “textures.ttex” in the root directory of your terrain. You
can simply copy and paste this file to other terrain projects if you want to reuse your settings.

5.6.2.2 Lightmap Creation


After the lightmap definition has been created, you can compute the light­
map for a terrain sector. Select the lightmap to be computed from the drop
down list of the <Lighting> tool window and press the <(Re)compute> but­
ton. The following dialog will come up, in which you can set additional para­
meters for the lightmap creation.
First of all you have to set the resolution of the lightmap, by selecting the number of <Pixels per element> from
the drop down list. A value of 2 means, that for every heightmap quad, 2x2 pixels within the lightmap textures
will be created, so for 128x128 heightmap elements of one terrain patch, you get a 256x256 texture. Next you
can set whether or not the lightmap texture should be blurred. The <Blur size> is the size of the filter kernel for a
gaussian blur. It is recommended to blur the lightmap to achieve natural shadows. Whether or not the terrain
casts shadows on itself can be activated with the <Terrain self shadowing> check box. Whether or not static ob­
ject and tree placements can cast shadows onto the terrain can be activated with the <Static object shadowing>
and <Tree shadowing> check boxes.
Information Texture size and self shadowing heavily affects the time required to create the lightmaps. De­
pending on the shape of the terrain and the light angle, the computation of the terrain self shadow­
ing can take several minutes. We strongly recommend to first test the light direction on a small
lightmap without self shadowing and create the self shadowed lightmap as finishing step of your
terrain creation process, when the shape of the terrain no longer changes.
Information To ensure a steady transition without visual artifacts, use the same texture and blur size for all
lightmaps of all sectors you create.

30
5.7 Texture Manager PlugIns shipped with PnP TerrainCreator
Within the following sub section(s) the texture manager PlugIns that were shipped with the PnP TerrainCreator
will be described in more detail. Remember: If you use 3rd party or your own PlugIns they could behave in very
different ways than described here. So please refer to the documentation of the used PlugIn, if available.

5.7.1 File based Textures (PnPTC)


This is the default texture manager PlugIn for the PnP TerrainCreator. With this PlugIn you can use every bit­
map file format supported by DirectX (.bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm and .tga) as terrain surface
texture. Place the bitmap files you want to use into the “TEXTURES” folder below your terrain project’s main dir­
ectory. Creating subdirectories below the “TEXTURES” directory will enable the categorization of textures. You
can create an arbitrary number of categories and an arbitrary number of sub categories.

The PlugIn will scan all the contents of the following folders:
• “TEXTURES”
• “TEXTURES\<category>”
• “TEXTURES\<category>\<subcategory>\...”

Example To use a file “ROCK_RED_00.BMP” as a texture of the category “ROCKS” and the sub category
“RED” you have to place the file in the following folder:
“TEXTURES\ROCK\RED\ROCK_RED_00.BMP”
Information All texture files must have different names, as the file name is the main identifier of a texture. So
make sure that there are no duplicated file names in the different sub folders. The PlugIn will dis­
play a warning message at load time if there are duplicated texture file names.
Information All textures must at least have one main category. So it is recommended to create at least one
subdirectory below the “TEXTURES” directory. Don’t place any texture files directly within the
“TEXTURES” directory. If you place textures directly within the "TEXTURES" directory, they will by
default be given the category name "default category".

5.8 Texturing PlugIns shipped with PnP TerrainCreator


Coming soon.

31
6 Oceans, Seas and Rivers

We will differentiate between three different types of water definition and editing within PnP TerrainCreator. First
we have the ground water level, which is described in section 6.1. Next local seas or lakes can be defined as de­
scribed in section 6.2. Finally floating water – rivers – can be specified too (section 6.3).
All this functionality is available from within the water edit mode. One can switch into this edit mode by one of the
following ways:

• Click the icon on the toolbar.


• Select the menu <View, Water>.
• Use the keyboard shortcut <Alt> + <W>.

6.1 Ground Water Level


The basic water definition for a terrain is the ground water level. The ground water level defines a plane below
which the terrain will be flooded. This can be used to define the ocean which surrounds an island as well as to
define lakes at this level inside your terrain. But before we can set the ground water level for a terrain, we have
to define water types.

6.1.1 Types of Water


After switching into the water edit mode as described before, the <Water editing> tool
window will become visible. Pressing the <Settings> button in that tool window, the
<Water definitions> dialog will show up in which we can define several different types of
water. In this dialog an arbitrary number of water definitions can be specified. A water
definition determines how the water areas are displayed in 2D and 3D view.
By pressing the button, a new water definition can be created.
A list of all water definitions create so far is displayed in the
<Water definitions> list. The currently selected water definition
in the list can be deleted by pressing the button. After creating
a new water definition, one first has to set a name for it in the
<Name> text field. In 2D display mode, the water is visualized
as an uniformly colored area. The color of this area can be set
with the <2D water color> color selector. In 3D view, the water
is visualized as a plane going through the whole terrain at a
constant height. The color of this plane can be set with the <3D
vertex water color> color selector. This plane is not necessarily
completely opaque. The transparency of this plane can be con­
trolled by the <Vertex alpha> value, where a 0 means com­
pletely transparent and 1 completely opaque. Every value in
between is possible too, of course.
Additionally, one can specify a texture which is used to render the water surface in 3D from the <Texture> drop
down list. There a two predefined values in this list <(no texture)>, meaning the water surface is just rendered
with the color specified in the <3D vertex water color> color selector and <(default)>, which uses the built in de­
fault water texture. To add textures to that combo box, simply copy the desired texture files into the
“MISC_DATA\WATER” directory of your terrain project directory. All texture files located in that directory will be
shown in the combo box and are therefore usable as water surface textures. A preview of the currently selected
texture will be shown in the rectangular area below the combo box. Next one can activate the <Use texture al­
pha> check box, if the texture file contains a alpha channel, which should be used for rendering. The vertex al­
pha will be multiplied with the texture alpha when rendering. The same is true for the color channel, so when a
texture is used for rendering the water surface, it is in most cases a good choice to use white or a gray value for
the <3D vertex water color>.
Finally, one can set the size for the texture given in terrain elements in the <Texture size> drop down list. The
meaning of the values in this list is similar to the one for surface textures as has already been described in
2.4.1.2.

32
6.1.2 Ground Water Level of the whole Terrain
Within the <Water editing> one first has to select the water
definition which should be used for the terrain from the <Wa­
ter definition> drop down list. Next the level of the ground wa­
ter can be set manually or by means of the up/down buttons
in the <Water level> text field. The terrain areas which are
below this water level will be visualized in the color which was
specified in the water definition.

6.1.3 Ground Water Level of a single Sector


It is possible for a single sector to override the ground water level definition of the whole terrain. The ground wa­
ter level settings are basically the same as described before for the whole terrain, so we will not repeat them
here in detail. The ground water level definition for a single sector can be set in 2D and 3D view mode.
6.1.3.1 Sector Ground Water Level definition in 2D
By default, the globally defined ground wa­
ter level will be used for all sectors of a ter­
rain. So, if one changes the <Water defini­
tion> or the <Ground level> for a single
sector, these changes will affect all other
sectors too. However, if the check box
<Override terrain definition> is checked,
which is only visible if a sector's detail is
opened, these changes will only affect the
currently opened sector and not the whole
terrain or the surrounding sectors.

6.1.3.2 Sector Ground Water Level definition in 3D


The functionality for setting the ground water level in 3D is the same as already described for the 2D view. But in
3D view a simplification for specifying the ground water level is available. Simply click with the right mouse but­
ton at a position on the terrain, where you would like the ground water level to be and select <Set ground water
level> from the appearing context menu, as shown in the following figure.

33
6.2 Local Lakes
Coming soon.

6.3 Rivers
Coming soon.

34
7 Terrain Vegetation

A diversified vegetation is an important subject in creating realistic terrains. The following sub sections will de­
scribe PnP TerrainCreator’s capabilities to create vegetation with trees and grass on your terrain.

7.1 Initialization of the Vegetation Manager


The loading and managing of vegetation objects is implemented using PlugIns. In this way experienced users
can easily add their own PlugIns to support own file formats in PnP TerrainCreator. Before you can place trees
and grass on your terrain you will have to select the PlugIn managing these objects. You can select this PlugIn
when you create a new terrain or via the menu <File, Terrain properties> for an already existing terrain.
The “Vegetation Files (PnPTC)” PlugIn selected in
the image to the left is the default file based <Veget­
ation Manager> PlugIn of PnP TerrainCreator. It is
described in more detail in 7.5.1. There is another
global parameter, which can be set for vegetation
manager PlugIns: The location of the vegetation files
<Vegetation location>. The setting “Project directory”
specifies that the vegetation files are stored below
the terrain project directory in the “Vegetation” subdir­
ectory. The actual path to be used is shown in the
<Vegetation directory> field. A second possible value
is “Application directory”, which specifies the
“Data\Vegetation” directory below the installation dir­
ectory of PnP TerrainCreator as source path for the vegetation files. Finally one can select “User defined direct­
ory”, which enables the possibility to select any arbitrary directory by clicking the <...> button behind the <Veget­
ation directory> text field.

7.2 Placing Trees

7.2.1 The Tree Manager


After selecting the vegetation manager PlugIn, you can open PnP TerrainCreator’s tree manager with the menu
<PlugIns, Vegetation, Tree manager>. In the following window you can view the trees managed by this PlugIn
and apply some basic settings to them.
All trees are grouped by the PlugIn into
categories and sub categories. These
categories are visualized with the folders
in the <Trees> tree view. By pressing the
right in front of a category folder you
can open this category an get access to
its sub categories and trees.
You can select one tree by clicking with
the left mouse button on its name within
the <Trees> tree view. The selected tree
will be highlighted and a preview of it to­
gether with some rendering data will be
displayed in the lower right corner of this
window. You can zoom the preview in
and out by pressing the and
buttons.
In the text field <Label> you can set the name to be displayed for the selected tree. The text field <Name / ID> is
for informational issues. It displays the internal ID of this tree for the vegetation manager PlugIn. For the 2D dis­
play of the tree placements a color can be selected from the <2D display color> color selector. By assigning indi­
vidual colors to the trees, it is possible to distinguish between them in 2D view.
Trees that had been defined previously but are no longer available – for example because of a deleted tree file –
will be highlighted by the icon within the <Trees> tree view. You can remove such missing trees from the list

35
by pressing the <Remove unused tree> button which will appear as soon as you select a missing tree from the
<Trees> tree view. Pressing the <Remove all unused trees> button will remove all missing trees at once.
When you made changes to the tree sources (new/changed/deleted tree files) you can reload all trees by press­
ing the <Reload> button.
Some additional parameters have to be set to ensure a correct visualization of the trees. The first one is the <Up
rotation>. PnP TerrainCreator uses for its 3d scenes the y-axis as up-axis. If your tree models use the z-axis as
up-axis you have to rotate them about their x-axis in order to achieve the right tree orientation. Simply select a
rotation value from the combo box and check the result within the 3d preview.
The second parameter is a global scaling factor. All trees will be scaled by the factor given in <Scale factor>. To
determine whether or not a scaling factor is correct you can check the tree's <Height> in
meters. If you know the desired tree height you can enter it in the text field <Height> and com­
pute the appropriate scaling factor from it by clicking the <Set scale> button. With the context
menu, which will be opened after you clicked that button, one can decide if the scale factor should be used as
global scale or as scale factor for the currently selected tree instead. The default scale of a tree instance is
defined by multiplying the global scale <Scale factor> with the tree specific scale <Scale>.
Finally it might be necessary to flip the tree models along one axis if they are mirrored. This can be achieved by
selecting the appropriate flipping axis in the <Flip axis> drop down list.
The tabs <Ground shape settings> and <Ground texture settings> are used for the automated computation of
the vegetation distribution and will be described in detail in chapter 7.4.1. On the <Comments> tab a single tex­
tual comment for the tree can be defined. In that comment field you can enter values which can be exported and
later on used within the target/game engine. On the <User defined data> tab, predefined data elements can be
set for this tree, which can also be exported and used in the target engine. User defined data definition and edit­
ing is described in chapter 11.1.
On the <Editing Settings> tab it is possible to set parameters
and actions which should be applied whenever a new tree is
placed on the terrain. If the check box <Apply parameters> is
activated, the editing settings on this page will be applied for
the selected tree or tree category. This settings are applied
hierarchically: If they are set for a tree category, they apply for
all trees and categories below it; if they are set for a tree, they
override the settings of its category. The <Cast shadows on lightmap> parameter defines, whether or not this
tree will cast shadows on the computed lightmaps. <Allow scaling> defines, whether or not this tree can be
scaled when placed on the terrain. If scaling is allowed, the <Random scaling> parameter defines, whether or
not new tree placements are scaled automatically and randomly when they are created. The range for this scal­
ing can than be set in the <min> and <max> text fields. The <Random up rotation> parameter defines, whether
or not the tree placements are automatically and randomly rotated around the up axis when they are created.
With the <Allow height over ground change> parameter it is possible to allow or forbid changes/translations
along the tree's up axis. In the <initial height> text box one can set the height over ground (translation along the
tree's up axis) which should be set by default when a new tree placement is created. This height over ground
can be specified with respect to the “Object center” (the position of the coordinate system) or to the “Object bot­
tom” which allows to automatically place the tree directly on the ground regardless of where the object center is
located. When trees are placed on the ground it is also possible to affect the ground below the new tree place­
ment. This can be set in the <Effect on ground below> drop down list box. Possible settings are “no effect”,
“Flatten terrain” which flattens the terrain below the tree, and “Align object” which aligns the tree's up axis to the
slope of the terrain. Finally it is also possible to automatically adapt the texture below the tree by checking the
<Replace texture blow> check box and selecting the texture from the drop down list box below it.
Information All tree information is stored in the file “vegetation.tveg” in the root directory of your terrain. You
can simply copy and paste this file to other terrain projects if you want to reuse your settings.

7.2.2 Forest Definition


To enable the creation of huge, diversified forests with as little user interaction as possible, you can composite
forests in the forest definition. Open the forest definition dialog from the <PlugIns, Vegetation, Forest definitions>
menu. The following dialog will open:
On the left hand side of the dialog there is a list of all available forest definitions. You can add a new definition by
clicking the button. The base data of this forest will be shown on the right hand side of the dialog on the <Forest
base definition> tab. First you should give the forest a meaningful name. Subsequently you can set the minimum
and maximum distance between two neighboring trees of the forest in meters in the <Min. tree distance> and
<Max. tree distance> text fields. With the <Min. tree scale> and <Max. tree scale> parameters you can set the
size range of trees in this forest.
36
Now you can define the trees of the forest by switching to the
<Forest trees> tab. On the left hand side of this tab you can
see the <All available trees> tree view similar to that of the
tree manager (see 7.2.1) of all currently loaded trees. Select
one tree from the list and subsequently press the button
to add this tree to the <Trees selected for this forest> grid on
the right. The <Probability> column in this grid definies the
prob­
ability
by
which
a tree is randomly selected when a forest is created from
this definition. You can give every tree a probability
between 0 and 100, where 100 is the highest probability. A
tree can be removed from the forest definition by selecting
it in the <Trees selected for this forest> grid and pressing
the button afterwards.
To delete the currently selected forest definition, simply
press the button.

7.2.3 Placing and editing single Trees


To place trees on the terrain you first have to activate the vegetation edit mode by one of the following ways:

• Click the icon on the toolbar.


• Select the menu <View, Vegetation>
• Use the keyboard shortcut <Alt> + <V>

Select the tree editing mode by clicking <Trees> button within the <Vegetation> tool window
and afterwards select the single tree placement edit mode on the same tool window as shown
in the image to the right. From the drop-down-lists you can select the tree to be placed on the
terrain. To enable faster switching between frequently used trees it is possible to select up to
6 different trees at the same time. The option buttons <1> to <6> in front of the drop-down-
lists determine which one of these trees will be used. You can select one of them by clicking
the option button with the mouse or using the keyboard shortcuts <Alt> + <1> to <Alt> + <6>.
Placing trees is possible in 2d as well as in 3d view. The following two sub sections will de­
scribe this in more detail.
7.2.3.1 2D Tree placements
The following figure illustrates the 2d tree placement edit mode. Tree placements are visualized on the 2d map
as small green circles. The currently selected tree is highlighted by the edges of a red box around it. The tree
below the mouse cursor is highlighted by a yellow box.
You can add a new tree placement to the map with a double click with the left mouse button. The currently se­
lected tree in the <Vegetation> tool window will be placed at the current mouse position. Alternatively you can
click with the right mouse button on the map and select <Add tree> from the context menu to place a new tree
on the terrain.

37
To select a tree placement on the map, simply click with the left mouse button on it. The currently selected tree
can be moved over the map by holding down the left mouse button while moving the mouse if the position drag
mouse tool is activated.
Snap To Grid
By activating the <Snap to grid> checkbox in the <Vegetation> tool window you can
specify a distance between grid points which are used to horizontally position all tree
placements. Every newly added tree will be placed on the nearest horizontal grid point
according to this grid point distance value. Dragging a tree will also only move trees to those grid points.

7.2.3.2 3D Tree placements


In the 3d view all trees are visualized by their tree models, as can be seen from the following figure. The cur­
rently selected tree is highlighted with a red box around it and a coordinate system at its root. You can add a
new tree to the terrain in the same way as in 2d view (see 7.2.3.1): simply double or right click on the terrain or
right click on the terrain and select <Add Tree> from the context menu. To select a tree in 3d view, you have to
hit its tree model with a left click. The currently selected tree is highlighted by a red box. When moving the
mouse through the 3d viewport, the tree currently below the mouse will be highlighted with a yellow box.
Information Multiple trees can be selected by holding down the <Ctrl> key while clicking on a tree placement.
A tree can be moved in 3d along its x, y and z axis and it can be rotated about its z (up-)axis (if the underlaying
tree rendering engine supports rotation). To move a tree placement in 3d you first have to select it. Afterwards
the tree can be moved, simply by dragging one axis of the tree’s coordinate system while holding the left mouse
button. The tree will follow the mouse movements along the selected axis. You can switch to rotation mode by
clicking again on the tree while holding down the <Shift> key. Alternatively you can switch between translational
and rotational drag mode using the mouse tool buttons and . In rotational drag mode, the coordinate sys­
tem changes to circles which can also be dragged with the mouse. The circles which can be operated are
colored, deactivated circles (degrees of freedom) are displayed as black circles.

38
Initially the displayed coordinate system is aligned
with the tree. So
if you rotate the
tree, the coordin­
ate system will
follow this rota­
tion. It is also
possible to align
the displayed co­
ordinate system
with the world co­
ordinate system
(unrotated). You
can switch
between tree and
world aligned co­
ordinate system by opening the tree's context
menu with a right mouse click on it and sub­
sequently selecting <World axes aligned> from it.
Alternatively you can press <C> on the keyboard while a tree is selected. This feature is explained in more detail
for object placements in section 8.2.
7.2.3.3 Alternative 3D move mode for Trees
Moving trees by dragging the axes of their coordinate systems as described before makes it possible to change
the position of a tree placement very precisely. However for the gross positioning or for larger movements this
method is impractical.
For this purpose a second movement mode is implemented: First select the tree to be moved in the usual way.
Afterwards press the <Alt> key and hold it down. Now click with the left mouse button on the same tree and
keep the mouse button pressed. If you move the mouse, while holding the left mouse button and the <Alt> key
pressed, the selected tree will follow the mouse pointer's movements.
Information This movement mode works best, if viewing from some height down on the terrain.

39
7.2.3.4 Tree Placement Settings
By double clicking on an existing tree within the 2d or 3d scene or by clicking on a
tree with the right mouse button and selecting <Tree placement settings> the fol­
lowing dialog will open where all parameters of this tree placement can be set.
The name/ID of the tree which was opened can be seen in the <Tree type> text
field.
Within the upper left
frame <Tree posi­
tion> the tree's pos­
ition in relation to
the origin of the cur­
rent sector can be
set. The z coordin­
ate will be set as
offset from the terrain surface.
In the upper middle frame <Tree rotation> the ori­
entation about the tree's up-axis can be set. The
unit of the rotational settings is degree.
The upper right frame is used to set the tree's scal­
ing factor <Scale>. This scale is randomly initial­
ized. You can set the scale to an arbitrary value > 0. The resulting tree's height using the given scaling factor will
be computed and displayed within the <Height> text field. If you want the tree to have a specific height, you can
enter the desired height in the <Height> text field and let PnP TerrainCreator automatically compute the corres­
ponding scaling factor by clicking the <Set scale> button. The final tree scaling will be computed as a multiplica­
tion of this scaling factor and the global scaling factor set within the tree manager (see 7.2.1).
At the bottom of the dialog one can enter textual comments on the <Comments> tab for the tree placement.
These comments might also be used to add scripts, which can be executed by a target engine. On the <User
defined data> tab, predefined data elements can be set for this tree, which can also be exported and used in the
target engine. User defined data definition and editing is described in chapter 11.1.
Clicking the <Apply> button will apply all settings to the tree.

7.2.4 Spraying Trees onto the Terrain


Creating huge forests tree by tree would be a very time-consuming task. Therefore PnP TerrainCreator pos­
sesses a tool to spray trees on the terrain similar to the spray tool of common painting programs.
Select the spray tool in the <Vegetation> tool window as can be seen in the image to the
left. Afterwards set the spray radius in the <Tool size> text field. The trees sprayed on the
terrain will be randomly selected from a forest definition as specified in 7.2.2. Select the
desired <Forest definition> from the drop down list.
The spray tool radius will be visualized in 2D and 3D by a red circle or rectangle. You only
have to move this brush at the location where you want to spray the trees on the terrain.
Press down the left mouse button and PnP TerrainCreator tries to create randomly as
many tree placements within the tool radius as specified by the <Density> value corres­
ponding to the selected forest definition. If you hold down the left mouse button while mov­
ing the spray tool over the sector it will create new trees with every mouse movement if the
forest definition allows it.
If the check box <Test ground parameters> is checked, PnP TerrainCreator will test every tree placement
against the ground parameters as specified in section 7.4.1. Only those trees will be placed which do not violate
any setting.

40
7.2.5 Removing Tree Placements
You can remove a single tree placement from the 2d or 3d scene by opening its con­
text menu using a right click on the tree and selecting the <Remove tree(s)...> entry
from it or by pressing <Ctrl> + <Del> on the keyboard. All trees of the current sector
can be removed at once by selecting <Remove all trees...> from the context menu.

7.2.5.1 The Tree Rubber Tool


With the rubber tool you can move over the 2D or 3D scene and remove all tree
placements within the tool radius. This tool allows you to efficiently remove a larger
number of trees very easy. You can simply create aisles through your forest and so
get the space for roads or rivers.
Select the rubber tool in the <Vegetation> tool window as can be seen in the image
to the left. Afterwards set the radius of the rubber in the <Rubber size> text field.
The tool/rubber radius will be visualized in 2D and 3D view by a red circle. You only
have to move this circle at the location where you want to remove the trees. Press
down the left mouse button and all trees within the tool radius will be removed. If
you hold down the left mouse button while moving the rubber over the sector all
trees hit but the rubber on its path will be removed.
7.2.5.2 Additional Tree Commands
There are a few additional tree commands, which are available from a tree's context
menu in single tree edit mode. The first command <Flatten ground below> flattens
the terrain surface below the bounding box(es) of the selected tree(s). The command
<Set to zero height> places the tree's coordinate system (its origin) directly on the terrain surface. The last com­
mand <Place on ground> places the tree's bounding box directly on the terrain surface. These commands are
described in more detail for the object edit mode in chapter 8.2.5.

7.3 Grass Coverage


3D grass rendering is usually performed a bit different to tree rendering. Tree placements are defined exactly by
position, orientation and size. Usually there are much too many grass placements to store all of their parameters
explicitly, so only a density and probability for a grass placement at a given position of the terrain is stored and
the actual grass placement is dynamically and randomly created when the viewer comes into viewing distance
for that terrain position. The way how these random grass placements are created depends on the rendering en­
gine and the type of grass model, therefore it is the responsibility of the vegetation PlugIn to create 3D place­
ments. Within PnP TerrainCreator you can decide the density of a grass type for every terrain region. The most
common way to work with grass coverage is to first finish the terrain texturing, defined parameters like probabil­
ity and density of a grass type for every texture on which it can „grow“ and finally let the grass coverage automat­
ically be created by PnP TerrainCreator.

7.3.1 The Grass Manager


After selecting the vegetation manager PlugIn, you can open PnP TerrainCreator’s grass manager with the
menu <PlugIns, Vegetation, Grass manager>. In the following window you can view the grasses managed by
this PlugIn and apply some basic settings to them.
All grasses are grouped by the PlugIn into categories and sub categories. These categories are visualized with
the folders in the <Grasses> tree view. By pressing the right in front of a category folder you can open this
category an get access to its sub categories and grasses.
You can select one grass by clicking with the left mouse button on its name within the <Grasses> tree view. The
selected grass will be highlighted and a preview of it together with some rendering data will be displayed in the
lower right corner of this window. You can zoom the preview in and out by pressing the and buttons.

41
In the text field <Label> you can set the
name to be displayed for the selected
grass. The text field <Name / ID> is for
informational issues. It displays the in­
ternal ID of this grass for the vegetation
manager PlugIn.
Grass that had been defined previously
but are no longer available – for ex­
ample because of a deleted grass file –
will be highlighted by the icon with­
in the <Grasses> tree view. You can re­
move such missing grass from the list
by pressing the <Remove unused
grass> button which will appear as soon
as you select a missing grass from the
<Grasses> tree view. Pressing the <Remove all unused grasses> button will remove all missing grasses at
once.
When you made changes to the grasses sources (new/changed/deleted grass files) you can reload all grasses
by pressing the <Reload> button.
Some additional parameters have to be set to ensure a correct visualization of the grasses. The first one is the
<Up rotation>. PnP TerrainCreator uses for its 3d scenes the y-axis as up-axis. If your grass models use the z-
axis as up-axis you have to rotate them about their x-axis in order to achieve the right grass orientation. Simply
select a rotation value from the combo box and check the result within the 3d preview.
The second parameter is a global scaling factor. All grass will be scaled by the factor given in <Scale factor>. To
determine whether or not a scaling factor is correct you can check the grasses' <Height> in
meters. If you know the desired grass height you can enter it in the text field <Height> and com­
pute the appropriate scaling factor from it by clicking the <Set scale> button. With the context
menu, which will be opened after you clicked that button, one can decide if the scale factor should be used as
global scale or as scale factor for the currently selected grass instead. The default scale of a grass instance is
defined by multiplying the global scale <Scale factor> with the grass specific scale <Scale>.
Finally it might be necessary to flip the grass models along one axis if they are mirrored. This can be achieved
by selecting the appropriate flipping axis in the <Flip axis> drop down list.
The tabs <Ground shape settings> and <Ground texture settings> are used for the automated computation of
the vegetation distribution and will be described in detail in chapter 7.4.3. On the <Comments> tab a single tex­
tual comment for the grass can be defined. In that comment field you can enter values which can be exported
and later on used within the target/game engine. On the <User defined data> tab, predefined data elements can
be set for this grass, which can also be exported and used in the target engine. User defined data definition and
editing is described in chapter 11.1.
Information All grass information is stored in the file “vegetation.tveg” in the root directory of your terrain.
You can simply copy and paste this file to other terrain projects if you want to reuse your
settings.

7.3.2 Manual Grass Coverage Editing


The editing of the terrain's grass coverage is only available in 3D view. The 3D view will
automatically be activated, if you activate the grass editing by pressing the <Grass> but­
ton within the <Vegetation> tool window. As usually for larger scene the manual place­
ment of single grass placements doesn't make much sense, this edit mode has no op­
tion for placing single grasses. You can only spray grasses with a given density onto the
terrain. If you really need to place one single grass at a specific position, you have to
make the grass files available within the trees edit mode, by copying the grass files into
the trees directory, and handle them as trees.
7.3.2.1 Spraying Grass onto the Terrain
The grass coverage can be sprayed onto the terrain. Select the spray tool within the
<Vegetation> tool window as can be seen in the image to the right. From the drop-
down-lists you can select the grass to be sprayed onto the terrain. To enable faster
switching between frequently used grasses it is possible to select up to 6 different
grasses at the same time. The option buttons <1> to <6> in front of the drop-down-lists

42
determine which one of these grasses will be used. You can select one of them by clicking the option button with
the mouse or using the keyboard shortcuts <Alt> + <1> to <Alt> + <6>.
Define the <Tool size> and shape of the spray tool and a <Density> in the range from 1 to 100 of the grass
placements to be created. The spray tool radius will be visualized in 3D by a red circle or rectangle. You only
have to move this brush at the location where you want to spray the grasses onto the terrain. Press down the left
mouse button and PnP TerrainCreator will generate grass placements with the defined density inside the tool re­
gion. If you hold down the left mouse button while moving the spray tool over the sector it will create new
grasses with every mouse movement.
If the check box <Test ground parameters> is checked, PnP TerrainCreator will test every grass placement
against the ground parameters as specified in section 7.4.3. Only those grasses will be placed which do not viol­
ate any setting.

Information The Standard, Professional and Enterprise Editions of PnP TerrainCreator can specify up to 4
different grass definitions for every heightmap element. The Community Edition can only have 1
grass definition per heightmap element.
7.3.2.2 Removing Grass Coverage
The complete grass coverage of a sector can be deleted with a click with the right mouse button inside the 3D
view, if the vegetation edit mode is selected. Afterwards select <Remove all grasses> from the context menu.

43
To delete the grass coverage in a smaller region, you can use the rubber tool which you
can move over the 3D scene and remove all grasses within the tool radius. Select the
rubber tool in the <Vegetation> tool window in grass editing mode as can be seen in the
image to the left. Afterwards set the radius of the rubber in the <Rub­
ber size> text field.
The tool/rubber radius will be visualized in 3D view by a red circle or
rectangle. You only have to move this circle at the location where you
want to remove the trees. Press down the left mouse button and all
grasses within the tool radius will be removed. If you hold down the
left mouse button while moving the rubber over the sector all grasses hit but the rubber
on its path will be removed.

7.4 Automated Vegetation Generation


PnP TerrainCreator Can automatically create tree placements and grass coverage on your terrain. Depending
on parameters like ground shape and texturing as described in section 7.4.1 and 7.4.3 it can decide for every
heightmap position, whether or not a tree or grass can be placed. The automated tree placement creation de­
scribed in section 7.4.2 uses these definitions together with the forest definitions of section 7.2.2 to create a sec­
tor vegetation completely automated.

7.4.1 Parameters for automated tree placement generation


Within the Tree Manager (see section 7.2.1)
you can set the <Slope> and <Height>
range in which a tree can be applied for
every single tree or tree category on the
<Ground shape settings> tab. In order to
apply these settings, the check box <Apply
parameters> has to be checked. If you ap­
ply parameters for a category and for single
tree within this category too, the parameters
of the tree have higher priority than the
parameters of the category. If you only set
the parameters for a category and not for
the tree within the category, the parameters
of the category will be applied for all trees
within this category.
On the third tab of the Tree Manager <Ground texture settings> you can apply texture dependencies for the
trees. In order to apply these settings, the check box <Apply parameters> has to be checked. Afterwards you
can select a texture from the list at the left side of the
dialog. Pressing the button you can assign this
texture for the selected tree. The selected texture will
be added to the grid at the right where a probability
can be assigned for it. To remove a texture assign­
ment, you have to select it within the grid and after­
wards press the button. The priority for categorie
and tree assignments is the same as described for
the ground shape parameters before.

44
7.4.2 Automated tree placement generation
If forest definitions (section 7.2.2) and the parameters for automated vegetation generation (section 7.4.1) have
been applied, PnP TerrainCreator can automatically create tree placements for one
sector. Open a sector's detail map and switch to the vegetation edit mode as ex­
plained in section 7.2.3 in 2D or 3D view. Afterwards click the <Auto generate
trees> button within the <Vegetation> tool window. The following dialog will open
up.
Within the table <Forest probabilities> on the left side of the <Automated vegeta­
tion generation> dialog one can set the generation probabilities between 0 and 100
for every forest for this sector. Within the <Generation parameters> frame to the right one can set additional set­
tings for the tree placement generation. If the check box <Remove existing trees> is checked, PnP TerrainCre­
ator will remove all existing tree placements before cre­
ating new ones. The approximate number of tree place­
ments to be created can be defined in the <Num trees>
text field.
The generation algorithm uses the tree spray tool (sec­
tion 7.2.4) to create tree placements. The <Density>
range to be set corresponds to the density parameter of
the spray tool. The density used for spraying trees will
be randomly selected within this range. With the range
parameter <Iterations> one can set how often the al­
gorithm will spray trees in close proximity before choos­
ing a random new location within the sector to start with
a new forest. The number of iterations used for spray­
ing trees will be randomly selected within this range
Press the <OK> button to start the automated tree placement generation.

(The automated tree placement generation is currently implemented directly within the main program. Future
versions will implement it as PlugIns)

7.4.3 Parameters for automated grass coverage generation


The parameters for automated grass cover­
age generation are similar to those for
automated tree placement generation (sec­
tion 7.4.1). Within the Grass Manager (see
section 7.2.1) you can set the <Slope> and
<Height> range in which a grass can be ap­
plied for every single grass or grass cat­
egory on the <Ground shape settings> tab.
In order to apply these settings, the check
box <Apply parameters> has to be
checked. If you apply parameters for a cat­
egory and for single grass within this cat­
egory too, the parameters of the grass
have higher priority than the parameters of
the category. If you only set the parameters
for a category and not for the grass within
the category, the parameters of the category will be applied for all grasses within this category.
On the third tab of the Grass Manager <Ground tex­
ture settings> you can apply texture dependencies for
the grasses. In order to apply these settings, the
check box <Apply parameters> has to be checked. Af­
terwards you can select a texture from the list at the
left side of the dialog. Pressing the button you
can assign this texture for the selected grass. The se­
lected texture will be added to the grid at the right
where a probability and a density can be assigned for
it. To remove a texture assignment, you have to select
it within the grid and afterwards press the button. The priority for categorie and grass assignments is the

45
same as described for the ground shape parameters before. The probability defines how likely a grass will be
selected given the assigned texture for a terrain position. The Density defines how many grass placements will
be generated for one heightmap square element. It is identically to the density used within the grass spray tool
(section 7.3.2.1), so you can experiment with the spray tool before defines all those random parameters for
automated grass coverage generation.
Information The surface texturing is the base information for the automated grass coverage generation. So
You have to define texture dependencies for all grasses, which you want to generate automa-
tically. Without this texture definition no grasses will be placed automatically.

46
7.4.4 Automated grass coverage generation
If the parameters for automated vegetation generation (section 7.4.3) have been ap­
plied and the terrain surface is already textured, PnP TerrainCreator can automatically
create a grass coverage for one sector. Open a sector's detail map and switch to the
vegetation grass edit mode in 3D view. Afterwards click the <Auto generate grasses>
button within the <Vegetation> tool window. The following dialog will open up.
Within the table
<Grass type probabilities> on the left side of
the <Automated grass placement generation>
dialog one can set the generation probabilities
between 0 and 100 for every grass for this sec­
tor. Within the <Generation parameters> frame
to the right one can set additional settings for
the tree placement generation. If the check box
<Remove existing grass> is checked, PnP Ter­
rainCreator will remove all existing grass place­
ments before creating new ones. The maxim­
um number of different grass placements per
heightmap square element can be set within
the text field <Num grass types per square>.
Remember, the Community Edition does only
allow a maximum of 1 grass placement defini­
tion per square.
Press the <OK> button to start the automated grass coverage generation.
(The automated grass coverage generation is currently implemented directly within the main program. Future
versions will implement it as PlugIns)

7.5 Vegetation Manager PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the vegetation manager PlugIns that were shipped with the PnP TerrainCre­
ator will be described in more detail. Remember: If you use 3 rd party or your own PlugIns they could behave in
very different ways than described here. So please refer to the documentation of the used PlugIn, if available.

7.5.1 Vegetation Files (PnPTC)


This is the default vegetation manager PlugIn for the PnP TerrainCreator. It’s capable of loading .obj and .x files.
With this PlugIn you can use every mesh file stored in .x, .3ds, .b3d, .dae (collada), mesh.xml (Ogre) or .obj
format as source for trees and grasses. Place the object files you want to use as a tree into the “VEGETATION\
TREES” folder below your terrain project’s base directory. Creating subdirectories below the
“VEGETATION\TREES” directory will enable the categorization of the trees. You can create an arbitrary number
of categories and an arbitrary number of sub categories. Grass files have to be stored within the subdirectory
“VEGETATION\GRASS”

The PlugIn will scan all the contents of the following folders:
• “VEGETATION\TREES"
• “VEGETATION\TREES\<category>”
• “VEGETATION\TREES\<category>\<subcategory>\...”
• “VEGETATION\GRASS"
• “VEGETATION\GRASS\<category>”
• “VEGETATION\GRASS\<category>\<subcategory>\...”

Example To use a file “CONIFER01.X” as tree within the main category “CONIFER” and the subcategory
“NORTH AMERICA” you have to place the file in the following folder:
“VEGETATION\TREES\CONIFER\NORTH AMERICA\CONIFER01.X”

47
Information All trees and grasses must have different names, as the file name is the main identifier of an ob­
ject. So make sure that there are no duplicated file names in the different sub folders. The PlugIn
will display a warning message at load time if there are duplicated tree file names.
Information All trees must at least have one main category. So it is recommended to create at least one sub­
directory below the “VEGETATION” directory. Don’t place any tree files directly within the “VE­
GETATION” directory. If you place trees directly within the "VEGETATION" directory, they will by
default be given the category name "default category". The same is true for grass files.
7.5.1.1 PlugIn settings
For this PlugIn additional settings can be set within the
3D view settings dialog (section 2.4.1). Depending on
how the vegetation meshes are created, it might be
useful the deactivate the backface culling in order to
have dense tree crowns for example. This can be
achieved by checking the <Disable backface culling>
check box.

7.5.1.2 Ogre Mesh files


PnP TerrainCreator supports Ogre mesh files in xml (.mesh.xml) format for vegetation objects. If your object
files are in Ogre's binary format (.mesh), please convert them to xml format using the mesh converter tool,
which can be downloaded from the Ogre web site. You can now simply copy the .mesh.xml files into the vegeta­
tion directory and the vegetation manager PlugIn will load them.
Ogre's material capabilities are quite complex and not implemented in PnP TerrainCreator. So currently you
have to supply simplified material files for your mesh files. These material files are xml files, so they can be cre­
ated and edited easily with any text editor program. For every mesh file in the vegetation directory, the vegeta­
tion manager PlugIn searchs for a corresponding material file with the same name and the ending .pnpogremat.
So, if you have a mesh file with the name “Conifer.mesh.xml” you should provide a material file with the name
“Conifer.pnpogremat” in the same directory. The material files have the following format:
<materials>
<material material="MaterialName1" texture="Texture1.jpg" alpha="false" />
<material material="MaterialName2" texture="Texture2.png" alpha="true" />
</materials>

All material used in the mesh should be listed below the <materials> tag, whereas every material has its own
<material> tab. The “material” parameter in this tag specifies the name of the material as it is used in the mesh.
The “texture” parameter specifies the texture to be used for the diffuse and ambient color of this material. And
the “alpha” parameter finally specifies, if alpha blending should be turned on for this material.

7.6 Vegetation Generator PlugIns shipped with PnP TerrainCreator


Coming soon.

48
8 Static 3D Objects

On real terrains a wide variety of objects like houses, stones or traffic signs can be found. The following sub sec­
tions will describe PnP TerrainCreator’s capabilities to place such 3d static objects onto your terrain.

8.1 Initialization of Object Manager


The loading and managing of 3d objects is implemented using PlugIns. In this way experienced users can easily
add their own PlugIns to support own file formats in PnP TerrainCreator. Before you can place objects on your
terrain you will have to select the PlugIn managing
your objects. You can select this PlugIn when you
create a new terrain or via the menu <File, Terrain
properties> for an already existing terrain.
The “Static Object Files (PnPTC)” object manager
PlugIn selected in the image to the left is the default
file based object manager PlugIn of PnP TerrainCre­
ator. It is described in more detail in 8.3.1. There is
another global parameter, which can be set for object
manager PlugIns: The location of the object files
<Object location>. The setting “Project directory” spe­
cifies that the object files are stored below the terrain
project directory in the “Objects” subdirectory. The
actual path to be used is shown in the <Object directory> field. A second possible value is “Application direct­
ory”, which specifies the “Data\Objects” directory below the installation directory of PnP TerrainCreator as
source path for the object files. Finally one can select “User defined directory”, which enables the possibility to
select any arbitrary directory by clicking the <...> button behind the <Object directory> text field.
If all settings have been applied you can open PnP TerrainCreator’s object manager with the menu <PlugIns,
Objects> from the program's main window. In the following window you can view the 3d objects managed by this
PlugIn and apply some basic settings to them.
All 3d objects are grouped by the PlugIn into categories and sub categories. These categories are visualized
with the folders in the <Objects> tree view. By pressing the right in front of a category folder you can open this
category an get access to its sub categories and objects.
You can select one 3d object by click­
ing with the left mouse button on its
name within the <Objects> tree view.
The selected object will be highlighted
and a preview of it together with some
rendering data will be displayed in the
lower right corner of this window. You
can zoom the preview in and out by
pressing the and buttons.
In the text field <Label> you can set
the name to be displayed for the selec­
ted 3d object. The text field <Name /
ID> is for informational issues. It dis­
plays the internal ID of this object for
the object manager PlugIn.
3d objects that had been defined previ­
ously but are no longer available – for
example because of a deleted object
file – will be highlighted by the icon within the <Objects> tree view. You can remove such missing objects
from the list by pressing the <Remove unused object> button which will appear as soon as you select a missing
object from the <Objects> tree view. Pressing the <Remove all unused objects> button will remove all missing
objects at once.
When you made changes to the 3d object sources (new/changed/deleted object files) you can reload all 3d ob­
jects by pressing the <Reload> button.

49
Some additional parameters have to be set to ensure a correct visualization of the 3d objects. The first one is
the <Up rotation>. PnP TerrainCreator uses for its 3d scenes the y-axis as up-axis. If your 3d models use the z-
axis as up-axis you have to rotate them about their x-axis in order to achieve the right object orientation. Simply
select a rotation value from the combo box and check the result within the 3d preview.
The second parameter is a global scaling factor. All objects will be scaled by the factor given in <Scale factor>.
To determine whether or not a scaling factor is correct you can check the object’s <Height> in
meters. If you know the desired object height you can enter it in the text field <Height> and
compute the appropriate scaling factor from it by clicking the <Set scale> button. With the con­
text menu, which will be opened after you clicked that button, one can decide if the scale factor should be used
as global scale or as scale factor for the currently selected object instead. The default scale of an object in­
stance is defined by multiplying the global scale <Scale factor> with the object specific scale <Scale>.
Finally it might be necessary to flip the object models along one axis if they are mirrored. This can be achieved
by selecting the appropriate flipping axis in the <Flip axis> drop down list.
On the <Comments> tab a single textual comment for the grass can be defined. In that comment field you can
enter values which can be exported and later on used within the target/game engine. On the <User defined
data> tab, predefined data elements can be set for this grass, which can also be exported and used in the target
engine. User defined data definition and editing is described in chapter 11.1.
On the <Editing Settings> tab it is possible to set para­
meters and actions which should be applied whenever
a new object is placed on the terrain. If the check box
<Apply parameters> is activated, the editing settings
on this page will be applied for the selected object or
object category. This settings are applied hierarchic­
ally: If they are set for a object category, they apply for
all objects and categories below it; if they are set for a
object, they override the settings of its category. The
<Cast shadows on lightmap> parameter defines,
whether or not this object will cast shadows on the computed lightmaps. <Allow scaling> defines, whether or not
this object can be scaled when placed on the terrain. If scaling is allowed, the <Random scaling> parameter
defines, whether or not new object placements are scaled automatically and randomly when they are created.
The range for this scaling can than be set in the <min> and <max> text fields. The <Random up rotation> para­
meter defines, whether or not the object placements are automatically and randomly rotated around the up axis
when they are created. With the <Allow height over ground change> parameter it is possible to allow or forbid
changes/translations along the object's up axis. In the <initial height> text box one can set the height over
ground (translation along the object's up axis) which should be set by default when a new object placement is
created. This height over ground can be specified with respect to the “Object center” (the position of the coordin­
ate system) or to the “Object bottom” which allows to automatically place the object directly on the ground re­
gardless of where the object center is located. When objects are placed on the ground it is also possible to af­
fect the ground below the new object placement. This can be set in the <Effect on ground below> drop down list
box. Possible settings are “no effect”, “Flatten terrain” which flattens the terrain below the object, and “Align ob­
ject” which aligns the object's up axis to the slope of the terrain. Finally it is also possible to automatically adapt
the texture below the object by checking the <Replace texture blow> check box and selecting the texture from
the drop down list box below it.
Information All 3d object information is stored in the file “objects.tobj” in the root directory of your terrain. You
can simply copy and paste this file to other terrain projects if you want to reuse your settings.

8.2 Placing static 3D Objects


To place static objects on your terrain surface you have to open a sector’s detail map first. Static objects can
only be placed in 3D view, so you have to activate it and then switch to the static object edit mode by one of the
following ways:

• Click the icon on the toolbar.


• Select the menu <View, Static objects>
• Use the keyboard shortcut <Alt> + <O>

50
A new tool window <3D Objects> will open where you can
select the object to be placed on the terrain. All 3d objects
are organized by their categories using a tree view similar to
that of the object manager described in 8.1. You can only se­
lect “real” objects but no categories within this list.

To place an object on the terrain first select it from the tree


view and afterwards double click with the left mouse button
at the terrain location where it should be placed. Alternatively
you can click with the right mouse button on the desired ter­
rain location to open a context menu and select the entry
<Add Object> from it.
To select a 3d object in the scene, you have to hit its model
with a left click. The currently selected object is highlighted by a red box. When moving the mouse through the
3d viewport, the object currently below the mouse will be highlighted with a yellow box.
Information Multiple objects can be selected by holding down the <Ctrl> key while clicking on an object place­
ment.
To move an object placement in 3d simply drag one axis of
the object’s coordinate system with the left mouse button.
The object will follow the mouse movements along the se­
lected axis.
By clicking the object or its coordinate system with the
<Shift> key held down, you can switch between a transla­
tional and a rotational coordinate system. Alternatively you
can switch between transla­
tional and rotational drag
mode using the mouse tool
buttons and . In rota­
tional drag mode, the co­
ordinate system changes to
circles which can also be
dragged with the mouse

Initially the displayed coordinate system is aligned with the object. So if you rotate the
object, the coordinate system will follow this rotation. It is also possible to align the dis­
played coordinate system with the world coordinate system (unrotated). Using the world
aligned coordinate system you can for example simply change the height of an object
by dragging the up axis, whereas dragging the up axis of the oriented object coordinate
system would result in a diagonal and not in the desired up movement of the object.
You can switch between object and world aligned coordinate system by opening the ob­
ject's context menu with a right mouse click on it and subsequently selecting <World
axes aligned> from it. Alternatively you can press <C> on the keyboard while an object
is selected. The following two figures will illustrate the alignments of the coordinate sys­
tems. In the left image the coordinate system is aligned with the object in the right im­
age it is aligned with the world axes.

51
8.2.1 Alternative 3D move mode for static Objects
Moving objects by dragging the axes of their coordinate systems as described before makes it possible to
change to position of an object placement very precisely. However for the gross positioning or for larger move­
ments this method is impractical.
For this purpose a second movement mode is implemented: First select the object to be moved in the usual
way. Afterwards press the <Alt> key and hold it down. Now click with the left mouse button on the same object
and keep the mouse button pressed. If you move the mouse, while holding the left mouse button and the <Alt>
key pressed, the selected object will follow the mouse pointer's movements and keep a constant height over
ground while moving over the terrain.
Information This movement mode works best, if viewing from some height down on the terrain.

8.2.2 Snap To Grid


By activating the <Snap to grid> checkbox in the <3D Objects> tool window you can specify a distance between
grid points which are used to horizontally position all object placements. Every newly added object will be placed
on the nearest horizontal grid point according to this grid point distance value. Dragging an object will also only
move objects to those grid points.

8.2.3 Object Placement Settings


By double clicking on an existing object within the 3d scene or by clicking on an object with the right mouse but­
ton and selecting <Placement settings> the dialog below will open where all parameters of this object placement
can be set. The name/ID of the object which was opened can be seen in the <Object type> text field. An addi­
tional name for this object placement can be set in the <Name> text field.
Within the upper left frame <Object position> the object’s position in relation to the
origin of the current sector can be set. The z coordinate will be set as offset from the
terrain surface.
In the upper middle frame
<Object rotation> the orienta­
tion of the object can be set
as subsequent rotations
about the z, y and x axes.
The unit of the rotational set­
tings is degree.
The upper right frame is used
to set the object's scaling
factor <Scale>. This is initially
1. You can set the scale to an arbitrary value greater
than 0. The resulting object’s height using the given
scaling factor will be computed and displayed within the
<Height> text field. If you want the object to have a spe­
cific height, you can enter the desired height in the <Height> text field and let PnP TerrainCreator automatically
compute the corresponding scaling factor by clicking the <Set scale> button. The final object scaling will be
computed as a multiplication of this scaling factor and the global scaling factor set within the object manager
(see 8.1).
At the bottom of the dialog one can enter textual comments for the object placement. These comments might
also be used to add scripts, which can be executed by a target engine.

52
Clicking the <Apply> button will apply all settings to the object.

8.2.4 Removing Object Placements

A static object can be removed from the 3d scene by opening its context menu using
a right click on the object and selecting the <Remove object(s)..> entry from it or by
pressing <Ctrl> + <Del> on the keyboard. All objects of the current sector can be re­
moved at once by selecting <All objects> → <Remove ...> from the context menu.

8.2.5 Additional Object Functionalities


The following additional functionalities are available from the object placements'
context menu:
8.2.5.1 Align to Ground
This functionality aligns an object's up-axis to the shape of the ground in a way
that the object's up-axis is parallel to the surface normal of the ground directly be­
low the object. The following two figures illustrate this feature. In the left image, the object is aligned in its initial
orientation. The right image shows the object after the align to ground functionality was applied to it.

8.2.5.2 Flatten Ground Below


This feature flattens the ground below a selected object as can be seen in the following images.

8.2.5.3 Set to Zero Height


This function sets the height over ground of an object to zero, which means the coordinate system is placed dir­
ectly on the ground.
8.2.5.4 Place on Ground
In contrast to the previous function, this function places the object's bounding box directly on the ground. So if
the origin (the coordinate system) of an object is not located at the objects bottom, one can exactly position the
object's bottom on the terrain surface using this function.
8.2.5.5 Rotate
With this functionality it is possible to rotate the object around its up-axis by 90°, 180°, and 270° (-90°).

53
8.3 Object Manager PlugIns shipped with PnP TerrainCreator
Within the following sub section(s) the 3d object manager PlugIns that were shipped with the PnP TerrainCreat­
or will be described in more detail. Remember: If you use 3 rd party or your own PlugIns they could behave in very
different ways than described here. So please refer to the documentation of the used PlugIn, if available.

8.3.1 Static Object Files (PnPTC)


This is the default 3d object manager PlugIn for the PnP TerrainCreator. It’s capable of loading .obj and .x files.
With this PlugIn you can use every mesh file stored in .x, .3ds, .b3d, .dae (collada), .mesh.xml (Ogre), or .obj
format as source for 3d static objects. Place the object files you want to use into the “OBJECTS” folder below
your terrain project’s base directory. Creating subdirectories below the “OBJECTS” directory will enable the cat­
egorization of the 3d objects. You can create an arbitrary number of categories and an arbitrary number of sub
categories.

The PlugIn will scan all the contents of the following folders:
• “OBJECTS\"
• “OBJECTS\<category>”
• “OBJECTS\<category>\<subcategory>\...”

Example To use a file “CASTE RUIN 1.X” as 3d object within the main category “ARTIFICIAL” and the sub­
category “CASTLES” you have to place the file in the following folder:
“OBJECTS\ARTIFICIAL\CASTLES\CASTE RUIN 1.X”
Information All object files must have different names, as the file name is the main identifier of an object. So
make sure that there are no duplicated file names in the different sub folders. The PlugIn will dis­
play a warning message at load time if there are duplicated object file names.
Information All objects must at least have one main category. So it is recommended to create at least one
subdirectory below the “OBJECTS” directory. Don’t place any objects files directly within the “OB­
JECTS” directory. If you place objects directly within the "OBJECTS" directory, they will by default
be given the category name "default category".
8.3.1.1 Ogre Mesh files
PnP TerrainCreator supports Ogre mesh files in xml (.mesh.xml) format for static objects. If your object files are
in Ogre's binary format (.mesh), please convert them to xml format using the mesh converter tool, which can be
downloaded from the Ogre web site. You can now simply copy the .mesh.xml files into the object directory and
the object manager PlugIn will load them.
Ogre's material capabilities are quite complex and not implemented in PnP TerrainCreator. So currently you
have to supply simplified material files for your mesh files. These material files are xml files, so they can be cre­
ated and edited easily with any text editor program. For every mesh file in the objects directory, the object man­
ager PlugIn searchs for a corresponding material file with the same name and the ending .pnpogremat. So, if
you have a mesh file with the name “Box.mesh.xml” you should provide a material file with the name “Box.pnpo­
gremat” in the same directory. The material files have the following format:
<materials>
<material material="MaterialName1" texture="Texture1.jpg" alpha="false" />
<material material="MaterialName2" texture="Texture2.png" alpha="true" />
</materials>

All material used in the mesh should be listed below the <materials> tag, whereas every material has its own
<material> tab. The “material” parameter in this tag specifies the name of the material as it is used in the mesh.
The “texture” parameter specifies the texture to be used for the diffuse and ambient color of this material. And
the “alpha” parameter finally specifies, if alpha blending should be turned on for this material.

8.3.2 CS Objects (PnPTC)


With this 3d object manager PlugIn you can use all mesh formats which can be read by the Crystal Space 3D
game engine (http://www.crystalspace3d.org/) as 3d static objects within PnP TerrainCreator. Place the object
files you want to use into the “OBJECTS” folder below your terrain project’s base directory. Creating subdirector­
ies below the “OBJECTS” directory will enable the categorization of the 3d objects. You can create an arbitrary

54
number of categories and an arbitrary number of sub categories. This PlugIn is also capable of reading meshes
from ZIP archives within the scanned object directories.

The PlugIn will scan all the contents of the following folders:
• “OBJECTS\"
• “OBJECTS\<category>”
• “OBJECTS\<category>\<subcategory>”

Example To use a file “CASTE RUIN 1.SPR” as 3d object within the main category “ARTIFICIAL” and the
subcategory “CASTLES” you have to place the file in the following folder:
“OBJECTS\ARTIFICIAL\CASTLES\CASTE RUIN 1.SPR”
Information All objects must have different names, as the object name is the main identifier. This is not the
name of the file but the name of the object as it is specified within the file. Please make sure that
there are no duplicated object names in the different sub folders. The PlugIn will display a warning
message at load time if there are duplicated object names.
Information All objects must at least have one main category. So it is recommended to create at least one
subdirectory below the “OBJECTS” directory. Don’t place any objects files directly within the “OB­
JECTS” directory. If you place objects directly within the "OBJECTS" directory, they will by default
be given the category name "default category".

55
9 Sounds

With PnP TerrainCreator you can apply sounds to terrain surface textures or place environment sound onto the
map. You will first have to select a sound engine PlugIn to load and your sound files. You can select this PlugIn
when you create a new terrain or via the menu <File, Terrain properties> for an already existing terrain.
The “fmod Sound (PnPTC)” PlugIn selected in the
image above is the default PnP TerrainCreator sound
manager PlugIn. It is described in section 9.3.1.
There is another global parameter, which can be set
for sound manager PlugIns: The location of the
sound files <Sound location>. The setting “Project
directory” specifies that the sound files are stored be­
low the terrain project directory in the “Sounds” sub­
directory. The actual path to be used is shown in the
<Sound directory> field. A second possible value is
“Application directory”, which specifies the
“Data\Sounds” directory below the installation direct­
ory of PnP TerrainCreator as source path for the
sound files. Finally one can select “User defined directory”, which enables the possibility to select any arbitrary
directory by clicking the <...> button behind the <Sound directory> text field.
If all settings have been applied you can view all sounds
currently available in the sound manager dialog – main
screen menu <PlugIns, Sounds> – and additionally set
some basic properties of the sounds there.
The categories, sub categories and names/IDs of the
sounds will be set directly by the sound PlugIn.
The main <category> defines the usage for the sound.
Two categories are currently supported: environmental
sounds (see section 9.2) and ground sounds (see section
9.1). The sub categories <Sub category> will help you
later on selecting a desired sound from a large number of
available sounds.
In the text field <Label> you can set the name to be dis­
played for this sound. The parameter <Default volume> is
the initial volume to be set when using this sound for your
map. You can of course adjust this value later on for an in­
dividual sound placement. The text field <Name / ID> is for informational issues. It displays the internal ID of this
sound for the sound PlugIn.
For environmental sounds you can define a <Default color>. Within the 2d views the sound placements of this
sub category will be displayed with the selected color. To change the color press the <Change> button and se­
lect your desired color from the following color selection dialog.
You can playback the currently selected sound of the <Sounds> list by pressing the button or double clicking
with left mouse button on the sound within the list.
Sounds that had been defined previously but are no longer available – for example because of a deleted sound
file – will be highlighted by the icon within the <Sounds> list. You can remove such missing sounds from the
list by pressing the <Remove unused sound> button which will appear as soon as you select an missing sound
from the <Sounds> list. All sound placements that where using this deleted sound will be removed from your ter­
rain when the corresponding sector will be opened the next time for sound editing.
When you made changes to the sound sources (new or deleted sound files) you can reload all sounds by press­
ing the <Reload> button.
Information All sound information is stored in the file “sounds.tsnd” in the root directory of your terrain. You
can simply copy and paste this file to other terrain projects if you want to reuse your settings. The
predefined sound dependency functions (described in section 9.2.3) and standard sound place­
ments (described in section 9.2.4) are also stored in this file.

56
9.1 Ground Sounds
Interaction sounds between objects and the terrain surface can be applied within the texture manager. The tex­
ture manager can be opened the from the menu <PlugIns, Textures>. Section 5.2 gives an introduction to this
texture manager. Here only the functionality for applying ground sounds will be described.
Select the tab <Ground Sounds> from the tab
control at the right of this dialog. On this tab you
can see the ground sounds that are applied to
the currently selected texture within the list box
<Ground sounds>.
New sounds can be
added to this list by
clicking the button.
In the following sound
selection dialog, the
sound to be added to
the list has to be selec­
ted and confirmed by
pressing <OK>. Press­
ing removes the currently selected sound
from the list.
Right to this list, playback parameters for the currently selected sound can be set. With the combo box <Ground
sound type> the playback trigger for this sound can be set. By default the following types are available:
Step (slow) : Applied for slowly walking characters.
Step (normal) :Applied for characters walking at normal speed.
Step (fast) : Applied for running characters.
Drop (light) : Applied for light objects dropping on the ground.
Drop (normal) : Applied for medium weight objects dropping on the ground.
Drop (heavy) : Applied for heavy objects dropping on the ground.
Jump landing :Applied for characters landing on the ground after a jump or fall.
These types will be supported by the environment simulation in walkthrough mode. But you can apply any other
type that might be supported by your own sound engine.
With <Volume> the playback volume (in percentage of original volume) of this sound can be set. Using the
button additional dependency functions for the volume can be applied. The Dependency functions are described
in more detail in section 9.2.3. The value given in the text field is always the maximum value. Dependency func­
tions can only reduce this value, never increase it. If a Dependency function had been applied, this is visualized
by a colored button.
In the text field <Additional parameters> you can specify additional playback parameters. Within PnP Terrain­
Creator this field is only used for information, but you can set some values for your own sound engine to imple­
ment some specific playback behaviors.
Information Ground sounds can not only be applied to one texture but also to texture categories and sub cat­
egories. In this way you can for example apply grass sounds to the whole grass texture category
without the need to apply these sounds to every single texture of this category manually.
When applying sounds to the category as well as to single textures below this category, the
sounds applied to a texture will have the higher priority.
Information All texture ground sound information is stored in the file “textures.ttex” in the root directory of your
terrain. You can simply copy and paste this file to other terrain projects if you want to reuse your
settings.

9.2 Environmental Sounds


To place environmental sounds within your terrain you have to open a sector’s detail map first. Then switch to
the environment sounds edit mode by one of the following options:

• Click the icon on the toolbar.


• Select the menu <View, Sounds>

57
• Use the keyboard shortcut <Alt> + <S>

The placements of environmental sounds can be edited in 2D (section 9.2.1) as well as in 3D (section 9.2.2) edit
mode. The main tool window for environmental sound placement can be seen in the following figure.
The upper half of this window contains the Soundbrowser. All environmental sounds ad­
ded to the project are listed within the tree hierarchy control under their subcategories’
names. Double clicking on a sound within the sound browser plays the sound. The
sound playback can also be started by pressing the button. Pressing the button
stops the playback.
The lower half of the window displays information of the currently selected sound place­
ment. The Playlist contains all sounds connected with this sound placement. The sound
currently selected within the Soundbrowser can be added to this Playlist by pressing the
button. Pressing removes the currently selected sound within the Playlist from the
list.
The <Inner radius> of a sound placement is defined as the radius within which the
sound can be heard at its full volume. Its value can be set either directly within the text
field or by using the up/down buttons.
The <Outer radius> of a sound placement is defined as maximum effective range of the
sound.
With <Master volume> the volume of the sounds of the Playlist can be set. The value is interpreted as percent­
age of the original sound’s volume.
Using the buttons additional functions for the corresponding value can be applied. The Dependency func­
tions are described in more detail in section 9.2.3. The value given in the text field is always the maximum value.
Dependency functions can only reduce this value, never increase it. If a Dependency function had been applied,
this is visualized by a colored button.
Some more detailed parameters for the playback of the Playlist can be set by pressing the button or by
double clicking with the left mouse button on a sound placement in 2d or 3d. These settings are described in de­
tail in section 9.2.4.

9.2.1 2d Environmental Sound Editing


To add a sound placement to your terrain select a sound from the sound browser (see section 9.2) first. Then
double click with the left mouse button on an arbitrary position on the sector’s detail map. The newly added
sound placement will be visualized in 2d with two concentric circles. The inner radius will be a solidly filled circle
while the outer radius is transparently filled. The four edges of a rectangle around the inner circle of a sound
placement highlight the currently selected sound placement. You can move a sound placement by dragging it at
its inner solid circle with the left mouse button. To select a sound placement, simply left click on the speaker with
the mouse. When moving the mouse through the 3d viewport, the sound placement currently below the mouse
will be highlighted with a yellow rectangle.
Information Multiple sound placements can be selected by holding down the <Ctrl> key while clicking on an
sound placement.

58
9.2.1.1 Context Menu for a Sound Placement
When right clicking on a sound placement the following context menu will appear:
With <Remove sound> you can delete the currently selected sound placement from the terrain.
With <Create standard sound> you can create an arbitrary number of predefined stand­
ard sound placements. Standard sound placements will be described below.
<Playlist settings> is the default entry of this context menu. Its function is equal to double
clicking on the sound placement. The dialog for more detailed sound placement and
playlist definitions described in section 9.2.4 will be opened.
If you want a sound to be placed randomly within a given
area you can define this area by selecting the <Define
random area> entry of the context menu. The border of
this random area is defined by a line list. After selecting
the context menu entry you can define the line segments
by simply clicking with the left mouse button. You can end
and close the borderline by a single right click with the
right or a double click with the left mouse button.
The initial color in which a sound placement is visualized in 2d is given by the default color (see section 9) of the
first sound added to the sound placement. You can change this color later on by selecting the <Change color>
entry of the context menu.

With <Cut> or the keyboard shortcut <Ctrl>+<X> the sound placement can be removed from the terrain and
copied to the clipboard.

59
Using the <Copy> entry of the context menu you can copy the whole sound placement definition to the clipboard
and later add the same definition to a different position of your terrain using the context menu for free space as
described in the next subsection. The usual keyboard shortcut <Ctrl>+<C> can be used too for copying the
sound placement.
9.2.1.2 Context Menu for Free Space
If you right click within free space of the sector’s detail map the following context menu will appear:
The default entry of this context menu is <Add sound>. This is equal to double clicking in
free space on the sector’s detail map and will add a new sound placement with the cur­
rently selected sound from the sound browser to your terrain.
<Add standard sound> will add a new sound placement from the predefined standard
sound placements to your terrain. Standard sound placements will be described below.
<Paste> will add a new sound placement with the same definition as the sound place­
ment previously copied to the clipboard using the sound placement’s context menu de­
scribed before. The usual keyboard shortcut <Ctrl>+<V> can be used too for inserting
the sound placement from the clipboard.

9.2.1.3 Standard Sound Placements


Using the context menus as described before you can create an arbitrary number of standard sound placement
definitions. You can build a whole database of different standard sound placements. In this way standard sound
placements will help you efficiently create a world of environmental sounds.
When selecting <Create standard sound> from the sound placement’s context menu the following dialog will ap­
pear:
The list <Available standard sound placements> contains all standard sound
placement definitions created so far.
Enter the name of the new standard sound placement to be created in the text
field <Standard sound placement name>. Pressing the button <Save> will
save this definition to the “sounds.tsnd” file of the terrains root directory If a
standard sound placement with the same name already exists, you will be
prompted to overwrite the previous definition.
You can delete any standard sound placement definition by first selecting it
within the list and pressing the button afterwards.
The dialog appearing when selecting <Add standard sound> from the free
space context menu is very similar to the dialog described before.
You can select a sound placement definition from the list of available standard
sound placements or alternatively enter its name in the text field <Standard
sound placement name>. Double clicking an entry of the list or pressing the
<Load> button will create a new sound placement from the selected definition.

9.2.2 3D Environmental Sound Editing


The 3d environmental sound editing is very similar to the 2d editing described in 9.2.1. A sound placement is
visualized in 3d with a speaker model.
If the sound placement is within hearing range, it will be visualized in green and if it is outside the hearing range,
it is red. The currently selected sound placement is visualized with a small coordinate system in it’s middle and a
red bounding box around it, as can be seen from the following image. To select a sound placement, simply left
click on the speaker with the mouse. When moving the mouse through the 3d viewport, the object currently be­
low the mouse will be highlighted with a yellow box.
Information Multiple sound placements can be selected by holding down the <Ctrl> key while clicking on an
sound placement.

60
The functionalities for adding, removing and editing sound placements work exactly as described for 2d environ­
mental sound editing in section 9.2.1. Only the context menu functions <Define random area> and <Change col­
or> are not available in 3d.
To move a sound placement in 3d simply drag one axis of the sound placement’s coordinate system with the left
mouse button. The sound placement will follow the mouse movements along the selected axis. The movement
along the sound placement’s up axis is restricted to the terrain’s height. So you can not move a sound place­
ment below the terrain surface.
9.2.2.1 Alternative 3D move mode for Sound Placements
Moving sound placements by dragging the axes of their coordinate systems as described before makes it pos­
sible to change to position of a sound placement very precisely. However for the gross positioning or for larger
movements this method is impractical.
For this purpose a second movement mode is implemented: First select the sound to be moved in the usual
way. Afterwards press the <Alt> key and hold it down. Now click with the left mouse button on the same sound
and keep the mouse button pressed. If you move the mouse, while holding the left mouse button and the <Alt>
key pressed, the selected sound will follow the mouse pointer's movements and keep a constant height over
ground while moving over the terrain.
Information This movement mode works best, if viewing from some height down on the terrain.
9.2.2.2 3D Environment Sound Simulation
Activate the check box Sound simulation within the tool dialog Environment simulation. You can set all environ­
ment conditions using the sliders within this dialog (refer to 9.2.4). As you move through the sector you can hear
the simulated environment sounds exactly as you defined them.
If you activate the check box Walkthrough your movements are simulated in the way of a first-person-game. The
viewing height will be locked to 1.7m and you can hear the sounds of your foot steps on the ground. (not yet im­
plemented)

9.2.3 Sound Dependency Functions


With Dependency functions sound parameters like volume or radius can be controlled and adapted to current
environmental conditions.

61
All dependency functions compute a factor within the range between 0 and 1 to be multiplied with the base value
defined for the sound parameter. So dependency functions can only decrease the base value never increase it.
The resulting factor can be defined in dependency of up to 6 en­
vironmental conditions: time, lightness, temperature, season,
wind and precipitation. The dependency of an environment con­
dition can be activated with the corresponding checkbox. The
functions diagram will switch from gray to green when activated.
You can move the control points of a function up and down with
the mouse by holding the left mouse button pressed. A right
click within the diagram will add a new control point at the cur­
rent mouse position. A double click with the right mouse button
over one control point will remove this point from the diagram.
The environmental conditions time and season are cyclic. So
the last value will always be the same as the first.
Within the text field <Additional textual dependency function>
textual functions for the sound dependency can be set. With the
current version of PnP TerrainCreator this field is unused. You
can use it to place comments or functions in your own scripting
language supported by the target application or engine to which
you will export the terrain. For future versions of PnP Terrain­
Creator there will be support for syntax highlighting and check­
ing for user defined scripting languages.
To increase efficiency in defining Dependency functions it is
possible to save an arbitrary number of such functions and cre­
ate a database with all functions needed for a terrain. The actu­
al settings of the dependency function can be stored by press­
ing the <Save Predef.> button. The following dialog will appear.

62
In the upper left part of this dialog there is a list containing all predefined dependency functions create by now.
Enter a name for the new dependency function in the text field <Sound dependency function name> and press
the <Save> button to store the functions definition to the “sounds.tsnd” file of the terrains root directory. If a de­
pendency function with the same name already exists, you will be prompted to overwrite the previous function
definition.
You can delete any dependency function by first selecting it within the list and pressing the button afterwards.
You can load a predefined dependency function for one sound placement parameter in almost the same way.
Press the <Load Predef.> button and select a sound dependency function from the list. Double click on the de­
pendency function’s name within the list or hit the <Load> button to apply the selected dependency function to
your sound’s property.

9.2.4 Sound Playlist Settings


Detailed playback definitions for the sounds of a playlist can be set within the <Sound playlist settings> dialog.
This dialog can be opened by double clicking on a sound placement, pressing the <Settings> button of the
sound tool window or selecting <Playlist settings> from the context menu of a sound placement when right click­
ing on a sound placement. The definable parameters of a playlist will be described in the following sub sections.

9.2.4.1 Playlist playback type


With the combo box in the upper left corner the playback type of this playlist can be defined. Three different
types are available:
• Sequential playback: All sounds of the playlist will be played exactly in the same order as defined in
the list. If this playback mode is selected buttons will appear, with which the currently selected
sound can be moved up and down within the playlist.
• Random order playback: The sounds of the playlist will be played in random order.
• Simultaneous playback: All sounds of the playlist will be played simultaneously.

9.2.4.2 General playlist settings


Within the definition section for general playlist settings you can define the maximum number of sounds of this
playlist that can be played simultaneously. This setting can only be applied for random or simultaneous playback
types.
9.2.4.3 Sound playback settings
The definition within this section depend on the currently selected sound of the playlist. The sound dependency
function for <Volume/Radius> can adjust the values set for the whole sound placement.

63
The parameter <Rnd. probability> defines the probability to play this sound of the playlist. The values for this
parameter have to be within the range between 0 (will never be played) and 100 (very high playback probability).
This parameter is only activated for random order playback playlists.
9.2.4.4 Sound transitions
The transition/delay between sounds to be played from the playlist can be defined here. Two different transition
types can be selected from the combo box:
• Undelayed playback: Starts the playback of the next sound immediately after the playback of the previ­
ous one finishes.
• Random delay: Waits a random time within a definable time span before playing the next sound.

If random delay is selected, the two input fields <min delay (s)> and <max delay (s)> are activated. These val­
ues define the minimum resp. maximum delay time to wait before starting the playback of the next sounds in
seconds. The randomly generated delay time will be somewhere between min and max. The sound dependency
functions for these parameters can be used to adjust its value between 0 and the entered value.
9.2.4.5 Environment sound simulation
With the environment sound simulation you can test the sound settings you defined. You can set all of the sup­
ported environment conditions. By clicking the button the environmental sound for the given conditions is sim­
ulated.
You can set the environment conditions by placing the sliders in the following way:

• sets the current day time.


• sets the month.
• sets the current lightning condition.
• sets the temperature.
• sets the current wind speed.
• sets the amount of precipitation.

The effects of these environment settings are described in section 2.4.4.

9.3 Sound PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the sound engine PlugIns that were shipped with the PnP TerrainCreator will
be described in more detail. Remember: If you use 3rd party or your own PlugIns they could behave in very differ­
ent ways than described here. So please refer to the documentation of the used PlugIn, if available.

9.3.1 fmod Sound Engine (PnPTC)


This is the default sound engine PlugIn for the PnP TerrainCreator. It’s based on the fmod sound system
(www.fmod.org). With this PlugIn you can use .wav, .asf, .aiff, .dls, .flac, .mp2, .wma, and .ogg files as source
for environmental and ground sounds. Place the sound file you want to use into the “SOUNDS” folder below your
terrain project’s base directory. To make the automated categorization and import routines work you have to
copy the files into specific subfolders. For ground sounds you have to use the folder “GROUND” under the
“SOUNDS” folder. For environmental sounds you have to use the “ENVIRONMENT” folder. Within these folders
you can create an arbitrary number of folders that will represent the subcategories within the sound browser.

The PlugIn will scan all the contents of the following folders:
• “SOUNDS\GROUND”
• “SOUNDS\ENVIRONMENT”
• “SOUNDS\GROUND\<subcategory>”
• “SOUNDS\ENVIRONMENT\<subcategory>”

Example To use a file “EAGLE.WAV” as environmental sound within the subcategory “BIRDS” you have to
place the file in the following folder:
“SOUNDS\ENVIRONMENT\BIRDS\EAGLE.WAV”

64
Information All sound files must have different names, as the file name is the main identifier of a sound. So
make sure that there are no duplicated file names in the different sub folders. The PlugIn will dis­
play a warning message at load time if there are duplicated sound file names.

65
10 Roads and Rails

Coming soon.

66
11 Additional Functionalities

11.1 User Defined Data Elements


User defined data elements are a means of applying any kind of parameters to all types of objects within PnP
TerrainCreator, which can later on be used (for example in a game engine) to control specific aspects of an ob­
ject; this can for example be rendering or game play parameters. The process of applying user defined data ele­
ments is divided into two steps. First the data elements have to be defined, next they can be applied set for the
objects within PnP TerrainCreator.

11.1.1 Defining User Defined Data Elements


As a first step, all data elements which should be
used have to be defined. This can be done via the
menu <Settings, User defined data elements...>.
In the following dialog all relevant data can be spe­
cified.
First the usage of the data elements to be dis­
played/edited has to be selected in the <Usage>
drop down list. The following usages are possible.
● Object data: will be used in the object
definition of the object manager (chapter
8.1).
● Object placement: will be used for the
object placements on the terrain surface
(chapter 8.2).
● Tree data: will be used in the tree definition of the vegetation manager (chapter 7.2.1).
● Tree placement: will be used for the tree placements on the terrain surface (chapter 7.2.3).
● Grass data: will be used in the grass definition of the vegetation manager (chapter 7.3.1).
● Texture data: will be used in the texture definition of the texture manager (chapter 5.2).
For each usage/category an arbitrary number of data elements can be created. Create a new data element by
pressing the button above the <Data elements> list box. The list of all data elements for the selected
usage/category is displayed in the <Data elements> list box. Select one element of this list to view its details in
the <Data element definition> frame. The selected element can be deleted by pressing the button above the
<Data elements> list box. Each data element should have a meaningful name, which can be applied in the
<Name> text field. Furthermore the type of each data element has to be specified in the <Data type> drop down
list. The following types are available.
● String: When this element is used/applied, a text can be entered for
this data element. In the definition dialog (see image to the right) a
default string can be set.
● Integer: When this element is used/applied, an integer number can
be entered for this data element. In the definition dialog a default
number can be set.
● Real: When this element is used/applied, a real number can be entered for this data element. In the
definition dialog a default number can be set.
● Boolean: When this element is used/applied, a boolean value (True or False) can be entered for this
data element. In the definition dialog a default value can be set.
● Selection: When this element is used/applied, the user can select an entry from a predefined list of val­
ues (see image at the beginning of this chapter). The list of predefined values is displayed in the <Val­
ues> list. New values can be added by pressing the button above the <Values> list box. The cur­
rently selected value can be deleted by pressing the button above the <Values> list box. The arrow
key right to the <Values> list box can be used to change the order of the predefined values. The <allow
“no selection”> check box specifies, whether or not the user has to select anything for this data element

67
or if an empty (no selection) selection is valid too. Finally the default selection can be set in the <Default
value> drop down list box.
Information All user defined data element definitions are stored in the file “userdefined.dat” in the root direct­
ory of your terrain. You can simply copy and paste this file to other terrain projects if you want to
reuse your definitions.

11.1.2 Applying User Defined Data Elements


Now that we have defined these data element,
we also want to apply them to our objects (ob­
jects, trees, grasses, placements, etc.) in the
PnP TerrainCreator terrain project.
Lets open the object manager for example
(chapter 8.1), as we have added the user
defined data elements to the object data usage
type the chapter before. On the <User defined
data> tab the data element definitions will be
shown in form of a property grid exactly as we
have defined them before. Here you can spe­
cify/apply the your user defined data to the
user defined data elements.

11.2 Input Devices


Besides the mouse and keyboard, which are the most common input devices, PnP TerrainCreator supports two
more types of input devices, which have a couple of benefits, when working with PnP TerrainCreator. Both will
be described in the following two sub sections.

11.2.1 Space Mouse


The space mouse (www.3dconnexion.com) is an input device, which enables free space movements in 6D. So
you can control 3 translational and 3 rotational degrees of freedom at the same time, using such a device. With­
in PnP TerrainCreator the space mouse can be used to navigate within 3D view mode. So the first functionality
is the movement of the camera, which is visualized by the sign in the upper left region of the viewport.
Additionally it can be used in 2D to move the detail map if it doesn't fully fit into the viewport area.
By clicking the first button of the space mouse or by selecting <Move selection> from the
context menu of the space mouse, the space mouse is switched to the object interaction
mode . In this mode, the mouse can be used to move objects (object place­
ments, tree placements, or sound placements) in the scene in 3D as well as in 2D mode.
The space mouse configuration (sensitivity etc.) can be set in the 3D connexion control panel, which is installed
with the space mouse driver. You should create a profile named “PnP TerrainCreator”. This profile will be selec­
ted automatically by PnP TerrainCreator if the space mouse is used.

11.2.2 Pressure Sensitive Pen Tablet


Pressure sensitive pen tablet can be used, wherever a mouse interaction is possible. Additional functionality is
achieved by a pressure sensitive tablet in the following edit mode.
Heightmap editing: The pressure is used to control the maximal gradient of the used fall-off effect.
Heightmap filtering: The pressure is used individually by the filter PlugIn. In general it controls/adapts the first
parameter which can be set for the PlugIn.

68
12 Physics Simulation

Physics simulation is a powerful feature of PnP TerrainCreator, that allows you to interact­
ively test the behaviour of characters, vehicles and any other physical object on your ter­
rain. Using the PlugIn interface you can integrate the physic engine used for your game
and test whether or not a modeled level is good to be played.
The physic simulation PlugIn can be selected within the <3D view settings> (section 2.4.1).
All parameters required to run the PlugIn can also be set there.
The physic simulation can be started from a sector's 3D view. Checking the check box <Physics simulation>
within the <Environment simulation> tool window starts the physics simulation. The physics simulation can be
stopped anytime by pressing <ESC>.

12.1 Physics Simulation PlugIns shipped with PnP TerrainCreator


Within the following sub section(s) the physics simulation PlugIns that were shipped with the PnP TerrainCreator
will be described in more detail. Remember: If you use 3rd party or your own PlugIns they could behave in very
different ways than described here. So please refer to the documentation of the used PlugIn, if available.

12.1.1 ODE Physics Simulation (PnPTC)


This is the default physics simulation PlugIn for the
PnP TerrainCreator. It’s based on the free ODE phys­
ics engine (www.ode.org). Within the settings dialog of
this PlugIn (see section 2.4.1) one can select the ob­
ject/vehicle to be simulated.
After starting the physics simulation, the simulated object/vehicle will be placed on the terrain at the current
viewing position. The object/vehicle can be controlled with the cursor keys <UP> accellerates it <DOWN>
brakes it and allows for backwards moving. <LEFT> and <RIGHT> are the steering controls. For cars, the
<SPACE> key activates the hand brakes.

12.1.2 Meqon Physics Simulation (PnPTC)


This is a physics simulation PlugIn which is based on the powerful Meqon physics engine (www.meqon.com). It
has the same settings and control parameters as are described for the ODE engine above. Unfortunately, this
physics engine is no longer available, so we don't maintain it any longer.

69
13 Terrain Import

With PnP TerrainCreator's import functionality it is possible to import heightmaps and every other part of a ter­
rain from data sources created by other programs or from real elevation data sources.

13.1 Importing a single Sector


From the overview map open the context menu of a sector by right clicking with the
mouse on it and select <Import> from the menu. A dialog will open where you can se­
lect the import PlugIn you would like to use. Select the PlugIn from the list and confirm
the selection by clicking <OK> or by double clicking with the left mouse button on the
list item.

13.1.1 Heightmap Import from Bitmap (PnPTC)


This PlugIn can import heightmaps from bitmap files. Possible formats are .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png,
.ppm and .tga. Within the following dialog you can select the color
format of the file to be imported from the <Color mode> drop down
list. With the 8 bit grayscale format the gray values are interpreted
as values within the range from 0 to 255. The 24 bit (r-g-b) and 24
bit (b-g-r) formats use the 3 rgb channels to create one 24 bit num­
ber with r resp. b as least significant byte. This 24 bit integer value
is interpreted as a real number within the range from 0 to 1. If you
use 20000 as <Factor> (see below) you can import the 24 bit bitmap files created with the bitmap exporter (see
14.3.4) achieving the same heights.
By multiplying the color value from the bitmap file as described before with the value of the <Factor> text field,
the height in meters as used within PnP TerrainCreator is computed. An additional <Offset> in meters can be
added to this height value to achieve the final height.

13.1.2 Terrain Import from L3DT


This PlugIn can import heightmaps and texturing directly from L3DT project files
(http://www.bundysoft.com/L3DT/). First select the L3DT project file (.proj) to be
imported. The border size of the L3DT terrain must have the same border size as
the sector border size within PnP TerrainCreator. Next you can decide if the
heightmap and/or the terrain texturing should be imported.
If you are going to import the texturing from the L3DT project, you have to make sure that the texture files used
in L3DT are already available within PnP TerrainCreator during the import operation.

70
13.1.3 Heightmap Import from RAW (PnPTC)
This PlugIn can be used to import heightmaps from files where all height values are stored subsequently without
any further information (header) of the data (raw files). Supported height value repres­
entations are FLOAT (4 Byte) as real values, DWORD (4 Byte), WORD (2 Byte) and
BYTE (1 Byte) as 4, 2 and 1 byte integer values. This format can be selected from the
<Format> drop down list.

By multiplying the height value from the file as described before with the value of the
<Factor> text field, the height in meters as used within PnP TerrainCreator is computed. An additional <Offset>
in meters can be added to this height value to achieve the final height.

71
13.2 Importing the whole Terrain
The import of a whole terrain is started by the menu <File> → <Import> as shown in the image
to the right. The import parameters for the supported file formats are the same as already de­
scribed for the sector import in chapter 13.1.
After the import parameters have been set an additional dialog is opened in which one can
specify how the terrain to be imported is
mapped horizontally to the terrain within PnP
TerrainCreator. The upper right area of this
dialog contains the terrain area of the
source terrain (the terrain to be imported).
The first line <File size> contains the original
size of the source terrain. Depending on the
file format, it is possible to adapt these val­
ues. In the second line <Start offset> the
start offset from which the import should be
started can be selected. This specifies the
lower/left corner of a rectangular terrain re­
gion to be imported. The last line <Import
size> specifies the border size of the rectan­
gular terrain region to be imported.
The upper right area of this dialog contains
the terrain area of the destination terrain
(the PnP TerrainCreator terrain). Here start
offset and import size specify the target rectangle, to which the terrain should be imported.
In the left area, these settings are visualized with colored rectangles.

72
14 Terrain Export

Every bit of the terrains created with PnP TerrainCreator can be exported into any other file or data format. The
terrain export is accomplished using PlugIns, so you can easily create export routines into your own file formats.
The supported export file formats of the PlugIns coming with the installation of PnP TerrainCreator are de­
scribed in section 14.3. We will add more export formats by-and-by.
It is possible to export the whole terrain at once (14.1) or to export only one single sector of the terrain (14.2).

14.1 Exporting the whole Terrain

From the terrain’s overview map select the menu <File, Export>. A dialog will open where
you can select the export PlugIn you would like to use. Select the PlugIn from the list and
confirm the selection by clicking <OK> or by double clicking with the left mouse button on
the list item.

14.2 Exporting a single Sector


From the overview map open the context menu of a sector by right clicking with the
mouse on it and select <Export> from the menu. The following steps are identically to
them described in 14.1.

14.3 Exporter PlugIns


Within the following sub section(s) the exporter PlugIns that were shipped with the PnP
TerrainCreator will be described in more detail. Remember: If you use 3rd party or your own PlugIns they could
behave in very different ways than described here. So please refer to the documentation of the used PlugIn, if
available.

14.3.1 Grass coverage to BMP Export (PnPTC)


This PlugIn exports the grass coverage into bitmap files. After selecting this PlugIn the dialog to the right will
show up. In the drop down list box <File format> the format of the bitmap to be created can be selected. Pos­
sible formats are .bmp, .dds, .dib, .hdr, .jpg and .png.
With the <Patch size> option you can select the border size of the
bitmaps to be created. If you select a patch size smaller than the
border size of a sector, the exporter will divide the sector's grass
coverage map into smaller patches and create separate files for
every patch. The <Flip Y> option flips the exported bitmap vertic­
ally, which is required by some engines for importing terrains.
The <Indexmap> option specifies the output format. If it is not checked, the exporter will create a file for every
grass type on the terrain. The bitmap will be a gray scale bitmap, in which the gray value corresponds to the
density of that grass type at the given terrain location, meaning black 0% coverage and white 100% coverage. If
<Indexmap> is checked, an indexmap is created, which means only one bitmap is created for a sector, in which
the whole grass coverage is represented. PnP TerrainCreator can store up to four different grass coverages for
every single heightmap element. When exporting the grass coverage to an indexmap, all four channels of the
created bitmap (Red, Green, Blue, Alpha) will receive an index of the grass definition applied to the heightmap
73
element. The color value of every bitmap channel represents the ID of a grass type ranging from 1 to 255, where
0 means, that there is no grass coverage at that heightmap position. The correspondence between that numeric
ID and the corresponding grass type is exported into an additional text file which has the following form.
[GRASSES]
NumGrasses=17
Grass001=bush1.x
Grass002=bush2.x
Grass003=fern1.x
Grass004=fern2.x
Grass005=tropical1.x
Grass006=tropical2.x
Grass007=flower1.x
Grass008=flower2.x
Grass009=grass1.x
Grass010=grass2.x
Grass011=grass3.x
Grass012=grass4.x
Grass013=rock1.x
Grass014=rock2.x
Grass015=shrooms1.x
Grass016=twigs1.x
Grass017=twigs2.x

The options for exporting the whole terrain are almost identically to those for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the grass coverage
maps of all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked,
the patch size drop down list is disabled.
Depending on whether one file or multiple files have to be created, you will be prompted for a file name or a des­
tination directory in which the export is stored, as soon as you press <OK>. The following naming convention is
used for the export. When the complete terrain is exported at once but not into one file, the created files have
the format grassmap_<grasstype>_000x_000y. Where x and y stand for the sector indices in x and y direction.
When exporting into an indexmap, grasstype will be empty. If the indexmap format is not used, grasstype will
contain the name/identifier of the the grass type which is contained in the file. Whenever the path size is smaller
than the border size of the terrain sector, the file name will receive an additional suffix of _00n, where n is the in­
dex of the patch within the sector. If the whole terrain is exported into one single file or if only one sector is ex­
ported, the following file naming convention is used: <name>_<grasstype>, where name is the filename which
was manually specified. The rest of the naming convention works exactly as described before.

14.3.2 Heightmap to 3DS Export (PnPTC)


This PlugIn exports the terrain heightmap into a 3DS file. After selecting this PlugIn you will be prompted for a
3DS file to save to or for a folder to store the 3DS files to, depending on whether you selected the export for a
single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create separate 3DS files for
each sector named 000x_000y.3ds within the selected folder, where x and y stand for the sector indices in x and
y direction.
Within the following dialog you can set
some parameters for the export. First you
can set the <scale factor> from meters to
the 3D units used in the created file. The
default value is 100. This is the same
value as it is used within PnP TerrainCre­
ator to display the terrain.
With the <Patch size> parameter you can
divide the sector into smaller patches for
the export. The patches' filenames will be
suffixed by their index within the sector
(for example: 000x_000y_00n.3ds).
With the <Up Axis> drop down list you can define whether you want the up axis of your terrain mesh to point into
Y or Z direction. Y as up axis uses a left-handed coordinate system, Z a right-handed. If your terrain has more
than one sector, you can specify with the <Global positioning> parameter, that the vertex coordinates of the cre­
ated mesh are always stored in world coordinate space. So if you import multiple sectors into another applica­
tion, they will be positioned correctly next to each other. If this option is not set, the vertex coordinate will be in
the coordinate space of the sector, so starting with 0/0 for every sector.

74
When importing .3ds files into 3dsmax, these files have to follow some restrictions regarding naming conven­
tions for mesh, material and texture names. This PlugIn uses by default long and meaningful names for those
elements, which are too long to be imported into 3dsmax. However, other programs and maybe your homemade
.3ds importers will have no problem reading those files. To get the .3ds files correctly imported into 3dsmax, the
<Fully 3ds-max compatible> option has to be checked. All long names will replaced by numeric strings which
can be read by 3dsmax.
The texturing options of the exported heightmap can be set within the <Texture settings> frame. In the <Texture
export> drop down list, one can select between „no textures“ for untextured heightmap and „texturemap“ for tex­
turemap export as described in section 5.5.3. The file format of the exported textures can be selected in the
<Texture format> drop down list. It is possible to combine the texturemap with a lightmap into a single texture file
during export. You can select the lightmap definition you would like to be exported from the <Lightmap> drop
down list. Additionally you can specify the size of the texture maps for the texture map export in the <Tex­
turemap size> drop down list.
Depending on whether the target engine/application reads texture coordinates from the image's top to the bot­
tom or vice versa, it might be necessary to flip the exported textures at a horizontal line through the vertical im­
age center. This can be achieved by activating the <Flip Y> check box. For the import into 3ds-max this option
should be activated.
Finally you can specify a vertex count reduction method in the <Reduction> drop down lost. Possible values are
<no reduction>, <regular>, and <height deviation> which will be described below.
no reduction: Doesn't remove any vertices during export. The regular vertex grid of the heightmap as used
within PnP TerrainCreator is remained with the export.
regular: A regular vertex reduction is performed on the terrain mesh. Which means for example only
every second, fourth, etc. vertex is used for the exported terrain mesh. The parameter <Grid
size> controls which vertices are used for the export.
height deviation: This is an irregular vertex reduction method, which means the resulting mesh is not a regular
grid anymore. The parameter <Error value> specifies the maximum vertical error that might
be acceptable during the export operation. Therefore this parameter is a threshold value. If
removing a vertex will result into a vertical error smaller than this <Error value>, then the ver­
tex can be removed during export. With a second parameter <Reduce border> one can pre­
vent the exporter from reducing vertices at the border of a sector/patch. If this check box is
unchecked, vertices at the border of a sector/patch will never be removed.
Information Unfortunately blended detail textures using vertex alpha seems to be impossible for 3DS files. We
will try to use a different blend mode for export in future versions.

14.3.3 Heightmap to B3D Export (PnPTC)


This PlugIn exports the terrain heightmap into a Blitz3D B3D file. After selecting this PlugIn you will be prompted
for a B3D file to save to or for a folder to store the B3D files to, depending on whether you selected the export
for a single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create separate B3D
files for each sector named 000x_000y.b3d within the selected folder, where x and y stand for the sector indices
in x and y direction.
Within the following dialog you can set
some parameters for the export. First
you can set the <scale factor> from
meters to the 3D units used in the cre­
ated file. The default value is 100. This is
the same value as it is used within PnP
TerrainCreator to display the terrain.
With the <Patch size> parameter you
can divide the sector into smaller
patches for the export. If you select a
patch size smaller than 1024 (the sec­
tor's size), the exporter will create separ­
ate files for the single patches. The
patches' filenames will be suffixed by their index within the sector (for example: 000x_000y_00n.b3d).
With the <Up Axis> drop down list you can define whether you want the up axis of your terrain mesh to point into
Y or Z direction. Y as up axis uses a left-handed coordinate system, Z a right-handed. If your terrain has more
than one sector, you can specify with the <Global positioning> parameter, that the vertex coordinates of the cre­

75
ated mesh are always stored in world coordinate space. So if you import multiple sectors into another applica­
tion, they will be positioned correctly next to each other. If this option is not set, the vertex coordinate will be in
the coordinate space of the sector, so starting with 0/0 for every sector.
The texturing options of the exported heightmap can be set within the <Texture settings> frame. In the <Texture
export> drop down list, one can select between „no textures“ for untextured heightmap, „detail textures“ for the
blended detail textures as described in section 5.1 and 5.5.2, and „texturemap“ for texturemap export as de­
scribed in section 5.5.3. The file format of the exported textures can be selected in the <Texture format> drop
down list. It is possible to combine the texturemap with a lightmap into a single texture file during export. You
can select the lightmap definition you would like to be exported from the <Lightmap> drop down list. Additionally
you can specify the size of the texture maps for the texture map export in the <Texturemap size> drop down list.
Depending on whether the target engine/application reads texture coordinates from the image's top to the bot­
tom or vice versa, it might be necessary to flip the exported textures at a horizontal line through the vertical im­
age center. This can be achieved by activating the <Flip Y> check box.
Finally you can specify a vertex count reduction method in the <Reduction> drop down lost. Possible values are
<no reduction>, <regular>, and <height deviation> which will be described below.
no reduction: Doesn't remove any vertices during export. The regular vertex grid of the heightmap as used
within PnP TerrainCreator is remained with the export.
regular: A regular vertex reduction is performed on the terrain mesh. Which means for example only
every second, fourth, etc. vertex is used for the exported terrain mesh. The parameter <Grid
size> controls which vertices are used for the export.
height deviation: This is an irregular vertex reduction method, which means the resulting mesh is not a regular
grid anymore. The parameter <Error value> specifies the maximum vertical error that might
be acceptable during the export operation. Therefore this parameter is a threshold value. If
removing a vertex will result into a vertical error smaller than this <Error value>, then the ver­
tex can be removed during export. With a second parameter <Reduce border> one can pre­
vent the exporter from reducing vertices at the border of a sector/patch. If this check box is
unchecked, vertices at the border of a sector/patch will never be removed.
Information It seems as if 128 is the maximum patch size that Blitz can read directly.

14.3.4 Heightmap to BMP Export (PnPTC)


This PlugIn exports the terrain heightmap into a standard bitmap file. After selecting this PlugIn you will be
prompted for a bitmap file to save to or for a folder to store the bitmap files to, depending on whether you selec­
ted the export for a single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create
separate bitmap files for each sector named 000x_000y.bmp within the selected folder, where x and y stand for
the sector indices in x and y direction.
14.3.4.1 Exporting a single sector
When exporting a single sector the following dialog will
open. First you can select the <File format> of the bitmap to
be created. Possible formats are .bmp, .dds, .dib, .hdr, .jpg
and .png. Furthermore you can select whether or not you
would like to create a grayscaled bitmap or a colored bitmap
by selecting the appropriate value from the <Color mode>
drop down list. If you select Current color scale from the list,
the bitmap will have the same color scale as the terrain is
currently displayed within PnP TerrainCreator. If the terrain is currently display as a grayscale, this will have the
same result as selecting 8 bit Grayscale from the list.
The formats 24 bit (r-g-b) and 24 bit (b-g-r) scale the maximal height range of 20000 meters to an 24 bit integer
value using the 3 color channels using r resp. b as least significant byte. So if you devide the 24 bit rgb value
from the bitmap file by 16777215 (the maximum value for 24 bit) and afterwards multiply it by 20000, you will get
the meters values as used within PnP TerrainCreator.
Exporting the heightmap to a bitmap will result in a limited height resolution, in particular when using the height
range of the whole terrain. By selecting <Sector> from the <Height range> drop down list the export will scale
the available colors to the height range of the exported sector. Using the <Terrain> entry of the list will scale the
colors to the height range of the terrain. With the <Patch size> option you can select the border size of the bit­
maps to be created. If you select a patch size smaller than the border size of a sector, the exporter will divide the
sector's heightmap into smaller patches and create separate files for every patch.

76
The <Flip Y> option flips the exported bitmap vertically. Using the <Size + 1> option, the exported bitmap is in­
creased by on pixel in vertical and horizontal direction. If the exported sector has a neighbour sector, this extra
pixel will be taken from that neighbour. If there is no neightbour sector in that direction the last pixel of the cur­
rent sector is repeated. Both options are required by some engines for importing terrains.
14.3.4.2 Exporting the whole terrain
When exporting the whole terrain the following dialog will
open, where you can select the file format, the color mode
and the patch size for the exported bitmap as described in
the previous section. Additionally you can specify whether or
not you want to combine the heightmaps of all sectors into
one single huge bitmap by checking the <One file> check
box. If that option is checked, the patch size drop down list is
disabled.

14.3.5 Heightmap to OBJ-File Export (PnPTC)


This PlugIn exports the terrain heightmap into a OBJ file. After selecting this PlugIn you will be prompted for a
OBJ file to save to or for a folder to store the OBJ files to, depending on whether you selected the export for a
single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create separate OBJ files for
each sector named 000x_000y.obj within the selected folder, where x and y stand for the sector indices in x and
y direction.
Within the following dialog you
can set some parameters for
the export. First you can set
the <scale factor> from meters
to the 3D units used in the cre­
ated file. The default value is
100. This is the same value as
it is used within PnP Terrain­
Creator to display the terrain.
With the <Patch size> para­
meter you can divide the sector
into smaller patches for the ex­
port. If you select a patch size
smaller than 1024 (the sector's size), the exporter will create separate files for the single patches. The patches'
filenames will be suffixed by their index within the sector (for example: 000x_000y_00n.obj).
With the <Up Axis> drop down list you can define whether you want the up axis of your terrain mesh to point into
Y or Z direction. Y as up axis uses a left-handed coordinate system, Z a right-handed. If your terrain has more
than one sector, you can specify with the <Global positioning> parameter, that the vertex coordinates of the cre­
ated mesh are always stored in world coordinate space. So if you import multiple sectors into another applica­
tion, they will be positioned correctly next to each other. If this option is not set, the vertex coordinate will be in
the coordinate space of the sector, so starting with 0/0 for every sector.
The texturing options of the exported heightmap can be set within the <Texture settings> frame. In the <Texture
export> drop down list, one can select between „no textures“ for untextured heightmap and „texturemap“ for tex­
turemap export as described in section 5.5.3. The file format of the exported textures can be selected in the
<Texture format> drop down list. It is possible to combine the texturemap with a lightmap into a single texture file
during export. You can select the lightmap definition you would like to be exported from the <Lightmap> drop
down list. Additionally you can specify the size of the texture maps for the texture map export in the <Tex­
turemap size> drop down list.
Depending on whether the target engine/application reads texture coordinates from the image's top to the bot­
tom or vice versa, it might be necessary to flip the exported textures at a horizontal line through the vertical im­
age center. This can be achieved by activating the <Flip Y> check box.
Finally you can specify a vertex count reduction method in the <Reduction> drop down lost. Possible values are
<no reduction>, <regular>, and <height deviation> which will be described below.
no reduction: Doesn't remove any vertices during export. The regular vertex grid of the heightmap as used
within PnP TerrainCreator is remained with the export.
regular: A regular vertex reduction is performed on the terrain mesh. Which means for example only
every second, fourth, etc. vertex is used for the exported terrain mesh. The parameter <Grid
size> controls which vertices are used for the export.
77
height deviation: This is an irregular vertex reduction method, which means the resulting mesh is not a regular
grid anymore. The parameter <Error value> specifies the maximum vertical error that might
be acceptable during the export operation. Therefore this parameter is a threshold value. If
removing a vertex will result into a vertical error smaller than this <Error value>, then the ver­
tex can be removed during export. With a second parameter <Reduce border> one can pre­
vent the exporter from reducing vertices at the border of a sector/patch. If this check box is
unchecked, vertices at the border of a sector/patch will never be removed.
Information Unfortunately blended detail textures using vertex alpha seems to be impossible for obj files.

14.3.6 Heightmap to OGRE xml mesh Export (PnPTC)


This PlugIn exports the terrain heightmap into an OGRE XML mesh file. After selecting this PlugIn you will be
prompted for a xml file to save to or for a folder to store the xml files to, depending on whether you selected the
export for a single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create separate
xml files for each sector named 000x_000y.xml within the selected folder, where x and y stand for the sector in­
dices in x and y direction.
Within the following dialog you can
set some parameters for the ex­
port. First you can set the <scale
factor> from meters to the 3D
units used in the created file. The
default value is 100. This is the
same value as it is used within
PnP TerrainCreator to display the
terrain.
With the <Patch size> parameter
you can divide the sector into
smaller patches for the export. If
you select a patch size smaller
than 1024 (the sector's size), the
exporter will create separate files for the single patches. The patches' filenames will be suffixed by their index
within the sector (for example: 000x_000y_00n.xml).
With the <Up Axis> drop down list you can define whether you want the up axis of your terrain mesh to point into
Y or Z direction. Y as up axis uses a left-handed coordinate system, Z a right-handed. If your terrain has more
than one sector, you can specify with the <Global positioning> parameter, that the vertex coordinates of the cre­
ated mesh are always stored in world coordinate space. So if you import multiple sectors into another applica­
tion, they will be positioned correctly next to each other. If this option is not set, the vertex coordinate will be in
the coordinate space of the sector, so starting with 0/0 for every sector.
The texturing options of the exported heightmap can be set within the <Texture settings> frame. In the <Texture
export> drop down list, one can select between „no textures“ for untextured heightmap, „detail textures“ for the
blended detail textures as described in section 5.1 and 5.5.2, and „texturemap“ for texturemap export as de­
scribed in section 5.5.3. The file format of the exported textures can be selected in the <Texture format> drop
down list. Additionally a lightmap can be exported and added to the generated terrain mesh. Simply select the
lightmap, which you want to export from the <Lightmap> drop down list. If you use the „texturemap“ as texturing
mode, you have the possible to combine the texturemap with the lightmap into a single texture file during export
by checking the <Combine> check box. Additionally you can specify the size of the texture maps for the texture
map export in the <Texturemap size> drop down list.
If the <Noise overlay texture> check box is activated, the noise texture used within PnP TerrainCreator will be
exported and added as additional texturing pass to the generated terrain mesh.
Depending on whether the target engine/application reads texture coordinates from the image's top to the bot­
tom or vice versa, it might be necessary to flip the exported textures at a horizontal line through the vertical im­
age center. This can be achieved by activating the <Flip Y> check box.
Finally you can specify a vertex count reduction method in the <Reduction> drop down lost. Possible values are
<no reduction>, <regular>, and <height deviation> which will be described below.
no reduction: Doesn't remove any vertices during export. The regular vertex grid of the heightmap as used
within PnP TerrainCreator is remained with the export.

78
regular: A regular vertex reduction is performed on the terrain mesh. Which means for example only
every second, fourth, etc. vertex is used for the exported terrain mesh. The parameter <Grid
size> controls which vertices are used for the export.
height deviation: This is an irregular vertex reduction method, which means the resulting mesh is not a regular
grid anymore. The parameter <Error value> specifies the maximum vertical error that might
be acceptable during the export operation. Therefore this parameter is a threshold value. If
removing a vertex will result into a vertical error smaller than this <Error value>, then the ver­
tex can be removed during export. With a second parameter <Reduce border> one can pre­
vent the exporter from reducing vertices at the border of a sector/patch. If this check box is
unchecked, vertices at the border of a sector/patch will never be removed.

14.3.7 Heightmap to RAW Export (PnPTC)


This PlugIn generates a file containing the raw heightmap values as a sequence of 4-byte floats without any ad­
ditional meta data. The heightmap is exported row by row (first x then y). After selecting this PlugIn you will be
prompted for a file to save to or for a folder to store the files to, depending on whether you selected the export
for a single sector or the whole terrain. When exporting the whole ter­
rain, this PlugIn will create separate raw files for each sector named
000x_000y.raw within the selected folder, where x and y stand for the
sector indices in x and y direction.
The format in which the height values a stored in the file can be selec­
ted from the <Format> drop down list. Possible values are FLOAT for
real number values (this is the original format used within PnP Terrain­
Creator and the format with the best height resolution. DWORD is a 4
byte, WORD a 2 byte and BYTE a single byte integer representation. Note that all integer format might lead to a
reduced height resolution and might also require to set a height scaling factor, to bring the values into the range
of the data type. With the <Factor> parameter, you can specify a value, by which all height values are multiplied
before they are converted into the destination format and written to the file. With the <Patch size> option you can
select the border size of the bitmaps to be created. If you select a patch size smaller than the border size of a
sector, the exporter will divide the sector's heightmap into smaller patches and create separate files for every
patch. Some programs and engines require the heightmaps to be of the border size n+1. So with the <Size + 1>
option you can specify, that the heightmap is extended to the right and top by one element for export. The <Flip
Y> option flips the exported heightmap vertically. The <Offset to zero> specifies whether or not all height values
should be offset to zero by subtracting the minimal height of the terrain.
Using the <Full scale> option, the actual height range of the terrain is scaled to the maximum value range of the
export data format ensuring the best possible vertical resolution of that data format. If the data format is FLOAT,
all heights are scaled to the range 0 to 1. If this option is selected, the <Factor> option is ignored.
The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the heightmaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.

14.3.8 Heightmap to X-File Export (PnPTC)


This PlugIn exports the terrain heightmap into a DirectX X file. After selecting this PlugIn you will be prompted
for a X file to save to or for a folder to store the X files to, depending on whether you selected the export for a
single sector or the whole terrain. When exporting the whole terrain, this PlugIn will create separate X files for
each sector named 000x_000y.x within the selected folder, where x and y stand for the sector indices in x and y
direction.
Within the following dialog you can
set some parameters for the export.
First you have to choose between
text and binary export. We suggest
to use the binary export, as the cre­
ated file is approximately half the
size of the text format file and can be
loaded much faster into other pro­
grams. Next you can set the <scale
factor> from meters to the 3D units

79
used in the created file. The default value is 100. This is the same value as it is used within PnP TerrainCreator
to display the terrain.
With the <Patch size> parameter you can divide the sector into smaller patches for the export. If you select a
patch size smaller than 1024 (the sector's size), the exporter will create separate files for the single patches. The
patches' filenames will be suffixed by their index within the sector (for example: 000x_000y_00n.x).
With the <Up Axis> drop down list you can define whether you want the up axis of your terrain mesh to point into
Y or Z direction. Y as up axis uses a left-handed coordinate system, Z a right-handed. If your terrain has more
than one sector, you can specify with the <Global positioning> parameter, that the vertex coordinates of the cre­
ated mesh are always stored in world coordinate space. So if you import multiple sectors into another applica­
tion, they will be positioned correctly next to each other. If this option is not set, the vertex coordinate will be in
the coordinate space of the sector, so starting with 0/0 for every sector.
The texturing options of the exported heightmap can be set within the <Texture settings> frame. In the <Texture
export> dropdown list, one can select between „no textures“ for untextured heightmap, „detail textures“ for the
blended detail textures as described in section 5.1 and 5.5.2, and „texturemap“ for texturemap export as de­
scribed in section 5.5.3. The file format of the exported textures can be selected in the <Texture format> drop­
down list. It is possible to combine the texturemap with a lightmap into a single texture file during export. You
can select the lightmap definition you would like to be exported from the <Lightmap> drop down list. Additionally
you can specify the size of the texture maps for the texture map export in the <Texturemap size> drop down list.
Depending on whether the target engine/application reads texture coordinates from the image's top to the bot­
tom or vice versa, it might be necessary to flip the exported textures at a horizontal line through the vertical im­
age center. This can be achived by activating the <Flip Y> check box.
Finally you can specify a vertex count reduction method in the <Reduction> drop down lost. Possible values are
<no reduction>, <regular>, and <height deviation> which will be described below.
no reduction: Doesn't remove any vertices during export. The regular vertex grid of the heightmap as used
within PnP TerrainCreator is remained with the export.
regular: A regular vertex reduction is performed on the terrain mesh. Which means for example only
every second, fourth, etc. vertex is used for the exported terrain mesh. The parameter <Grid
size> controls which vertices are used for the export.
height deviation: This is an irregular vertex reduction method, which means the resulting mesh is not a regular
grid anymore. The parameter <Error value> specifies the maximum vertical error that might
be acceptable during the export operation. Therefore this parameter is a threshold value. If
removing a vertex will result into a vertical error smaller than this <Error value>, then the ver­
tex can be removed during export. With a second parameter <Reduce border> one can pre­
vent the exporter from reducing vertices at the border of a sector/patch. If this check box is
unchecked, vertices at the border of a sector/patch will never be removed.
Information Unfortunately the textures are not blended if the exported X file is opened with Microsoft's mesh
viewer. So maybe such blending techniques are not supported by X files.

14.3.9 Lightmap to BMP Export (PnPTC)


This PlugIn exports the precomputed sector lightmaps into a bitmap file. After select­
ing this PlugIn you will be prompted for a bitmap file to save to or for a folder to store
the bitmap files to, depending on whether you selected the export for a single sector
or the whole terrain. When exporting the whole terrain, this PlugIn will create separate
bitmap files for each sector named lightmap_<name>_000x_000y.bmp within the se­
lected folder, where x and y stand for
the sector indices in x and y direction
and <name> for the name of the ex­
ported lightmap.
Within the export options dialog you can first select the <File
format> of the bitmap to be created. Possible formats are
.bmp, .dds, .dib, .hdr, .jpg and .png. Second you can select the
lightmap definition for which the lightmap textures should be ex­
ported from the <Lightmap name> drop down list. With the
<Patch size> option you can select the border size to be covered by the lightmap to be created. If you select a
patch size smaller than the border size of a sector, the exporter will divide the sector's lightmap into smaller
patches and create separate files for every patch.

80
If a terrain is divided into separate lightmaps for each sector or for smaller patch sizes and two neighboring
maps are to be rendered, it is important to avoid visible edges between two maps. To avoid these edges the tex­
tures have to be sampled over their borders into the neighboring patch or sector. To solve this problem it is a
common technique to add the first pixels of every column and row of the neighboring textures to the texture and
set the uv coordinates half a pixel from the texture border into the texture's center. With the <Border pixel> op­
tion you can specify that the texture should be prepared for this technique. Select “2 side border pixels” in order
to add the first pixels of the next maps to the texture; select “4 side border pixels” in order to additionally add the
last pixels of the previous maps to the texture. The <Power of two> option ensures that the created textures all
have a border size of a power of two.
The <Flip Y> option flips the exported bitmap vertically. Using the <Invert> option, the exported bitmap is inver­
ted. Both options are required by some engines for importing terrains.
The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the texturemaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.

14.3.10 Normalmap to BMP Export (PnPTC)


This PlugIn exports the surface normals of the terrain into a bitmap file. The components of the face normals (x,
y, z) are therefore encoded into the three color components (red, green, blue) of one pixel. The value range of
one color component (0..255) represents a real number value of the range -1 till +1, so 127 represents the real
number value 0.
When exporting a single sector, the export option dialog, as can be seen to the right will
open. There you can first define the <File format> of the bitmap file to be created. Possible
formats are .bmp, .dds, .dib, .hdr, .jpg and .png. With the <Patch size> option you can se­
lect the border size of the bitmaps to be
created. If you select a patch size smaller
than the border size of a sector, the export­
er will divide the sector's normalmap into
smaller patches and create separate files
for every patch. With the <Red>, <Green> and <Blue> parameter
you can specify which component of the normal vector should be
matched to color components of the bitmap file.
The <Flip Y> option flips the exported bitmap vertically, which is
required by some engines for importing terrains.
If a terrain is divided into separate normalmaps for each sector or for smaller patch sizes and two neighboring
maps are to be rendered, it is important to avoid visible edges between two maps. To avoid these edges the tex­
tures have to be sampled over their borders into the neighboring patch or sector. To solve this problem it is a
common technique to add the first pixels of every column and row of the neighboring textures to the texture and
set the uv coordinates half a pixel from the texture border into the texture's center. With the <Border pixel> op­
tion you can specify that the texture should be prepared for this technique. Select “2 side border pixels” in order
to add the first pixels of the next maps to the texture; select “4 side border pixels” in order to additionally add the
last pixels of the previous maps to the texture. The <Power of two> option ensures that the created textures all
have a border size of a power of two.
The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the normalmaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.

14.3.11 Obj/Veg Placements to TXT Export (PnPTC)


This PlugIn exports all object and tree placements to a readable TXT text file. The file format will be described
below. After selecting this PlugIn you will be prompted for a TXT file to save to or for a folder to store the files to,
depending on whether you selected the export for a single sector or the whole terrain. When exporting the whole
terrain, this PlugIn will create separate TXT files for each sector named 000x_000y.txt within the selected folder,
where x and y stand for the sector indices in x and y direction.

81
Within the following dialog you can select whether or not you want to ex­
port the static object placements <Export static objects>, the trees <Ex­
port trees>, and the grass placements <Export grasses>. Additionally
you can apply a <Scale factor> for the 3D coordinates of the exported
elements. You should set the same scaling factor here as you used for
the exporting of the terrain itself. With the <Patch size> option you can
select the border size to be covered by the files to be created. If you se­
lect a patch size smaller than the border size of a sector, the exporter
will divide the sector's object and tree placement distributions into smal­
ler patches and create separate files for every patch. The textual comments, which can be stored for the
object/tree placements, might cause problems, when parsing the generated TXT file, because these comments
might be multiline. For that reason, it is possible to suppress comment export by unchecking the <Export place­
ments' comments> check box.
14.3.11.1 Obj/Veg placement TXT file format
This file format is based on the ini file format, so it is at the same time very easy to implement a parser for it
from scratch or to use the windows functions GetPrivateProfileXXX to parse it.
The first section of this file contains the number of trees, grasses, and objects stored within the file.
[Exported Placements]
NumObjects=1
NumTrees=699
NumGrasses=1352

Afterwards all object placements are exported. Every single exported object placement has its own section [Ob­
ject Placement x], where x is a running number from 1 to NumObjects. Every object placement has the following
attributes: Name is the name, which is used within PnP TerrainCreator to identify the object (usually the file
name). ID is the globally unique ID of the object placement. PosX and PosY is the position of the placement in
meters on the terrain. PosZ is the vertical position of the object computed by the terrain height and the object's
height over ground. Height is the height of the object placement over the ground. CoordX, CoordY and CoordZ
are the 3D coordinates of the object placement with applied scaling factor. Roll, Pitch and Yaw are the object's
orientations given in degree. The comments stored for an object placement are exported with the Comments
value. Keep in mind, that the comments might be multiline and so can cause problems when parsing the file.
[Object Placement 1]
Name=tc_logo.X
ID=3018de37-4b1f-48ed-9e77-eed0135f98a4
PosX=841.583801
PosY=378.796509
PosZ=60.458715
Height=15.904541
CoordX=8415.837891
CoordY=40110.730469
CoordZ=3787.965088
Scale=10.002460
Roll=0.000000
Pitch=0.000000
Yaw=44.999996
Comments=

Afterwards all tree placements are exported. Every single exported tree placement has its own section [Tree
Placement x], where x is a running number from 1 to NumTrees. Every tree placement has the following attrib­
utes: Name is the name, which is used within PnP TerrainCreator to identify the tree (usually the file name). ID is
the globally unique ID of the tree placement. PosX and PosY is the position of the placement in meters on the
terrain sector. PosZ is the vertical position of the tree computed by the terrain height and the tree's height over
ground. Height is the height of the tree placement over the ground. CoordX, CoordY and CoordZ are the 3D co­
ordinates of the object placement with applied scaling factor. Yaw is the tree's orientation about its up axis given
in degree. The comments stored for a tree placement are exported with the Comments value. Keep in mind, that
the comments might be multiline and so can cause problems when parsing the file.
[Tree Placement 1]
Name=dec_summer_03.x
ID=1d5983fd-85e6-421c-a9a6-cbbaa213a3d7
PosX=73.693192
PosY=242.949707
PosZ=24.458721
Height=0.000000

82
CoordX=736.931885
CoordY=40070.656250
CoordZ=2429.497070
Scale=3.111789
Roll=0.000000
Pitch=0.000000
Yaw=257.725159
Comments=

Finally the grass placements are exported into that file. The format is identically to the one used for trees except
that the comments and ID fields are not available. Every grass placements has its own section [Grass Place­
ment x], where x is a running number from 1 to NumGrasses.

14.3.12 Object placements to XML Export (PnPTC)


This PlugIn exports all object placements to a readable XML text file. The file format will be described below.
After selecting this PlugIn you will be prompted for a xml file to save to or for a folder to store the files to, de­
pending on whether you selected the export for a single sector or the whole terrain. When exporting the whole
terrain, this PlugIn will create separate xml files for each sector named 000x_000y.objxml within the selected
folder, where x and y stand for the sector indices in x and y direction.
With the <Patch size> option within the options dialog of this exporter you can select the
border size to be covered by the files to be created. If you select a patch size smaller
than the border size of a sector, the exporter will divide the sector's object placement
distributions into smaller patches and create separate files for every patch.

14.3.12.1 Object placement XML file format


The first tag in this file describes the general object settings of the terrain project. It contains the global object
scaling factor, the up-rotation („None“, „RotX(90)“, „RotX(-90)“, „RotX(180)“), and the flipping axis („None“, „X“,
„Y“, „Z“) performed to all object placements.
<OBJECTDEFINITION SCALE="3.011785" UPROTATION="None" FLIPAXIS="None"/>

All object placements of the exported sector will be written between the following tags:
<SECTOROBJECTS>
.......
</SECTOROBJECTS>

For every exported object there is one xml data element <OBJECTPLACEMENT>. It has two parameters
<NAME> for the object name as it is used by the object manager (for example its file name) and <UID> for the
unique ID defined for this object placement. Below this data element there are 3 more data elements defining
the position, orientation and size of the object placement. The <POSITION> is given as the <X> and <Y> co­
ordinate in meters with respect to the sector's origin. <Z> is the vertical position of the object computed by the
terrain height and the object's height over ground. The object's height over ground is given with <HEIGHT>
parameter meters. The <ORIENTATION> is given in degrees as rotation about the <X>, the <Y> and the <Z>
axis. (The rotation is performed in the following order: rotation around z, followed by a rotation around x, followed
by a rotation around y). At least the <SIZE> of the object is given as a <SCALE> factor. The comments entered
for a tree placement are exported in the <COMMENTS> tag.
<OBJECTPLACEMENT NAME="castle ruin 1.X" UID="41366ef9-375f-4e63-9136-4574ea4fe3b6">
<POSITION X="213.000000" Y="82.000000" Z=“26.564851 HEIGHT="0.531000"/>
<ORIENTATION X="0.000000" Y="0.000000" Z="0.000000"/>
<SIZE SCALE="2.000000"/>
<COMMENTS>A comment</COMMENTS>
</OBJECTPLACEMENT>

14.3.13 Sound placements to XML Export (PnPTC)


This PlugIn exports all sound placements to a readable XML text file. The file format will be described below.
After selecting this PlugIn you will be prompted for a xml file to save to or for a folder to store the files to, de­
pending on whether you selected the export for a single sector or the whole terrain. When exporting the whole

83
terrain, this PlugIn will create separate xml files for each sector named 000x_000y.sndxml within the selected
folder, where x and y stand for the sector indices in x and y direction.
With the <Patch size> option within the options dialog of this exporter you can select the
border size to be covered by the files to be created. If you select a patch size smaller
than the border size of a sector, the exporter will divide the sector's sound placements
into smaller patches and create separate files for every patch.
14.3.13.1 Sound placement XML file format
The base tag of this xml file is the <SECTORSOUNDS>:
<SECTORSOUNDS>
.........
</SECTORSOUNDS>

Below this tag every sound placement has its own <SOUNDPLACEMENT> xml data element. Every sound
placement has an unique <UID>.
<SOUNDPLACEMENT UID="b1cc84e7-271f-4870-8334-e1b8a3e36110">
........
</SOUNDPLACEMENT>

Below this, the parameters of the sound placement are described. First there is the sound placement's <POSI­
TION> given as <X> and <Y> coordinate in meters with respect to the sector's origin. <Z> is the vertical position
of the sound placement computed by the terrain height and the placement's height over ground. The parameter
<HEIGHT> specifies the placement's height over ground.
<POSITION X="5.128629" Y="6.026841" HEIGHT="0.799316"/>

Next there is the sound placements master <VOLUME>. Its <VALUE> parameter is the volume in the range
from 0 to 1.
<VOLUME VALUE="0.750000">
.........
</VOLUME>

Between the start and end tag of the volume there can be a <SOUNDFUNCTION> tag, describing the depend­
ency of the volume to environment conditions. The sound function consists of a textual sound function defined
by the <TEXTFUNCTION> tag and its <VALUE> and 0 to 6 <DEPENDENCYFUNCTIONS>. Each dependency
function is identified by its value („TEMPERATURE“, „LIGHT“, „WIND“, „DAYTIME“, „SEASON“ and „PRECIPIT­
ATION“). Every dependency function has a set of control points defined by the <CONTROLPOINT> tag. A con­
trol point is defined by its horizontal position <POS> in the range from 0 to 1 and its vertical position <VALUE> in
the range from 0 to 1.
<SOUNDFUNCTION>
<DEPENDENCYFUNCTION VALUE="TEMPERATURE">
<CONTROLPOINT POS="0.000000" VALUE="0.211009">
<CONTROLPOINT POS="1.000000" VALUE="1.000000">
</DEPENDENCYFUNCTION>
<TEXTFUNCTION VALUE=""/>
</SOUNDFUNCTION>

The next parameters of the sound placement are <FULL_RADIUS> of the inner hearing radius and <MAX_RA­
DIUS> of the maximum hearing radius, both defined in meters. Both parameters can have an optional sound
function as described before.
<FULL_RADIUS VALUE="10.000000">
............
</FULL_RADIUS>
<MAX_RADIUS VALUE="50.000000">
............
</MAX_RADIUS>

84
Next the <PLAYBACKTYPE> of the sound placement is defined. Valid playback types are „RANDOM“, „SIMUL­
TANEOUS“ and „SEQUENTIAL“. For random and simultaneous playback types the maximum number of simul­
taneously played sounds is defined in the <MAX_SIMULTANEOUS> data element, which can have an optional
sound function below it.
<PLAYBACKTYPE VALUE="RANDOM"/>
<MAX_SIMULTANEOUS VALUE="2">
...........
</MAX_SIMULTANEOUS>

The transition between two sound playbacks is defined by the following tags. The transition type is defined by
<PLAYTRANSITION> where „UNDELAYED“ and „RANDOM“ transitions can be set. For random transitions the
minimum delay time in seconds is set by the <MIN_DELAY> tag and the maximum delay by the <MAX_DELAY>
tag. Both delay tags can have an optional sound function as describe before.
<PLAYTRANSITION VALUE="UNDELAYED"/>
<MIN_DELAY VALUE="3">
.........
</MIN_DELAY>
<MAX_DELAY VALUE="60">
.........
</MAX_DELAY>

Now follows the <PLAYLIST> where all sounds in this sound placement are listed. Every item of the playlist has
its own <SOUND> data element. The optional sound function below the sound element defines how the master
volume and radius values of the sound placement are adapted for this sound. The <PROBABILITY> in the
range from 0 to 1 defines how probable this sound will be played for random or simultaneous playback types.
This value can have an optional sound function below it.
<PLAYLIST>
<SOUND NAME="frogs and birds.wav">
<SOUNDFUNCTION>
.........
</SOUNDFUNCTION>
<PROBABILITY VALUE="1.000000">
.........
</PROBABILITY>
</SOUND>
<SOUND NAME="sea gull 1.wav">
<PROBABILITY VALUE="1.000000">
.........
</PROBABILITY>
</SOUND>
</PLAYLIST>

At least there can be a random placement area defined by a list of connected border points below an <RAN­
DOMBORDER> element. Each <BORDERPOINT> has an <X> and <Y> coordinate given in meters with respect
to the sector's origin.
<RANDOMBORDER>
<BORDERPOINT X="60.000000" Y="95.000000">
<BORDERPOINT X="163.000000" Y="64.000000">
<BORDERPOINT X="178.000000" Y="0.000000">
<BORDERPOINT X="157.000000" Y="-108.000000">
<BORDERPOINT X="123.000000" Y="-175.000000">
<BORDERPOINT X="42.000000" Y="-210.000000">
<BORDERPOINT X="-100.000000" Y="-193.000000">
<BORDERPOINT X="-169.000000" Y="-124.000000">
<BORDERPOINT X="-177.000000" Y="-77.000000">
<BORDERPOINT X="-174.000000" Y="-17.000000">
<BORDERPOINT X="-139.000000" Y="129.000000">
<BORDERPOINT X="-22.000000" Y="173.000000">
<BORDERPOINT X="5.000000" Y="142.000000">
<BORDERPOINT X="60.000000" Y="95.000000">
</RANDOMBORDER>

14.3.14 Template based Scene Export (PnPTC)


This is a very powerful exporter PlugIn. A complete world scene, containing heightmap, textures, object place­
ments, can be exported into any textual scene description. This scene exporter can call many of the other file
exporter PlugIns. For example it can call the Heightmap to Bitmap Export PlugIn and afterwards call the Tex­
85
turemap to Bitmap Export PlugIn. Around those calls it can place textual scene descriptions which bring all those
single exports into one context.
Many rendering/game engines have an XML like scene specification format.
The scene template can be easily adapted to support a large number of their
features. After selecting this PlugIn the dialog to the right will be opened,
where the template definition for the scene file to be created can be selected
from the <Template file> drop down list. In this dialog all template files, which
are located within the “Templates” directory below the “PlugIns” directory are
listed (for example “C:\Program Files\PnP TerrainCreator\PlugIns\Templates\”). You can add an arbitrary num­
ber of your own template files into this directory or change and adapt the existing ones. If you change an existing
template file, please copy it to another name in that directory and keep a copy of it somewhere else on your PC,
as updates of PnP TerrainCreator might overwrite it.
Currently the following template files are shipped with PnP TerrainCreator:
• CrystalSpace.xml : Is a template to create scene files for the Crystal Space 3D engine
(http://www.crystalspace3d.org/). It uses the shader based splatting terrain rendering method of CS.

14.3.14.1 Template File Format


The template file is a plaint text file. It can contain any information required for the target system to read the
scene. Similar to usual XML files, one can place special tags into this file which let PnP TerrainCreator create
export files like heightmaps or to get information like texture names from PnP TerrainCreator. Below you can
find the complete list of command tags, which can be interpreted by the scene exporter, together with a descrip­
tion of how they work. The export tags in general call other exporter PlugIns, for example the Heightmap to Bit­
map Export, and they usually have a list of parameters, which meanings are the same as those of the corres­
ponding standalone exporter PlugIn.
# This is a description of the template file for the "Scene Template Export" PlugIn.

# The very first line has to contain the characters that will be used for opening and
# closing brackets of the tags. We later assume, that we use a { as opening and a }
# as closing bracket.

{}

# During the scene export, all contents of the template file will be transfered directly
# to the output scene file. To fill terrain data into the exported scene file, command tags
# similar to the popular XML syntax are used. these Command tags will be replaced with data
# from the export PlugIn or they will control the program flow of the PlugIn. A command tag
# has the following form:
# {Command Param="Value"/}
# They are encapsulated by { and }. Command is the name or identifier of the command tag. It
# is followed by a command dependend number of aditional parameters. The value of every
# parameter is encapsulated by " ".
# This value can be alphanumeric. If you need to put a " in the value string, it has to be
# preceeded by a back slash \".
# Commands can be single tagged (like in the example above), in which case the trailing } is
# preceeded by a slash /}. Commands can as well be separated in a start and an end tag as
# shown in the following example:
# {Command} some other text {/Command}
# In this case the command name of the ending tag is preceeded by a slash. If you need
# the opening bracket { somewhere in your file, you should preceed it with a back slash \{.

# Comment: A line, which's first non space character is a # is recognized as a comment line
# and will not be transferred to the output file. If you really need a # as first character
# of a line use a preceeding back slash \#.

# The first command which should appear in a template file is the FileType tag. The parameter
# Description is a short description of the output file format. it will be shown in the save
# file dialog. The Extension parameter defines the default file extension.

{FileType Description="XML terrain scene" Extension="xml"/}

# Inserts the size of a terrain in 3D units in x and y direction. The parameter Scale defines
# how much the 3D units are scaled between two heightmap elements.

{Terrain3DSizeX Scale="1"/}, {Terrain3DSizeY Scale="1"/}

# Inserts the size of a terrain in meter units in x and y direction.


# The optional parameter Scale defines how much the meter units are to be scaled.

86
{TerrainWorldSizeX Scale="1"/}, {TerrainWorldSizeY Scale="1"/}

# Returns the height at a given terrain position. The parameters X and Y specify the terrain
# position in meters for which the height should be returned.
# The optional parameter Scale defines how much the returned height value is to be scaled.
# The optional parameter Offset defines a offset which will be added to the terrain height
# (after scaling).

{TerrainHeight X="0" Y="0" Scale="1" Offset="0"/}

# All textures available for a terrain project can be inserted into the export file using
# the following tag.

{Textures}

# One single texture is encapsulated by the {Texture} tag.

{Texture}

# The name of a texture can be inserted into the export


# file using the following tag.

{TextureName/}

# The global ID of a texture can be inserted into the export file using the following tag.

{TextureGlobalID/}

# Inserts the size (number of heightmap elements) to which the detail textures are stretched
# on the terrain.

{TextureSize/}

# Saves the texture to a file. The parameter Path specifies the absolute or relative
# directory where the texture should be stored.

{TextureSave Path="here"/}

# returns the normal map of the texture.

{TextureNormalMap}

# The name of a texture normal map can be inserted into the export file using the following tag.

{TextureNormalMapName/}

# Saves the texture normal map to a file. The parameter Path specifies the absolute or
# relative directory where the texture should be stored.

{TextureNormalMapSave Path="here"/}

{/TextureNormalMap}

{/Texture}

{/Textures}

# The sectors command is responsible for exporting all sectors of a terrain. The contents
# between the sector start and end tag will be repeated for every sector of the export.
# The scaling factors ScaleX, ScaleY and ScaleZ define the scaling used to convert the
# metrical data used within TC to the units used for rendering. They are optional.
# If they are missing a scaling of 1 is assumed. ScaleZ is the height scaling.
# If you want to export heightmaps, texturemaps and object placement in separate
# "export pathes" for example, you can have more than one {Sectors} section in your
# template file. The CombineSectors parameter defines, whether or not all sectors should
# be combined into one output file (for example for the heightmap). Valid values are "true"
# and "false".
# There is an optional parameter PatchSize which will be used by the exporter of heightmaps
# texturemaps etc. If this parameter is omitted, the sector size will be used

{Sectors ScaleX="1" ScaleY="1" ScaleZ="1" CombineSectors="false" PatchSize="512"}

# The contents of one single sector are to be placed between a sector command's start and
# end tag.

{Sector}

# The index of a sector can be inserted into the exported file using the following tags.
# The tags will be replaced by the corresponding integer value on export. {SecIndexX}
# and {SecIndexY} define the sector count/index in x and y direction on the terrain, whilst
# {SecIndex} defines the overall index of a sector.

87
{SecIndexX/}, {SecIndexY/}, {SecIndex/}

# The position of a sector's origin in meters can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{SecWorldPosX/}, {SecWorldPosY/}, {SecWorldPosZ/}

# The position of a sector's origin in 3d units can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{Sec3DPosX/}, {Sec3DPosY/}, {Sec3DPosZ/}

# All textures used by one sector can be inserted into the export file using the following tag.

{SecTextures}

# One single texture is encapsulated by the {SecTexture} tag.

{SecTexture}

# The name of a texture can be inserted into the export file using the following tag.

{SecTextureName/}

# The global ID of a texture can be inserted into the export file using the following tag.

{SecTextureGlobalID/}

# The ID/Index of a texture within the current sector can be inserted into the export file
# using the following tag.

{SecTextureSecID/}

{/SecTexture}

{/SecTextures}

# ------------------------------------------------------------------------------
# Height Map Export
# ------------------------------------------------------------------------------

# To export a height map as bitmap file use the {HeightmapExportBMP} tag.


# You can use the following parameters to specify the output.
# FileFormat: file format used for export. supported are
# "BMP","DDS","JPG","PNG","DIB","HDR"
# ColorMode: Color mode used in bitmap.
# "GrayScale" the height map is exported as grayscale bitmap. If the export was
# "ColorScale" The color scale currently selected within TC will be used for the
# exported bitmap.
# "RGB" The heights are encoded into 24 bit rgb values, with r as the most
# significant byte.
# "BGR" The heights are encoded into 24 bit rgb values, with b as the most
# significant byte.
# SizePlus1: Whether or not to add one element at the right and to of the output file.
# ("true" or "false")
# FlipY: Whether or not the exported bitmap should be flipped vertically.
# ("true" or "false")
# HeightRange: Defines whether the height range of the whole terrain or of the exported
# sector should be used for color/grayscale conversion.
# ("Sector" or "Terrain")
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a
# patch size, the sector size will be used instead.

{HeightmapExportBMP FileFormat="PNG" ColorMode="GrayScale" Path="/heightmap/"


SizePlus1="false" FlipY="false" HeightRange="Terrain" PatchSize="256"}

# To export a height map as RAW file use the {HeightmapExportRAW} tag.


# You can use the following parameters to specify the output.
# Format: Value format used as output.
# "byte", "word", "dword", "float"
# OffsetToZero: Whether or not to offset all heights by the minimum terrain height.
# ("true" or "false")
# SizePlus1: Whether or not to add one element at the right and to of the output file.
# ("true" or "false")

88
# FullScale: Whether or not the terrain's height value range should be scaled to the
# whole value range available for the exported data format.
# FlipY: Whether or not the exported data array should be flipped vertically.
# ("true" or "false")
# Factor: factor by which the heights will be multiplied
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a
# patch size, the sector size will be used instead.

{HeightmapExportRAW Format="float" OffsetToZero="false" SizePlus1="false PatchSize="256""


Factor="1" FullScale="false" FlipY="false" Path="/heightmap/"}

# To export a lightmap into one single bitmap file, use the {LightmapExportBMP} tag.
# You can use the following parameters to specify the output.
# FileFormat: file format used for export. supported are
# "BMP","DDS","JPG","PNG","DIB","HDR"
# LightMapName: The name of the lightmap to be exported.
# BorderPixel: Whether or not to preserver border pixels for a seamless sector transition.
# ("0" or "false": no border pixels
# "1": border pixels on two sides (left and top)
# "2" or "true" border pixels on all four sides)
# FlipY: Whether or not the exported bitmap should be flipped vertically.
# ("true" or "false")
# PowerOfTwo: Whether or not the exported bitmaps should have a border size of the power of
# two. ("true" or "false")
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a
# patch size, the sector size will be used instead.

{LightmapExportBMP FileFormat="PNG" BorderPixel="false" Path="/texturemap/"


PatchSize="256"}

# To export a texture map into one single bitmap file, use the {TexturemapExportBMP} tag.
# You can use the following parameters to specify the output.
# FileFormat: file format used for export. supported are
# "BMP","DDS","JPG","PNG","DIB","HDR"
# BorderPixel: Whether or not to preserver border pixels for a seamless sector transition.
# ("0" or "false": no border pixels
# "1": border pixels on two sides (left and top)
# "2" or "true" border pixels on all four sides)
# FlipY: Whether or not the exported bitmap should be flipped vertically.
# ("true" or "false")
# PowerOfTwo: Whether or not the exported bitmaps should have a border size of the power of
# two. ("true" or "false")
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a
# patch size, the sector size will be used instead.

{TexturemapExportBMP FileFormat="PNG" BorderPixel="false" Path="/texturemap/"


PatchSize="256"}

# To export a normal map into one single bitmap file, use the {NormalmapExportBMP} tag.
# You can use the following parameters to specify the output.
# FileFormat: file format used for export. supported are
# "BMP","DDS","JPG","PNG","DIB","HDR"
# RGB: Defines how the x, y, and z components of the normals are to be encoded into the
# color channels of the bitmap. This is a string in which the first character encodes
# the normal component to be encoded in the red channel, the second character is the
# component encoded in the green channel, and the third parameter the one encoded in
# the blue channel (for example "XYZ").
# BorderPixel: Whether or not to preserver border pixels for a seamless sector transition.
# ("0" or "false": no border pixels
# "1": border pixels on two sides (left and top)
# "2" or "true" border pixels on all four sides)
# FlipY: Whether or not the exported bitmap should be flipped vertically.
# ("true" or "false")
# PowerOfTwo: Whether or not the exported bitmaps should have a border size of the power of
# two. ("true" or "false")
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a

89
# patch size, the sector size will be used instead.

{NormalmapExportBMP FileFormat="PNG" RGB="XYZ" BorderPixel="false" Path="/heightmap/"


PatchSize="256" PowerOfTwo="false"}

# To export a texture map into a texture index map bitmap file use the
# {TexturemapExportIndexmap} tag.
# You can use the following parameters to specify the output.
# FileFormat: file format used for export. supported are
# "BMP","DDS","JPG","PNG","DIB","HDR"
# FlipY: Whether or not the exported bitmap should be flipped vertically.
# ("true" or "false")
# Path: An optional parameter to specify an absolute or relative path where the terrain
# file should be stored. If it is missing, the path of the scene file will be used.
# PatchSize: An optional parameter specifying the patch size, which will be used for
# exporting. If this parameter is omitted, the patch size specified in the {Sectors}
# command will be used instead. If the {sectors} command too has not specified a
# patch size, the sector size will be used instead.

{TexturemapExportIndexmap FileFormat="PNG" Path="/texturemap/" PatchSize="256"}

# The file name which was used for export can be inserted into the scene file with the
# following tag. If multiple patches are used for exporting the terrain, this is the base file
# name for all the patch files.

{ExportFileName/}

# If the export uses mutliple patches, either if the PatchSize parameter is specified for the
# {Sectors} or for the {...Export...} command, one can iterate through the patches using
# the {Patches} command.

{Patches}

# The contents of one single patch are to be placed between a patch command's start and
# end tag.

{Patch}

# The file name which was used for export of this patch can be inserted into the scene file
# with the following tag.

{ExportFileName/}

# The index of a patch with respect to its sector can be inserted into the exported file
# using the following tags. The tags will be replaced by the corresponding integer value on
# export. {PatchIndexX} and {PatchIndexY} define the sector count/index in x and y direction on
# the terrain, whilst {PatchIndex} defines the overall index of a patch in the setor.

{PatchIndexX/}, {PatchIndexY/}, {PatchIndex/}

# The position of a patch's origin in meters can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{PatchWorldPosX/}, {PatchWorldPosY/}, {PatchWorldPosZ/}

# The position of a patch's origin in 3d units can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{Patch3DPosX/}, {Patch3DPosY/}, {Patch3DPosZ/}

{/Patch}

{/Patches}

{/...Export...}

# ------------------------------------------------------------------------------
# Object Placement Export
# ------------------------------------------------------------------------------

# The static object placement export is encapsulated by the {Objects} tags. The parameter
# ApplyGobalScale defines whether or not the global scaling factor should be applied to
# the scaling factors of every single object placement automatically. The parameter
# ApplyBaseScale defines whether or not the base scale of the object definition should be
# applied to the scaling factors of every single tree placement automatically. The parameter
# RotationUnits define how angles are represented. Possible values are "rad" for radians

90
# and "deg" for degree.

{Objects ApplyGlobalScale="false" ApplyBaseScale="false" RotationUnits="rad"}

# The contents of one single object are encapsulated by the {Object} tags.

{Object}

# The name of the object can be inserted into the exported file using the {ObjectName} tag.
# The tag will be replaced by a string containing the name (usually the file name) of the
# exported object.

{ObjectName/}

# The ID of the object can be inserted into the exported file using the {ObjectID} tag. The
# tag will be replaced by a string containing the ID (an automatically generated GUID) of the
# exported object.

{ObjectID/}

# The position of an object in meters can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{ObjectWorldPosX/}, {ObjectWorldPosY/}, {ObjectWorldPosZ/}

# The height of an object over (or under) the ground in meters can be inserted into the
# export file using the following tag.

{ObjectHeight/}

# The position of an object in 3d units can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{Object3DPosX/}, {Object3DPosY/}, {Object3DPosZ/}

# The scaling of an object can be inserted into the exported file using the following tags.
# The tags will be replaced by the corresponding floating point value on export.

{ObjectScaleX/}, {ObjectScaleY/}, {ObjectScaleZ/}

# The orientation of an object in RPY angles can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{ObjectRotRoll/}, {ObjectRotPitch/}, {ObjectRotYaw/}

# The orientation of an object in quaternions can be inserted into the exported file using
# the following tags. The tags will be replaced by the corresponding floating point value on
# export.

{ObjectRotQ1/}, {ObjectRotQ2/}, {ObjectRotQ3/}, {ObjectRotQ4/}

# This tag displays the comment string of an object placement.


# The source tag defines whether the comment string should be read from the object placement
# (“Placement”) or from the object definition (“BaseObject”).

{ObjectComments Source="Placement"/}

# This tag lists all user defined data elements of an object placement below it.
# The source tag defines whether the comments should be read from the object placement
# (“Placement”) or from the object definition (“BaseTree”).

{ObjectUserDefinedDataElements Source="Placement"}

# The contents of one single user defined data element are encapsulated by the
# {ObjectUserDefinedDataElement} tags.

{ObjectUserDefinedDataElement}

# The name of the user defined data element.

{ObjectUserDefinedDataElement_Name/}

# The type of the user defined data element as string.

{ObjectUserDefinedDataElement_Type/}

# The value of the user defined data element.

{ObjectUserDefinedDataElement_Value/}

{/ObjectUserDefinedDataElement}

91
{/ObjectUserDefinedDataElements}

{/Object}

{/Objects}

# ------------------------------------------------------------------------------
# Tree Placement Export
# ------------------------------------------------------------------------------

# The tree placement export is encapsulated by the {Trees} tags. The parameter
# ApplyGobalScale defines whether or not the global scaling factor should be applied to
# the scaling factors of every single tree placement automatically. The parameter ApplyBaseScale
# defines whether or not the base scale of the object definition should be applied to the
# scaling factors of every single tree placement automatically. The parameter RotationUnits
# define how angles are represented. Possible values are "rad" for radians and "deg" for degree.

{Trees ApplyGlobalScale="false" ApplyBaseScale="false" RotationUnits="rad"}

# The contents of one single tree are encapsulated by the {Tree} tags.

{Tree}

# The name of the tree can be inserted into the exported file using the {TreeName} tag. The
# tag will be replaced by a string containing the name (usually the file name) of the
# exported tree.

{TreeName/}

# The ID of the tree can be inserted into the exported file using the {TreeID} tag. The tag
# will be replaced by a string containing the ID (an automatically generated GUID) of the
# exported tree.

{TreeID/}

# The position of a tree in meters can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{TreeWorldPosX/}, {TreeWorldPosY/}, {TreeWorldPosZ/}

# The height of a tree over (or under) the ground in meters can be inserted into the export
# file using the following tag.

{TreeHeight/}

# The position of a tree in 3d units can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{Tree3DPosX/}, {Tree3DPosY/}, {Tree3DPosZ/}

# The scaling of a tree can be inserted into the exported file using the following tags.
# The tags will be replaced by the corresponding floating point value on export.

{TreeScaleX/}, {TreeScaleY/}, {TreeScaleZ/}

# The orientation of a tree in RPY angles can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{TreeRotRoll/}, {TreeRotPitch/}, {TreeRotYaw/}

# The orientation of a tree in quaternions can be inserted into the exported file using the
# following tags. The tags will be replaced by the corresponding floating point value on export.

{TreeRotQ1/}, {TreeRotQ2/}, {TreeRotQ3/}, {TreeRotQ4/}

# This tag displays the comment string of a tree placement.


# The source tag defines whether the comment string should be read from the tree placement
# (“Placement”) or from the tree definition (“BaseTree”).

{TreeComments Source="Placement"/}

# This tag lists all user defined data elements of a tree placement below it.
# The source tag defines whether the comments should be read from the tree placement
# (“Placement”) or from the tree definition (“BaseTree”).

{TreeUserDefinedDataElements Source="Placement"}

# The contents of one single user defined data element are encapsulated by the
# {TreeUserDefinedDataElement} tags.

92
{TreeUserDefinedDataElement}

# The name of the user defined data element.

{TreeUserDefinedDataElement_Name/}

# The type of the user defined data element as string.

{TreeUserDefinedDataElement_Type/}

# The value of the user defined data element.

{TreeUserDefinedDataElement_Value/}

{/TreeUserDefinedDataElement}

{/TreeUserDefinedDataElements}

{/Tree}

{/Trees}

{/Sector}

{/Sectors}

# ------------------------------------------------------------------------------
# Helper Operations
# ------------------------------------------------------------------------------

# The Operator command allows mathematically operations to be computed. Op1 and Op2 have to
# be numerical values which might as well be the result of another template command. The
# following operation (between both operands) are allowed "+", "-", "*" and "/". The command's
# Type parameter specifies the type of both operands. Possible values are "Integer" and "Real"

{Operator Type="Integer"}Op1*Op2{/Operator}

14.3.15 Terrain to 3D Game Studio HMP-File Export (PnPTC)


This exporter PlugIn exports a sector or the complete terrain to the 3D
game studio heightmap (.hmp) format. After selecting this exporter you
can apply a few export settings in the dialog you can see to the right.
First you can decide the <Heightmap format> to use for export. The
exporter is capable of exporting heightmap in the old HMP5 or the cur­
rent HMP7 file formats. With the <Scale factor> parameter, you can
specify a value, by which the heightmap should be scaled during ex­
port. The default value of “39.370” is the correct scaling factor for the
inch units as they are used by the default game templates of 3D game
studio. The parameter <Patch size> defines the border size of a single
exported heightmap file. The parameter <Global positioning> specifies,
whether or not the HMP files should contain their absolute position within the whole terrain.
The <Texturing mode> parameter specifies the texturing technique to be used by the exported heightmap. With
the option “No textures”, the heightmap will be exported without any textures. The “Texturemap” option exports
a single texture which is spanned over the whole heightmap. The “Splatting” option finally uses alphamaps for all
detail texture to perform the texture splatting terrain rendering technique. Depending on the shader used within
3D Game Studio, it might be required to export an empty texture into the second texture channel. By checking
the <Add lightmap texture slot> check box this additional texture can be created.
By default all textures are integrated directly into the heightmap file. For the HMP7 file format with the texturmap
texturing technique, it is possible to use external texture files instead of integrating the texture into the heightmap
file, by checking the <External texture files> check box. If external texture files are used, the <File format> drop
down list box can be used to select the bitmap format of these texture files. For the splatting terrain texturing
method, it is additionally possible to specify a scaling factor for oversampling the alphamaps with the <Texture
scale> option. A scale factor of 4 for example means that the alphamap is 4 times the size as the heightmap
resulting in smoother transitions between two neighboring textures.
Information If the splatting terrain texturing technique is used, the material script mtl_terraintex has to be as­
signed to the heightmap object either in WED or in Lite-C. By setting the variable detail_size within Lite-C prior to
loading the terrain, the texture scale can be set for the texture splatting technique.

93
When exporting the whole terrain, this PlugIn will create separate HMP files for each sector named 00000s.hmp
within the selected folder, where s is the sector indices within the terrain. If the selected patch size is smaller
than the size of a sector the file will be named like 00000s_000p.hmp, where p is the patch index within the sec­
tor.

14.3.16 Texture map to BMP Export (PnPTC)


This PlugIn exports a sector’s texture layer into one single bitmap file (as in the example
to the right). After selecting this PlugIn you will be prompted for a BMP file to save to or
for a folder to store the files to, depending on whether you selected the export for a single
sector or the whole terrain. When exporting the whole terrain, this PlugIn will create sep­
arate BMP files for each sector named 000x_000y.bmp within the selected folder, where
x and y stand for the sector indices in x
and y direction.
The resolution (pixel per heightmap ele­
ment) of the exported bitmap is taken from
the 3D view settings (2.4.1).
Within the options dialog of this exporter you can specify the <File
format> of the bitmap file to be created. With the <Patch size> op­
tion you can select the border size to be covered by the tex­
turemap to be created. If you select a patch size smaller than the border size of a sector, the exporter will divide
the sector's texturemap into smaller patches and create separate files for every patch.
If a terrain is divided into separate texturemaps for each sector or for smaller patch sizes and two neighboring
maps are to be rendered, it is important to avoid visible edges between two maps. To avoid these edges the tex­
tures have to be sampled over their borders into the neighboring patch or sector. To solve this problem it is a
common technique to add the first pixels of every column and row of the neighboring textures to the texture and
set the uv coordinates half a pixel from the texture border into the texture's center. With the <Border pixel> op­
tion you can specify that the texture should be prepared for this technique. Select “2 side border pixels” in order
to add the first pixels of the next maps to the texture; select “4 side border pixels” in order to additionally add the
last pixels of the previous maps to the texture. The <Power of two> option ensures that the created textures all
have a border size of a power of two.
It is possible to overlay a lightmap and combine texturemap and lightmap into one file during export. Select the
lightmap definition which you want to use as overlay from the <Add lightmap> drop down list. The <Flip Y> op­
tion flips the exported bitmap vertically, which is required by some engines for importing terrains.
The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the texturemaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.

14.3.17 Texture Splatting Alphamap Export (PnPTC)


This PlugIn exports a sector’s texture layer into alphamaps that can be used for texture
splatting techniques. The PlugIn creates one bitmap file (as in the example to the right)
for every texture used in one sector. The name of the created files contains the name of
the texture and the sector's coordinates (example:
ground01-000x_000y.bmp, for the texture named
ground01 and where x and y stand for the sector in­
dices in x and y direction).
After selecting this PlugIn the dialog to the left will open.
First you can specify the <File format> for the bitmap
file to be created. Furthermore you can specify a <Smooth factor> which is the
radius of a Gaussian blurring filter kernel. A blurring factor of 0 disables blurring,
so the resulting image will only have white and black pixels. For the blurring pro­
cess, the <Gauss max> option can be used to ensure that completely white
pixel before blurring are still white after blurring. With the <Patch size> option
you can select the border size to be covered by the texturemap to be created. If you select a patch size smaller
than the border size of a sector, the exporter will divide the sector's texturemap into smaller patches and create
separate files for every patch. The <Scale factor> parameter can be used to sample the alphamaps at a differ­
ent resolution than the original size of a patch in order to achieve higher resolution alphamaps.

94
The Alphamap channels/format specifies how many channels of the exported alphamaps are used to encode
the terrain texture using one or more detail textures at once. The option “1: Gray scale” uses gray scale values
for the alphamap as shown in the picture above. Using this technique, the terrain coverage of exactly one detail
texture can be specified by this alphamap. The option “3: RGB” uses the red, green, and blue color channel of
the alphamap independently in order to encode the terrain coverage of three detail textures at once. The option
“4: RGBA” uses an additional channel – the alpha channel – in order to encode the terrain coverage of a fourth
detail texture. The option “1: Alpha + Detail” is a special format. In this format, the alphamap – the terrain cover­
age – is stored in the alpha channel of the exported texture, whereas the detail texture is copied into the color
channels (RGB) of the exported texture.
As there might be textures which are not contained on a sector's texture map, the resulting alphamap will be
completely black. To avoid the creation of those bitmaps, the <No black files> option can be used. The <Flip Y>
option flips the exported bitmap vertically, which is required by some engines for importing terrains.
If a terrain is divided into separate alphamaps for each sector or for smaller patch sizes and two neighboring
maps are to be rendered, it is important to avoid visible edges between two maps. To avoid these edges the tex­
tures have to be sampled over their borders into the neighboring patch or sector. To solve this problem it is a
common technique to add the first pixels of every column and row of the neighboring textures to the texture and
set the uv coordinates half a pixel from the texture border into the texture's center. With the <Border pixel> op­
tion you can specify that the texture should be prepared for this technique. Select “2 side border pixels” in order
to add the first pixels of the next maps to the texture; select “4 side border pixels” in order to additionally add the
last pixels of the previous maps to the texture. The <Power of two> option ensures that the created textures all
have a border size of a power of two.
Finally the <Material file> option can be used to let the exporter generate XML material files. These XML files
contain all the information which is required to correctly relate an alphamap with the corresponding detail texture
to be used with the alphamap. The following example is a material file for the gray scale alphamap format. The
root element of the XML file is the <coveragemaps> node, which is specified by the sector and optionally the
patch coordinate for this material file. Below this root node the single alphamap files are listed as <cover­
agemap> nodes. The alphamap_texture parameter of these nodes specifies the alphamap texture file to be
used. Below this node, the <alphamap> node specifies the detail texture to be used for this alphamap.
<coveragemaps sector_x="0" sector_y="0" patch_x="0" patch_y="0">
<coveragemap alphamap_texture="ground04_00000_00000_000.PNG">
<alphamap detail_texture="ground04.jpg" />
</coveragemap>
<coveragemap alphamap_texture="ground07_00000_00000_000.PNG">
<alphamap detail_texture="ground07.jpg" />
</coveragemap>
<coveragemap alphamap_texture="gras6_00000_00000_000.PNG">
<alphamap detail_texture="gras6.jpg" />
</coveragemap>
<coveragemap alphamap_texture="sand_00000_00000_000.PNG">
<alphamap detail_texture="sand.jpg" />
</coveragemap>
<coveragemap alphamap_texture="gras10_00000_00000_000.PNG">
<alphamap detail_texture="gras10.jpg" />
</coveragemap>
<coveragemap alphamap_texture="gras2_00000_00000_000.PNG">
<alphamap detail_texture="gras2.jpg" />
</coveragemap>
<coveragemap alphamap_texture="ground01_00000_00000_000.PNG">
<alphamap detail_texture="ground01.jpg" />
</coveragemap>
<coveragemap alphamap_texture="gras11_00000_00000_000.PNG">
<alphamap detail_texture="gras11.jpg" />
</coveragemap>
<coveragemap alphamap_texture="gras5_00000_00000_000.PNG">
<alphamap detail_texture="gras5.jpg" />
</coveragemap>
<coveragemap alphamap_texture="ground13_00000_00000_000.PNG">
<alphamap detail_texture="ground13.jpg" />
</coveragemap>
<coveragemap alphamap_texture="moos1_00000_00000_000.PNG">
<alphamap detail_texture="moos1.jpg" />
</coveragemap>
</coveragemaps>

Now lets take a look at the material files, which are generated for the RGBA alphamap format. As the three or
four channels of an alphamap texture encode separate detail textures, the <alphamap> node contains an addi­
tional parameter channel, which specifies the color channel used for the detail texture.

95
<coveragemaps sector_x="0" sector_y="0" patch_x="0" patch_y="0">
<coveragemap alphamap_texture="alphamap_00000_00000_000_0.PNG">
<alphamap channel="R" detail_texture="ground04.jpg" />
<alphamap channel="G" detail_texture="ground07.jpg" />
<alphamap channel="B" detail_texture="gras6.jpg" />
<alphamap channel="A" detail_texture="sand.jpg" />
</coveragemap>
<coveragemap alphamap_texture="alphamap_00000_00000_000_1.PNG">
<alphamap channel="R" detail_texture="gras10.jpg" />
<alphamap channel="G" detail_texture="gras2.jpg" />
<alphamap channel="B" detail_texture="ground01.jpg" />
<alphamap channel="A" detail_texture="gras11.jpg" />
</coveragemap>
<coveragemap alphamap_texture="alphamap_00000_00000_000_2.PNG">
<alphamap channel="R" detail_texture="gras5.jpg" />
<alphamap channel="G" detail_texture="ground13.jpg" />
<alphamap channel="B" detail_texture="moos1.jpg" />
</coveragemap>
</coveragemaps>

Finally a quick look at the material files generated for the Alpha + Detail alphamap format. As the detail texture is
integrated into the alphamap texture, the <alphamap> node is omitted here.
<coveragemaps sector_x="0" sector_y="0" patch_x="0" patch_y="0">
<coveragemap alphamap_texture="ground04_00000_00000_000.PNG" />
<coveragemap alphamap_texture="ground07_00000_00000_000.PNG" />
<coveragemap alphamap_texture="gras6_00000_00000_000.PNG" />
<coveragemap alphamap_texture="sand_00000_00000_000.PNG" />
<coveragemap alphamap_texture="gras10_00000_00000_000.PNG" />
<coveragemap alphamap_texture="gras2_00000_00000_000.PNG" />
<coveragemap alphamap_texture="ground01_00000_00000_000.PNG" />
<coveragemap alphamap_texture="gras11_00000_00000_000.PNG" />
<coveragemap alphamap_texture="gras5_00000_00000_000.PNG" />
<coveragemap alphamap_texture="ground13_00000_00000_000.PNG" />
<coveragemap alphamap_texture="moos1_00000_00000_000.PNG" />
</coveragemaps>

The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the texturemaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.
Finally you will be prompted for a folder to store the files to.

96
14.3.18 Texture Splatting Indexmap Export (PnPTC)
This PlugIn exports the texturemap into an indexed (palletized) bitmap file. A color index
of 0 (black) indicates the usage of the texture with the ID 0 at that heightmap position.
Resp. for 1, 2, ... In addition to the bitmap file a text file is generated in which the corres­
pondence between index and texture name is given.
In the export options dialog you can first specify the <File format> of the bitmap file to be
created. With the <Patch size> option you can select the border size to be covered by
the texturemap to be created. If you select a patch size smaller than the border size of a
sector, the exporter will divide the sector's texturemap into smaller patches and create
separate files for every patch. The <Flip Y> option flips the exported bitmap vertically,
which is required by some engines for importing terrains.
The options for exporting the whole terrain are almost identically to them for exporting one sector. There is only
one more option possible. You can additionally specify, whether or not you want to combine the texturemaps of
all sectors into one single huge bitmap by checking the <One file> check box. If that option is checked, the patch
size drop down list is disabled.
14.3.18.1 Texture index correspondence TXT file format
The text file specifying the bitmap index to texture name correspondence follows the windows ini file format spe­
cification and contains the following data.
[TEXTURES]
NumTextures=21

The text file contains only one section named [Textures]. The first element in this section NumTextures defines
how many texture correspondences are specified within this file.
Texture000=grass.jpg

One index to texture correspondence is defined in one line within the file. The name of the values [TextureXXX]
specifies the index of the texture inside the bitmap. XXX is this index. It has always 3 digits and leading zeros.
Behind this index string the name of the texture file is given.

97
14.3.19 Vegetation to XML Export (PnPTC)
This PlugIn exports all tree placements to a readable XML text file. The file format
will be described below. After selecting this PlugIn you will be prompted for a XML
file to save to or for a folder to store the files to, depending on whether you selec­
ted the export for a single sector or the whole terrain. When exporting the whole
terrain, this PlugIn will create separate XML files for each sector named
000x_000y.vegxml within the selected folder, where x and y stand for the sector
indices in x and y direction. With the options <Export trees> and <Export grasses>
one can select, whether tree and/or grass placements should be exported to the xml file.
With the <Patch size> option within the options dialog of this exporter you can select the border size to be
covered by the files to be created. If you select a patch size smaller than the border size of a sector, the exporter
will divide the sector's tree placement distributions into smaller patches and create separate files for every patch.
14.3.19.1 Vegetation placement XML file format
The first tags in this file describe the general vegetation settings of the terrain project. It contains the global tree
scaling factor, the up-rotation („None“, „RotX(90)“, „RotX(-90)“, „RotX(180)“), and the flipping axis („None“, „X“,
„Y“, „Z“) performed to all tree resp. grass placements.
<GLOBALTREEDEFINITION SCALE="3.011785" UPROTATION="None" FLIPAXIS="None"/>
<GLOBALGRASSDEFINITION SCALE="3.011785" UPROTATION="None" FLIPAXIS="None"/>

All tree placements of the exported sector will be written between the following tags:
<SECTORTREES>
.......
</SECTORTREES>

For every exported tree there is one xml data element <TREEPLACEMENT>. It has two parameters <NAME>
for the tree name as it is used by the tree manager (for example its file name) and <UID> for the unique ID
defined for this tree placement. Below this data element there are 3 more data elements defining the position,
orientation and size of the tree placement. The <POSITION> is given as the <X> and <Y> coordinate in meters
with respect to the sector's origin. <Z> is the vertical position of the tree computed by the terrain height and the
tree's height over ground. The tree's height over ground is given in the <HEIGHT> parameter in meters. The
<ORIENTATION> is given in degrees as rotation about the <Z> (up-)axis. At least the <SIZE> of the tree is giv­
en as a <SCALE> factor. The comments entered for a tree placement are exported in the <COMMENTS> tag.
<TREEPLACEMENT NAME="conifer01.X" UID="41366ef9-375f-4e63-9136-4574ea4fe3b6">
<POSITION X="213.000000" Y="82.000000" Z="31.516715" HEIGHT="0.000000"/>
<ORIENTATION Z="0.000000"/>
<SIZE SCALE="2.000000"/>
<COMMENTS>A comment</COMMENTS>
</TREEPLACEMENT>

Next all grass placements are exported between the following tags:
<SECTORGRASSES>
.......
</SECTORGRASSES>

The format for the single grass placements is very similar to the one of the tree placements. However, grass
placements have always a height of 0 over ground and do not have any comments or UIDs. So these fields are
missing in the grass placement export.
<GRASSPLACEMENT NAME="bush01.X">
<POSITION X="153.78" Y="23.43" Z="42.423414"/>
<ORIENTATION Z="0.000000"/>
<SIZE SCALE="2.000000"/>
</GRASSPLACEMENT>

98
15 Program Settings

15.1 Render Device Settings


To affect the performance of 3d rendering you can set some parameters for the rendering device used by PnP
TerrainCreator. The <Render device settings> dialog shown in the following figure will be opened automatically
at the program startup, if the rendering device could not be created. It can be opened later anytime from the
<Settings, 3D render device settings> menu.
Within the upper <Device settings> frame the base settings for
the DirectX rendering device used in PnP TerrainCreator can be
set. PnP TerrainCreator should automatically find the best settings
here when it is executed the first time. Only experienced users
should manually change these settings. Changes might be neces­
sary if you insert a new graphics card into your PC or if PnP Ter­
rainCreator does not start for some reason. You should in either
case contact our support before changing these settings.

15.1.1 Optimize the Rendering Speed


To speed up the rendering performance of PnP TerrainCreator you can set the maximum number of rendered
objects and the maximum viewing distances. Please see section 2.4.1.

15.2 Loaded PlugIns


Via the menu <Settings, PlugIn loading...> one can specify,
which PlugIns should be loaded, i.e. which PlugIns should not
be loaded. In the following dialog, all PlugIns which are cur­
rently installed are listed. By unchecking a PlugIn in this list, it
will be excluded from loading, when the program is started
the next time.

99
15.3 Customizing the Window Layout
The positions of the base user interface elements (tool windows, viewport, etc.) can
be customized via the menu <Settings, Window layout...>. The checkboxes in the
lower region of the following dialog specify the location of the elements. A preview of
these settings will be visualized in the upper region of the dialog.

100
15.4 Keyboard Layout
Finally, the keyboard functions assignments can be set via the menu
<Settings, Keyboard function mapping...>. The following dialog lists
all keyboard functions grouped by editing context (edit and view
mode). To alter/assign a new key combination to a function, your
have to expand the function by pressing the small + in front of it.
Next the <Key> field for this function specifies the key, which should
be pressed to activate it. The next three fields <Shift>, <Ctrl>, and
<Alt> determine, whether one of these control keys should be
pressed (True) or not (False).
Using the <Defaults...> button, the default key assignments can be
restored. There are two sets of predefined key assignments. One for
WASD control in 3D view mode and one for cursor key control. You
can select between this two sets via the context menu, which will
open up, when you press the <Defaults...> button.

101
16 Glossary

Coming soon.

viii
17 Index

Coming soon.

ix

Você também pode gostar