This page has been translated automatically.
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
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Mesh Deferred Decal

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

Notice
This decals are always of the same size regardless of the projection box location relatively to the projection surface.

Roads Based on the Mesh Deferred Decal

See Also

  • A DecalDeferredMesh class to edit mesh deferred decals via UnigineScript
  • A decal_deferred_base material to be applied to the decal
  • 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 Deferred Decal

To create a mesh deferred decal choose an Add Deferred Decal option in the list of nodes in Editor panel. In the opened creation dialog window choose the Mesh tab and specify initial parameters:

Creation Window
Material A material of the decal.
Radius The height of the projection box along the Z axis, in units.

After the initial parameters are set, press Ok button and choose a mesh for the decal in the opened dialog window:

Path to the Mesh
Notice
An exported mesh should have less than 10000 polygons.

Press Ok button and place the decal somewhere in the world.

Editing a Mesh Deferred Decal

In the Decal tab you can adjust the following parameters of the mesh deferred decal:

A Decal tab

Setting Bit Masks

A set of bit-masks available for the decal:

Decal A mask of the decal, specifying the objects onto which the decal can be projected.
Light A light mask, specifying light sources illuminating the decal.
Viewport A viewport mask, specifying if the decal can be seen in the camera's viewport.

Projection Parameters

Parameters of the decal projection:

Radius The height of the projection box along the Z axis, in units.
Radius = 10
Radius = 20

Controlling a Decal

Parameters for the existing decal control:

Load Load another mesh for the decal.
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: 2017-07-03
Build: ()