UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Tutorials

mesh_terrain_base

A mesh_terrain_base material can be used as a part of terrains (for example, to create caves, bunkers, etc.) and shaded in the same way as for seamless integration.

States

In the States tab you can set rendering passes and available options. Enabling some of the states activates additional textures and parameters in the Textures and Parameters tabs respectively.

The states divide into 2 groups: Passes and Options.

Possible values for all the passes:

GUI name XML name Description
Skip none Material is not rendered during the pass.
Default default Material is rendered during the pass.

Possible values for the options except an Ambient light option:

GUI name XML name Description
None none Material is not rendered.
Overlay overlay Material is rendered in the overlay rendering mode: a material is blended with terrain diffuse color.
Overlap overlap Material is rendered in the overlap rendering mode: only a decal material is applied, underneath terrain textures are ignored.

The Ambient light option can be either enabled or disabled by ticking the respective box.

The states available for this kind of materials are listed below.

Passes

Passes specify during which rendering pass the material should be rendered. They are modified in the Passes field of the States tab.

GUI name XML name Description
Deferred deferred Deferred rendering pass. Specifies if the material should be rendered during the deferred pass. For the transparent surfaces see also a Post deferred option.
Auxiliary auxiliary Auxiliary rendering pass. Specifies if the material should be rendered into the auxiliary buffer to create a custom post-process.
Ambient ambient Ambient rendering pass. Specifies, how the material should be rendered during the Ambient light pass for the opaque objects. The actual opacity or transparency of the material depends solely on the set blending options.
Light spot light_spot Spot lights rendering pass. Specifies, if the material should be rendered illuminated by the Spot light sources during the light and shadows rendering passes.
Light omni light_omni Omni-directional lights rendering pass. Specifies, if the material should be rendered illuminated by the Omni light sources during the light and shadows rendering passes.
Light proj light_proj Projected lights rendering pass. Specifies, if the material should be rendered illuminated by the Projected light sources during the light and shadows rendering passes.
Light world light_world World lights rendering pass. Specifies, if the material should be rendered illuminated by the World light sources during the light and shadows rendering passes.

Options

The following options are set in the Options field of the States tab.

GUI name XML name Description
Detail 0 detail_0 Sets the rendering mode for the first detail material.
Detail 1 detail_1 Sets the rendering mode for the second detail material.
Detail 2 detail_2 Sets the rendering mode for the third detail material.
Detail 3 detail_3 Sets the rendering mode for the fourth detail material.
Ambient light ambient_light

This option allows to draw a decal in a fewer rendering passes, that increases the performance. Perform the following steps for that:

  1. Enable Ambient light option. When the decal will be rendered during the ambient light pass, world lights that illuminate the world will modulate its color.
  2. Disable Passes -> Light world rendering pass for the decal by choosing Skip (as the world light has already contributed to the decal color).

As the result, the decal will be drawn only once during the ambient pass instead of being redrawn twice.

Notice
No shadows from objects can be casted on the decal if Ambient light is enabled and a world light pass is skipped.

Textures

The textures available for this kind of materials are listed below.

Base Textures

Base textures are loaded and modified in the Base field of the Textures tab.

GUI name XML name Description Channels
Diffuse diffuse Diffuse map. A texture to define a decal surface's main color. RGBA:
  • RGB values store a color of the texture
  • An alpha (A) value contains either transparency values or a detail mask
Notice
An alpha (A) value will store transparency values if an Alpha test option is enabled. Otherwise it will store a detail mask.
Normal normal Normal map. A texture to store information about a surface's normals deviation. RG:
  • RG values contain two components of a normal
  • The third component's value is calculated from the given components in run-time
Mask mask A mask for four detail materials. Indicates where a detail texture should be seen. R8/RG8/RGB8/RGBA8
Notice
The above textures with the _d, _n and _m postfixes in the name respectively, located in a folder named uncompressed, will be automatically compressed by the engine.

Detail Textures

Each pair of the detail textures is present only if any of Detail 0, 1, 2 or 3 options (or their combination) is enabled. These textures are modified in the Detail field of the Textures tab.

GUI name XML name Description Channels

Diffuse 0

Diffuse 1

Diffuse 2

Diffuse 3

detail_0_diffuse

detail_1_diffuse

detail_2_diffuse

detail_3_diffuse

A diffuse map for the respective detail material. RGBA:
  • RGB values store a color of the texture
  • An alpha (A) value contains either transparency values or a detail mask
Notice
An alpha (A) value will store transparency values if an Alpha test option is enabled. Otherwise it will store a detail mask.

Normal 0

Normal 1

Normal 2

Normal 3

detail_0_normal

detail_1_normal

detail_2_normal

detail_3_normal

A normal map for the respective detail material. RG:
  • RG values contain two components of a normal
  • The third component's value is calculated from the given components in run-time

Parameters

In the Parameters tab you can set or modify base and additional parameters.

Parameters of different types are set in different ways:

  • expression - vector values can be set either in the field near the parameter or in the dialog window opened when double clicking this field
  • slider - the value can be set either by smoothly moving the slider of the scroll box or manually in the box near the parameter (if required, the value bigger than maximum one for the slider can be set)
  • color - the color can be chosen in the dialog window, activated after double clicking the color field

The parameters available for this kind of materials are listed below.

Transform Parameters

Texture transformation parameters are modified in the Transform field of the Parameters tab. Detail materials transformation parameters are present only if any of Detail 0, 1, 2 or 3 options (or their combination) is enabled.

GUI name XML name Type Description
Base base_transform expression Base texture coordinates transformation. A vector of the four float components, consisting of two pairs of vector elements:
  1. Scale texture coordinates, along X and Y axes.

    For example, by the scale of 2;2 the texture will be repeated four times on the surface.

  2. An offset of the texture respectively to its initial position along X and Y axes.

    For example, by the offset of 0.5 along X axis the texture will be repositioned to the right (so the left edge of the texture will be rendered in the center).

Detail 0

Detail 1

Detail 2

Detail 3

detail_0_transform

detail_1_transform

detail_2_transform

detail_3_transform

expression Terrain detail textures native coordinates transformation. A vector of the four float components, consisting of two pairs of vector elements:
  1. Scale texture coordinates, along X and Y axes.
  2. An offset of the texture respectively to its initial position along X and Y axes.

Notice
Besides the native texture coordinates transformation, there are more options of setting texture coordinates. They are described in the Texture coordinates transformation article.

Detail Parameters

Detail parameters for each of the first, second, third or fourth detail material (or their combination) are activated only if the respective detail material in the Options tab is enabled.

Detail materials are modified in the Detail 0, Detail 1 ,Detail 2 or Detail 3 fields of the Parameters tab.

Parameters differ accordingly to the rendering mode of the detail material.

If the detail material is rendered in the Overlay mode there are following parameters:

GUI name XML name Type Description
Diffuse detail_0_diffuse
detail_1_diffuse
detail_2_diffuse
detail_3_diffuse
slider A coefficient to modify the visibility of the diffuse map of the respective detail material.
Normal detail_0_normal
detail_1_normal
detail_2_normal
detail_3_normal
slider A coefficient to modify the visibility of the normal map of the respective detail material.

If the detail material is rendered in the Overlap mode there are following parameters:

GUI name XML name Type Description
Value detail_0_value
detail_1_value
detail_2_value
detail_3_value
slider A coefficient to modify the size of a detail material spreading inside the applied mask:
  • By the minimum value of 0, detail material is rendered everywhere
  • By the maximum value of 1, no detail material is rendered at all
Threshold detail_0_threshold
detail_1_threshold
detail_2_threshold
detail_3_threshold
slider

A coefficient to modify the smoothness of the detail material around the edges. For that, detail material is blended with the diffuse map or other detail materials underneath it.

The higher the value, the bigger the blending area of between detail material and terrain diffuse colors will be.

Diffuse detail_0_diffuse
detail_1_diffuse
detail_2_diffuse
detail_3_diffuse
slider A coefficient to modify the visibility of the diffuse map of the respective detail material.
Normal detail_0_normal
detail_1_normal
detail_2_normal
detail_3_normal
slider A coefficient to modify the visibility of the normal map of the respective detail material.

Auxiliary Parameters

Auxiliary color parameter is present only if an Auxiliary pass is set as a Default. The parameter is modified in the Auxiliary field of the Parameters tab.

GUI name XML name Type Description
Auxiliary auxiliary_color color A color picker to choose an auxiliary color for the Auxiliary rendering pass.

Ambient Parameters

Ambient parameter is modified in the Ambient field of the Parameters tab.

GUI name XML name Type Description
Environment environment_scale slider Environment lighting scale. A coefficient to scale how much the global environment texture illuminates the surface.

The higher the value, the more the colors will be corrected (lightened or darkened) according to the environment component.

Shading Parameters

Shading parameters are modified in the Shading field of the Parameters tab.

GUI name XML name Type Description
Diffuse diffuse_scale slider A coefficient to scale the brightness of the diffuse map.

The higher the value, the brighter the diffuse map is.
Specular specular_scale slider A coefficient to scale the brightness of the specular map reflections.

The default value of 1 grants the correct color. The higher the value, the brighter the specular reflections are.
Glossiness specular_power slider

A coefficient to modify size of the highlight (Phong lighting) of the specular map:

  • Low values imitate wider highlights, typically appropriate to create diffuse reflection from the mat surface
  • High values imitate pinpoint highlights, typically appropriate to create uniform reflection of light rays from the glossy surface
Fresnel bias fresnel_bias slider A coefficient to compensate for the Fresnel effect and set the minimum necessary reflectance level.

By the minimum value of 0, there is no compensation for the Fresnel effect.

Increasing the value leads to more prominent overall reflections.

By the maximum value of 1, reflections are at their maximum and the Fresnel power parameter does not influence the rendered image.
Fresnel power fresnel_power slider

A coefficient to scale Fresnel effect that defines the amount of reflectance depending on the viewing angle:

  • Low values provide good reflectance even at a large viewing angles
  • High values provide the reflectance only at a small viewing angles. When looking at a large viewing angle, from above, there are no reflections rendered
Last update: 2017-07-03