From NeoAxis 3D Engine Wiki
|Language:||English • Russian||Status:||Approved|
HeightmapTerrain is the basic tool you will use to create heightmap based terrains. It has convenient tools for editing the geometry and painting textures. Before you start working with the terrain, we recommend that you learn how to create a simple map.
Working with the Terrain
To add a terrain to your map, you you need to use the Base\Types\HeightmapTerrain type. You will find it in the Object Creation window of the Map Editor.
By default, the terrain is flat and painted with a grass texture. In order to edit the terrain, select it in the Objects window and click the Edit button located at the bottom of the properties list.
The terrain editing window appears.
Terrain Editing Tools
Using the editing tools, you can modify the geometry, paint textures, and create holes in your terrain.
Editing the terrain is done by painting it: terrain is a canvas, and the tool is a brush. You can paint on the terrain by holding the left mouse button. The longer you brush on the same place of the terrain, the stronger the terrain changes.
3 toolsets are at your disposal to edit the terrain.
A set of tools used to edit the geometry of the terrain.
|Geometry Raise||Raise the terrain. If you hold down the Shift key, the terrain will be lowered.|
|Geometry Lower||Lower the terrain. If you hold down the Shift key, the terrain will be raised.|
|Geometry Smooth||Smooth the terrain.|
|Geometry Flattern||Flatten the terrain.|
A set of tools used to texture the terrain. Painting is done by layers, which need to be configured in the Layers property of the heightmap terrain.
|Paint||Painting the texture with a brush. When pressing the Shift key, the tool erases the texture.|
|Clear||Cleaning of the terrain. Act as an eraser, remove the texture painted. When pressing the Shift key, the tool paints the terrain.|
|Paint Smooth||Smoothing coloring of the neighbouring areas.|
|Paint Flattern||Coloring alignment. You can extend already painted area with this tool.|
You can create holes in the terrain with this set of tools.
|Add Hole||Create holes. If you press the Shiftkey, the holes will be deleted.|
|Remove Hole||Remove holes. If you press the Shift key, the holes will be created.|
The way the brush affects the terrain can be adjusted with the following parameters:
|Shape||Shape of the brush. You can choose between Circle and Square.|
|Outer Radius||Outer radius of the brush. In the area between the outer and inner radii, the brush effect on the terrain gradually weakens.|
|Inner Radius||Inner radius of the brush. The brush effect is at it's maximum strenght in the area inside the inner radius.|
|Strength||The impact of the tool on the terrain. The higher the value, the faster the brush will modify the terrain.|
The layers are used for texturing the terrain.They can be configured in the Layers property of the heightmap terrain. You need to press "..." to customize layers.
You can edit the list of layers in the popup window.
The buttons Add and Remove are used to add and remove layers.
Each layer have the following settings:
|BaseScale||The stretch factor of the base texture.|
|DetailMap||Detail texture overlayed on the diffuse texture.|
|DetailNormalMap||Normal map for the detail texture.|
|DetailScale||The stretch factor of the detail textures.|
|DetailSpecularMap||Specular map for the detail texture.|
|Name||The name of the layer.|
|ProjectionAxis||This parameter sets which axis you want to stretch the texture. The selected axis sets the normal to the plane, which will stretch the texture. If the selected axis is ZAxis, then the texture will be stretched on axes X and Y. Similarly, for Y — X and Z and for X — Y and Z. You also need to remember that, for example, a rock texture can be located on vertical surfaces and horizontal. To avoid this, for this type of textures you can create 2 layers with different ProjectionAxis.|
|SpecularColor||The color of the specular highlights.|
|SpecularShininess||Determines the strength of the specular highlights (corner of dispersion).|
|Components||List of attached components.|
|LogicClass||Reference to the Logic Editor class. Read more about how to work with the Logic Editor class.|
|Tags||User defined information. Defined as key — value pairs. It is used for user's needs.|
|Type||Object type. It can not be changed.|
|AllowVertexTextureFetchOptimization||Enable/disable terrain rendering optimization. This optimization reduces the amount of memory used.|
|HeightmapSize||The texture size of the terrain. The higher the value, the more detailed the terrain will be.|
|HorizontalSize||Size of the terrain.|
|LODSettings||Group of properties used for level of detail settings.
|Position||The position of the terrain on the map.|
|TileSize||Tile size. A Tile is a group of cells of the terrain, which is drawn with a single drawcall. For example, 16x16 is 256 cells that are drawn together. If there is at least one cell from a tile visible, the engine draws the entire tile. You also need to remember that you cannot put more than 5 texture layers on one tile. This option is recommended to select during the optimization of the map.|
|VerticalSize||Maximum height in meters. The terrain can not be raised higher than specified in this parameter. It is important to configure it before you edit your HeightmapTerrain, otherwise, changing this parameter will change the height of your whole terrain.|
|Visible||Show or hide the terrain.|
|AmbientOcclusion||Ambient Occlusion calculation settings.
|CastDynamicShadows||Enable/disable terrain shadows. If True is chosen, then the terrain will cast shadows.|
|DetailMapDistance||Visibility radius for the detail textures, depending on the camera.|
|Layers||The list of texture layers. Layers are used to texture the terrain. More info about editing the layers here.|
|MasksSize||The pixel size of the mask used to paint textures. The higher the value, the more detailed/smoother blend layers will be and the clearer will be the texture splatting.|
|ReceiveStaticShadows||Enable/disable the geometry of the terrain in the calculation of static lighting. More info about static lighting here.|
|RenderQueueGroup||The render order of the terrain relative to other objects|
|SimpleRendering||Switch to the simplified rendering method. Normal maps, reflections and shadows are disabled in this mode. This mode increases productivity.|
|Collision||Enable or disable the calculation of collisions between objects and the terrain.|
|CollisionHeightfieldThickness||Thickness of the body used in the computation of terrain physics. Used only in PhysX.|
|CollisionMaterialName||Type of terrain. You can choose from 4 values: Metal, Wood, Rubber, Ice. This parameter affects the properties of the physical bodies interaction.|
Problems and Solutions
Configuring the Levels of Detail
Often when editing terrain you can see holes in the geometry. This problem is solved by modifying the LOD calculation formula or by disabling levels of details (speed noticeably decreases when LOD is disabled). To modify the calculation formula, you need to go to properties, expand the list LODSettings and configure the property LodLevelDistances, which is described above.