Escolar Documentos
Profissional Documentos
Cultura Documentos
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.
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
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).
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.
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.
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.
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.
9
Information The sector comments are not available with the Standard and Community Edition of PnP Terrain
Creator.
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).
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.
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
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.
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.
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.
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.
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:
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.
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.
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.
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.
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.
The lightmap is simply used as a second texture within the rendering passes, which modulates the resulting
pixel colors.
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.
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
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.
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.
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.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.
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.
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".
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:
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.
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.
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.
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.
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.
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.
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.
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.
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)
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)
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.
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.
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.
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.
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.
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.
52
Clicking the <Apply> button will apply all settings to the object.
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.
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.
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.
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.
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.
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.
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)
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.
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:
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
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.
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>.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
# 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.
# 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.
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).
# All textures available for a terrain project can be inserted into the export file using
# the following tag.
{Textures}
{Texture}
{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"/}
{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
# 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.
# 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.
# All textures used by one sector can be inserted into the export file using the following tag.
{SecTextures}
{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
# ------------------------------------------------------------------------------
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.
# 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.
# 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.
# 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.
# 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.
# 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.
# 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.
# 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.
{/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.
# 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.
# 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.
# 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.
# 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.
# 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.
{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}
{ObjectUserDefinedDataElement_Name/}
{ObjectUserDefinedDataElement_Type/}
{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.
# 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.
# 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.
# 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.
# 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.
# 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.
{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}
{TreeUserDefinedDataElement_Name/}
{TreeUserDefinedDataElement_Type/}
{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}
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.
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
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