Documentation/Entity Types/Base/HeightmapTerrain.type

From NeoAxis 3D Engine Wiki

Jump to: navigation, search
Go to higher level

Contents

Overview

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.

Terrain based on heightmap

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.

HeightmapTerrain 001.jpg

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.

HeightmapTerrain 002.jpg

The terrain editing window appears.

HeightmapTerrain 003.jpg

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.

Editing Geometry

A set of tools used to edit the geometry of the terrain.

HeightmapTerrain 004.jpg
Name Description
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.
HeightmapTerrain 005.jpg

Texture Painting

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.

HeightmapTerrain 006.jpg
Name Description
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.
HeightmapTerrain 007.jpg

Creating Holes

You can create holes in the terrain with this set of tools.

HeightmapTerrain 008.jpg
Name Description
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.
HeightmapTerrain 009.jpg

Configuration Tools

Configuring Brush

The way the brush affects the terrain can be adjusted with the following parameters:

HeightmapTerrain 010.jpg
Name Description
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.

Configuring Layers

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.

HeightmapTerrain 012.jpg

You can edit the list of layers in the popup window.

HeightmapTerrain 013.jpg

The buttons Add and Remove are used to add and remove layers.

Each layer have the following settings:

Name Description
BaseMap Diffuse texture.
BaseNormalMap Normal map.
BaseScale The stretch factor of the base texture.
BaseSpecularMap Specular map.
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 YX and Z and for XY 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).

Properties

Name Description
class Entity
Components List of attached components.
LogicClass Reference to the Logic Editor class. Read more about how to work with the Logic Editor class.
Name Object name.
Tags User defined information. Defined as keyvalue pairs. It is used for user's needs.
Type Object type. It can not be changed.
Geometry Group
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.
  • Enabled allows you to completely disable level of detail optimizations.
  • LodLevelDistances specifies a formula for calculating the levels of detail. You can enter an arbitrary formula. The parameter "level" is the level of detail and takes values 0, 1, 2, 3, and so on. Output formula gives the switching distance of a certain level to the next. Default: "100 + level * 200".
  • MaxCount — the maximum number of LOD levels.
  • MorphAreaPercent defines the width of the transition between LOD levels. By default equal to 0.3, i.e. 30% of the distance between the two levels.
  • ShowLevels helps to see each LOD level (for debugging).
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.
Painting Group
AmbientOcclusion Ambient Occlusion calculation settings.
  • Blur — blur the texture after calculation or not.
  • Enabled allows you to enable/disable Ambient Occlusion.
  • IterationCount — the number of iterations of the calculation. The higher the number, the better the quality will be and the longer the calculation process will take.
  • Power — the power of the AO effect.
  • RayLength — the length of the ray in the calculation. Affects the softness of the result.
  • Size — the size of the texture
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.
Physics Group
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.

HeightmapTerrain 014.jpg