This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Mesh Decal

A mesh decal is a decal based on the arbitrary .mesh file and projected onto a surface by means of the orthographic projection.

Notice
  • The mesh that is used for projection should contain a single surface. In case if the mesh contains several surfaces, only the one with the 0 index will be used. Thus, the area of the decal will differ from the initial mesh.
  • The decals are always of the same size regardless of the projection box location relatively to the projection surface.

Roads Based on the Mesh Decal

See Also

  • A DecalMesh class to edit mesh decals via UnigineScript
  • A set of samples located in the data/samples/decals/ directory:
    1. deferred_mesh_00
    2. deferred_mesh_01
    3. deferred_mesh_02
    4. deferred_mesh_03
    5. deferred_mesh_04

Creating a Mesh Decal

To create a mesh decal

  1. On the Menu bar, choose Create -> Decal -> Mesh.

  2. In the file dialog window that opens, choose a mesh for the decal:

    Notice
    An exported mesh should have less than 10000 polygons.
  3. Press Ok button and place the decal somewhere in the world (for the decal to be projected, the mesh should intersect the surface).

Editing a Mesh Decal

In the Decal Mesh tab of the Parameters window you can adjust the following parameters of the mesh decal:

Decal Mesh tab

Also the most commonly used parameters of the mesh decal were placed in the Node tab:

A Node tab of the Mesh Decal Node

Setting Bit Masks

A viewport bit-mask is available for the decal node:

Viewport A viewport mask, specifying if the decal can be seen in the camera's viewport.
Notice
You can specify a shadow mask and a material mask in the decal_base material.

Projection Parameters

Parameters of the decal projection:

Radius The height of the projection box along the Z axis, in units.
Radius = 10
Radius = 20
Mesh file Path to the .mesh file on which the decal is based. If any changes are made in the current mesh, click Reload.

Controlling a Decal

Parameters for the existing decal control:

Load Load another mesh for the decal.
Reload Reloads a mesh specified in the Mesh file field.
Save Save the given decal into the .mesh file.
Project Project a decal onto the terrain (a decal must be a child of the terrain object).

Life-time Parameters

Life-time and fade-out parameters:

Life time A time period during which the decal will be projected, in seconds.
Fade time A time period during which the decal will fade away (after its life time exceeds), in seconds.

Visibility Parameters

Parameters controlling decal's visibility depending on the distance:

Min visible A minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible, in units.
Fade A minimum fade-in distance, across which the decal smoothly becomes visible due to the alpha fading. It is counted starting from the minimum visibility distance value, in units.
Max visible A maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible, in units.
Fade A maximum fade-out distance, across which the decal smoothly becomes invisible due to the alpha fading. It is counted starting from the maximum visibility distance value, in units.

Texture Coordinates Transformation

Decal's texture coordinates transformation (a texture atlas can also be used):

ScaleX A texture scale along the X-axis. For example, by the scale of 2 the texture is repeated twice on one decal.
TranslateX A texture offset along the X-axis. For example, by the offset of 0.5 along the X axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).
ScaleY A texture scale along the Y-axis.
TranslateY A texture scale along the Y-axis.

Setting a Material

A material selection:

Material A new material of the decal.
Last update: 2018-04-26
Build: ()