<<back

Gradient tool

Gradient tool enables you to create smooth height map transitions (slopes). It is currently the most complex tool in the editor.

Anatomy of gradient tool

Gradient tool uses a skeleton (which I call a "grid") to model the desired hmap shape. The grid has two sides - left and right, which is given by direction of how the grid was defined. Grid consists of pairs of point sets on sides, these define two edges.

The gradient tool modifies height map shape between the two edges by creating a smooth transition between them. The white edge lines change color to red in places where the hmap limits would force the actually calculated hmap to be cut off at minimum or maximum levels (below 0 or above 255). You will probably want to avoid such situations.

Point set

A "point set" an edge point paired with its control point. Both are indicated and moveable by colored spheres.

Creating a grid

Point sets can be added to and removed from gradient tool grid in the "add points" editing mode, which is the default mode after grid tool is invoked. Point sets are always added and deleted in pairs (one point set on side).

LMB
in free space will add a new pair of point sets to the end of the current grid.
on any point will insert a new pair of point sets after the pair into which the clicked-on point belongs.
RMB
on any point will delete the entire pair of point sets into which the clicked-on point belongs.

Editing the grid

Changing the view

In general, the gradient tool grid is edited by clicking and dragging the grid points. Anywhere else (i.e. not over a point) the mouse has view controlling functionality (dragging and zooming), except in the mode where you add/delete points. If you hold the CTRL key it is an 'escape' from the current tool and, the mouse has view controlling functionality everywhere.

Editing edge points

To edit edge points select the "edit points" mode.

LMB+drag
move the edge point horizontally (set location within height map)
LMB+drag+shift
move the edge point vertically (set height)
RMB
Bring up context menu for the point.

Editing control points

To edit control points select the "edit points" mode.

LMB+drag
move the control point in 3D space. Since mouse and the screen are 2D devices, it is difficult to edit all three dimensions at once. Therefore, control point always moves within an "editing plane".
LMB+drag+shift
When the control point is too close to its edge point so much that they overlap, hold down shift to edit the control point. Without shift the edge point will be the preferred choice for editing.
RMB
Bring up context menu for the point.
RMB (while LMB is down)
While dragging a control point, the point moves within an "editing plane". There are several editing planes. You can switch between them by clicking RMB while the point is being edited (LMB is down).
The planes are:
An editing plane is indicated by a yellow partially transparent grid:

Editing the whole grid at once

You can rotate, resize, stretch and move the whole grid. To do this select one of these modes:


Scaling enlarges/shrinks the entire grid in all directions. Stretching enlarges/shrinks the grid in only one direction, along the line between the reference point and the point being dragged.

In both modes:

LMB+drag
if reference point is not selected, or you drag the reference point, this will move the grid around
if reference point is selected and you drag a different point, this will rotate/scale/stretch the grid
RMB
Select reference point. This point will be the center of rotation or fixed point used for scaling or stretching.

Masking

The menu in gradient tool dialog includes a 'mask' submenu. This submenu includes a few operations which set the current editing mask.

Mask is normally set using the marker tool, but it might be convenient to set mask to an area covered by the gradient tool grid or the surrounding area for later manual editing. For example, you might want to create a strip of road using gradient tool and then edit landscape around it, preserving the road itself. To achieve this:

  1. turn off masking
  2. use gradient tool to create the strip of road
  3. before closing gradient tool, set the mask to everything except the gradient grid area
  4. after closing gradient tool, enable masking and use other tools to manipulate the landscape

If you accidentally close the gradient tool dialog before setting a mask, you can reopen it and load the last edited grid.

Be aware that gradient tool obeys the current mask, if masking is enabled. These options do not turn on masking if it is disabled, they only set the mask values. This is so that when the gradient tool is applied, it is not limited by the mask set via options in this sub-menu. Of course, if you enable masking yourself, gradient tool will be limited by it.