Water Editor
Last updated
Last updated
The Water Editor [water] is an integrated tool within the Map Editor. It is used for creating water bodies such as lakes, rivers, and seas on maps.
There are two ways to switch to the Water Editor:
Click on the water icon in the Sidebar menu of the Map Editor.
Press the 3 key on the keyboard.
A pool is a single water surface mesh. Examples of pools:
river
lake
sea
river flowing into a lake or sea
The list of all pools on the map can be found in the Pools
window.
The Altitude
parameter value sets the water surface level height for the selected pool in the list.
Pools with Altitude
values within 10 game units (0.5m) will be rendered at the same level for optimization purposes.
Gem RTS rendering supports up to 16 different water surface levels.
When creating multiple water levels, it is important to consider that rendering each level is equivalent to rendering an entire scene, which impacts fps. A good practice in map design is to justify the necessity of different water levels from a game design perspective.
If the water surfaces are not connected to each other (e.g., 2 lakes), they should be made as separate pools.
River branches with different flows are allowed to be made as separate pools (details are described below).
Each water level should be justified by game design.
Before creating a pool, it is recommended to use the Land Editor tools to prepare the land surface relief at the location of the intended water body.
Right-click in an empty area of the Pools window to open the context menu.
Select the Add...INSERT
option.
Enter the name of the pool in the Input
window that appears and click the Ok button.
The name of the pool will appear in the list in the Pools
window.
The process of creating a water surface mesh is similar to creating and editing ground surface mesh polygons in the Polygons Editor.
From the pool list, select the pool name for which you need to create or edit the water surface mesh.
Set the Altitude
parameter value
Use the Polygons brush to create and edit the water surface mesh
When creating and editing the water surface mesh, ensure that the water mesh polygons intersect with the ground surface mesh at the expected shoreline locations to avoid gaps between the surfaces.
Pools can be sounded using the area
entity
The Polygons brush is used to create and edit the pool's water surface mesh.
To add polygons to the water surface mesh, press and hold the left mouse button (LMB) and move the mouse in the desired direction.
To delete polygons, press and hold the right mouse button (RMB) and move the mouse over the polygons you want to remove.
Wireframe
checkbox
Enable/disable the display of the water surface mesh polygonal grid.
Level
The segmentation level of the water surface mesh polygons. Higher values increase the number of polygons by subdividing each into smaller parts, making the mesh more detailed.
Level Up
button
This button increases the base size of the polygons in the mesh.
It is recommended to increase the Level
parameter at river bends to segment polygons into smaller pieces, ensuring smoother water material texturing on the mesh surface.
The Level Up
operation is irreversible as it changes the base triangle size. This can disrupt the existing texture mapping on the surface.
The Flow tool is used for creating currents in river pools.
Set guide points for the Flow curve; the engine will generate texture coordinates to create the appearance of flow.
Edit the curve points to form a smooth line corresponding to the riverbed and current.
Creation
Activated when there is no curve.
Each LMB click on the map adds a node point.
RMB click adds the last point and exits creation mode.
Editing
Activated when hovering over an existing line or point.
LMB on the curve (not on a point) creates a new point on the curve.
Holding LMB on a curve point allows you to move the selected curve point on the map.
RMB on a curve point deletes the point.
The start and end points should extend beyond the visible part of the river, "into" the banks or beyond the edge of the map.
At bends, it is recommended to place the Flow curve point closer to the inner corner of the riverbed for a more natural-looking flow animation.
In areas where the water current direction changes, it is recommended to make a more detailed mesh (use Polygons brush level 5) for smoother mixing of water movement animations.
There are no restrictions on the number of curve points and the length of the curve.
The position of the Soft-Sharp
and Slow-Fast
sliders determines the smoothness and speed of the Colors and Materials brushes in the Water Editor.
The Colors brush is used to paint the vertices of the water mesh.
It works similarly to the Colors brush in the Land Editor.
When using the Colors brush, it is recommended to set the water material color parameter to white, as the colors of the water material and mesh vertices multiply during painting. Therefore, the default vertex color in the material scheme will neutralize the brush color.
The Materials brush is used for painting the water surface.
Each pool contains its own list of materials.
You can add materials to the selected pool using the Add
button.
Materials can be imported from other pools or maps by clicking the Import
button.
The water material parameters configuration window opens when selecting a material from the list on the Materials tab.
The land_texture_basis
parameter is present in all map materials and sets the value of the base tile for the land material. By default, it is set to 15.
Water materials are divided into two types:
one-layer;
two-layer.
The basic scheme that determines the number of layers in the material is selected from the list in the line with the material name.
When adding a new water material, the one-layer material scheme water/flow
is used by default.
The SDL file of the scheme is located in the resources at the following path:
\resource\entity\service\water\water.mtl
Material parameter values can be configured directly in the Water Editor on the Materials tab by selecting the material from the list.
textures
In the textures block, you need to select textures for noise (bumpvolume_noise) and waves (bumpvolume_wave). The textures should not be the same.
color
The color of the water surface mesh.
Blue
specular_power
The degree of surface gloss, affects the size of the specular spot from the Sun.
3000
bumpiness_noise
The degree of relief of the ripple texture.
1
specular_amount
The amount of specular reflection.
soft_attenuation
Affects the blurriness of the water edges and indirectly the refract/reflect ratio. This parameter should be changed together with fresnel_power.
0.1
refraction_scale
The distortion coefficient of the refract component by water oscillations (0 - no distortion).
0.1
density
The ratio coefficient of color/refract to simulate water transparency. The higher the value, the thicker the water appears and the less visible the bottom.
0.002
reflection_scale
The distortion coefficient of the reflect component by water oscillations (0 - no distortion).
0.1
fresnel_power
The ratio coefficient of refract/reflect - the reflective capacity of the water surface. The higher the value, the less reflective the water surface will be.
2
fresnel_scale
The Fresnel enhancement coefficient.
1.2
bumpiness_wave
The degree of bumpiness of the wave texture.
0.05
period_wave
The frequency of wave oscillations.
1
tile_wave
The stretching of the wave texture. Large tile_wave values should not be used on large water surfaces to avoid visible texture tiling.
1
period_noise
The frequency of ripple oscillations. This parameter should be set so that its value is not equal to period_wave.
1
tile_noise
The stretching of the ripple texture. The parameters tile_noise and tile_wave should be set so that tile_noise is at least twice the size of tile_wave.
2
speed_noise
The speed of the animation playback on the ripple texture.
0.001
speed_wave
The speed of the animation playback on the texture imitating the water flow.
0.01
angle
The angle of texture rotation when painting with the material.
0
alpha_min
The minimum alpha channel value.
1
Double-layer materials water/layered_2
are used to create visually different water in different areas within a single pool (e.g., a river flowing into a lake).
Configure the material parameters for the first layer, similar to a single-layer material (e.g., a river).
Configure the material parameters for the second layer, similar to the second material (e.g., a lake).
The parameters for each layer are similar to the parameters of a single-layer material.
Transitions between water materials are done similarly to transitions between materials on the land surface.
The transition between one-layer materials should be painted with a two-layer material so that the materials of the two-layer material align with the corresponding materials of each of the two adjoining one-layer materials.
Use LMB and RMB for materials from layer 1 and 2 respectively.
RMB with Ctrl held down (the ‘pick’ feature) selects the water material at the click point, with the following possible outcomes:
If it's a material from the current pool, it will become active in the materials list.
If the current pool is empty (there are no polygons in the pool yet), the material from the scene will replace the current material.
Otherwise, the material will be added to the current pool's material list.
Spots with different water properties can be made using the two-layer material water/layered_2
:
The first layer exactly repeats the settings of the pool's main material, but with the alpha_min
parameter set to 1.
Configure the second layer according to the visual requirements of the different water spot and set the alpha_min
parameter to 1.
Paint the different water spots with RMB held down.
If you need to create different water flow directions in different areas of the water surface, this can be done in several ways:
Using a two-layer material with different angle
parameter values in the layers.
Creating multiple pools and then visually combining the pools.
If you need to visually combine several pools with different flow curves, it is convenient to blend the water materials in the pools using the water/flow
material with the alpha_min
parameter set to 0.
To prevent the junctions of the pools from flickering, set the Altitude
parameters of the pools with a height difference of 0.001.
Water color consists of the following components:
reflect - reflection (from the reflection texture)
refract - bottom (from the scene texture)
color - the color of the water body, affected by lighting sources
specular - surface highlights from light sources
color
density
fresnel_power
specular_power
soft_attenuation
bumpiness
tile
period
refraction_scale
reflection_scale